How to handle the condition manager in json configuration

150 Views Asked by At

We have Java logic like this, we want to achieve through json condition manager:

((eConsentDate == null) || (!(eConsentDate == null) && !(leSentDate == null) && !(leReceivedDate == null) &&(leReceivedDate.after(currentDate))) ||(!(eConsentDate == null) && !(leSentDate == null) && !(leReceivedDate == null) && (leReceivedDate.before(currentDate) || (leReceivedDate.equals(currentDate)) && !(cdSentDate == null) &&!(cdReceivedDate == null) && (cdReceivedDate.after(currentDate))))

I have written json condition manager like this

{
  "conditionsList": [
    {
      "conditionName": "eConscentDate",
      "conditions": [
        {
          "condition": "(eSignDisclosuresDetails.eConsentDate == null)",
          "true": {
            "count": "1"
          },
          "false": null
        },
        {
          "condition": "((eSignDisclosuresDetails.eConsentDate != null) && (eSignDisclosuresDetails.leSentDate != null) && (eSignDisclosuresDetails.leReceivedDate != null)&& (eSignDisclosuresDetails.leReceivedDate >(currentDate.getTime())))",
          "true": {
            "count": "1"
          },
          "false": null
        },
        {
          "condition": "((eSignDisclosuresDetails.eConsentDate != null) && (eSignDisclosuresDetails.leSentDate != null) && (eSignDisclosuresDetails.leReceivedDate != null) && ((eSignDisclosuresDetails.leReceivedDate.getTime().before(currentDate.getTime())) ||(eSignDisclosuresDetails.leReceivedDate.equals(currentDate))) && (eSignDisclosuresDetails.cdSentDate != null) && (eSignDisclosuresDetails.cdReceivedDate != null) && (eSignDisclosuresDetails.cdReceivedDate.after(currentDate))))",
          "true": {
            "count": "1"
          },
          "false": {
            "count": "0"
          }
        }
      ]
    }
  ]
}

But the problem is to achieve the (leReceivedDate.after(currentDate)),(cdReceivedDate.after(currentDate)),(leReceivedDate.equals(currentDate) these fields in json.

While the time of parsing it's showing unresolved access method.

0

There are 0 best solutions below