Condition

This component allows custom conditions within a floor plan to control various aspects of the UI fields and tabs on the JET UI pages like field visibility, reference properties, field-level filters, and much more.

For example, in Oracle Insurance Gateway configuration page one can control display of fields based on the Agent Configuration Type that is, In folder Configuration or Out Folder configuration, in Oracle Health Insurance Enterprise Policy Administration, group and policy parameter values can be enabled or disabled fields based on the selected Parameter Type that is, amount, currency or Number of Units is made possible by this component.

Other use cases include,

  • Dynamic Logic page: Filters for LOV’s based on the dynamic logic sub-type

  • Control the display and properties for dynamic fields and records

Conditions can be defined to steer the following behaviors of the properties. They are as follows:

  • Display

  • Conditional always

  • Conditional never

  • Conditional notNull

  • Mandatory

  • Updatable

  • Read Only

  • Reference property

  • LOV to use

  • Filter

  • Default

  • applicable for single value properties and enum’s

  • Tab Visibility

  • Set To Null

Only the top-level element is influenced by the condition, that is the condition is added to show or hide a dynamic record, but not a particulate field of the dynamic record.

Conditions are made object state aware, that is different behaviors depending on whether an object is being created or edited.

The condition can be of the following types:

Standard

  • This condition returns True or False

  • Multiple properties are evaluated within the condition expression* Switch case:

Condition Configuration

Attribute

Description

name

name of the condition, is also specified as the conditional to evaluate on the triggering property

type

indicates the type of condition evaluation 1) Switch case (switch) 2) Standard(standard)

objectState

indicates if the condition is applicable only when object is in create mode or edit more, when not specified it means condition is applicable irrespective of the object state

evaluateConditions.condition

Applicable for the standard types only, contains the expression to evaluate.

evaluateConditions.switch

Applicable for the switch case types only. Switch case selector property

evaluateConditions.result

true, false or value of the selector property.

evalauteConditions.properties and its attributes

When condition evaluation or switch equals the result, specified property attributes are updated.

init

Specifies the list of conditions that must be evaluated when the page is reloaded. The object state is taken into account when init conditions are evaluated. For example, if the object state is create, then the init condition is only evaluated in the create mode.

Condition Configuration - Standard

{
 "conditions": [{
  "name": "sigTypeCondition",
  "type": "standard",
  "objectState": "always|create|edit",
   "evaluateConditions": [ {
    "condition": "expression to evaluate e.g. context.subtype.eq('FUNC')",
     "actions": [
       {
        "result": "result of evaluation : true/false",
        "properties": [

         {
          "name": "property 1",
          "filter": "modify filter"
         },
         {
          "name": "property 2",
          "setToNull": "true/false",
          "display": "never"
         }
        ]
       }
      ]
     }
   ]
  }
 ]
}
  • For example :

{
  "resource": "dynamiclogic",
  "floorplan_object_00": {
    "title": {
      "properties": [
        {
          "name": "code",
          "sequence": 1
        }
      ]
    },
    "actions": [
      "edit",
      "delete"
    ],
    "region": {
      "set1": {
        "tiles": [
          {
            "sequence": 1,
            "properties": [
              {
                "name": "subtype",
                "sequence": 1,
                "nonupdatable": true,
                "evaluateConditions": [
                  {
                    "name": "sigTypeCondition"
                  }
                ]
              },
              {
                "name": "baseDynamicLogic",
                "display": "never",
                "refType": {
                  "type": "dynamiclogic"
                }
              },
              {
                "name": "code",
                "sequence": 2
              },
              {
                "name": "descr",
                "sequence": 3
              },
              {
                "name": "signature",
                "sequence": 4,
                "refType": {
                  "type": "signatures"
                },
                "evaluateConditions": [
                  {
                    "name": "sigNameCondition"
                  }
                ]
              },
              {
                "name": "message",
                "sequence": 5,
                "refType": {
                  "type": "messages"
                }
              },
              {
                "name": "active",
                "sequence": 7,
                "default": true,
                "label": "pol_dynamiclogic_field_active_default"
              },
              {
                "name": "logic",
                "sequence": 8,
                "displayType": "text"
              }
            ]
          }
        ]
      }
    },
    "initConditions": [
      "sigTypeCondition"
    ],
    "conditions": [
      {
        "name": "sigTypeCondition",
        "type": "switch",
        "objectState": "always",
        "conditions": [
          {
            "name": "sigTypeCondition",
            "objectState": "always",
            "evaluateConditions": [
              {
                "condition": "context.subtype==='FUNC'",
                "actions": [
                  {
                    "result": "true",
                    "properties": [
                      {
                        "name": "signature",
                        "filter": "subtype.eq('FUNC')"
                      },
                      {
                        "name": "message",
                        "setToNull": "true",
                        "display": "never"
                      }
                    ]
                  }
                ]
              },
              {
                "condition": "context.subtype==='COND'",
                "actions": [
                  {
                    "result": "true",
                    "properties": [
                      {
                        "name": "signature",
                        "filter": "subtype.eq('COND')"
                      },
                      {
                        "name": "message",
                        "display": "always"
                      }
                    ]
                  }
                ]
               }
               ,
              {
                "condition": "context.subtype==='VAL'",
                "actions": [
                  {
                    "result": "true",
                    "properties": [
                      {
                        "name": "signature",
                        "filter": "subtype.eq('VAL')"
                      },
                      {
                        "name": "message",
                        "display": "always"
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}

Condition Configuration - Switch case

{
 "conditions":[
  {
    "name": " <name of the condition",
    "type": "switch",
    "objectState": "always|create|edit",
    "evaluateConditions":[
     {

      "switch": "<subject of switch case, name of the property>",
      "actions": [
       {
        "result": "<property value>",
        "properties": [
         {
          "name": "property 1",
          "filter": "modify filter"
         },
         {
          "name": "property 2",
          "setToNull": "",
          "display": "never"
         }
        ]
       }
      ]
     }
   ]
  }
 ]
}

For example : Configuring a switch case condition on the dynamic logic page to change the filter on signature depending on the sub-type.

{
 "resource": "dynamiclogic",
 "floorplan_object_00": {
  "title": {
   "properties": [
    {
     "name": "code",
     "sequence": 1
    }
   ]
  },
  "actions": [
   "edit",
   "delete"
  ],
  "region": {
   "set1": {
    "tiles": [
     {
      "sequence": 1,
      "properties": [
       {
        "name": "subtype",
        "sequence": 1,
        "nonupdatable": true,
        "evaluateConditions": [
         {
          "name": "sigTypeCondition"
         }
        ]
       },
       {
        "name": "code",
        "sequence": 2
       },
       {
        "name": "descr",
        "sequence": 3
       },
       {
        "name": "signature",
        "sequence": 4,
        "refType": {
         "type": "signatures"
        }
       },
       {
        "name": "message",
        "sequence": 5,
        "refType": {
         "type": "messages"
        }
       },
       {
        "name": "active",
        "sequence": 7,
        "label": "pol_dynamiclogic_field_active_default"
       },
       {
        "name": "logic",
        "sequence": 8,
        "displayType": "text"
       }
      ]
     }
    ]
   }
  },
  "initConditions": [
   "sigTypeCondition"],
  "conditions": [
    {
    "name": "sigTypeCondition",
    "type":"switch",
    "objectState":"always" ,
    "evaluateConditions": [
     {
      "switch": "context.subtype",
      "actions": [
       {
        "result": "FUNC",
        "properties": [
         {
          "name": "signature",
          "filter": "subtype.eq('FUNC')"
         },
         {
          "name": "message",
          "setToNull": "true",
          "display": "never"
         }
        ]
       }
      ,{
        "result": "COND",
        "properties": [
         {
          "name": "signature",
          "filter": "subtype.eq('COND')"
         },
         {
          "name": "message",
          "display": "always"
         }
        ]
       },
       {
        "result": "VAL",
        "properties": [
         {
          "name": "signature",
          "filter": "subtype.eq('VAL')"
         },
         {
          "name": "message",
          "display": "always"
         }
        ]
       }
      ]
    }
  ]
 }]
 }
}

Condition Configuration - initialization

Initialization conditions are always evaluated when the page is reloaded in the specified order.

{
 "initConditions": [
    "name of condition",
    "condition 2"]
}

Other Details

  • Conditions are evaluated at page load based on init block (see above) and whenever the linked property is changed that is, it acts as a trigger condition

  • Additional properties are used within the context of standard conditions for evaluation apart from the property on which condition properties are applied

  • These properties must be from the object (in context) in case of a recursive floor plan

  • In case multiple values evaluations, the operators AND/OR can be specified

  • For each property the following values can be evaluated:

=== or ==

Equal comparison operator, checks if left operand is equal to right operand

context.subtype=== 'FUNC'

!== or !=

Not equal comparison operator, checks if left operand is not equal to right operand

context.subtype!== 'FUNC'

>=

Greater than equal to operator, checks if left side operand is greater than equal to left side

context.sequence >= 10

>

Greater than operator, checks if left side operand is grater than left side

context.sequence > 10

Less than equal to operator, checks if left side operand is less than equal to left side

context.sequence ⇐ 10

<

Less than operator, checks if left side operand is less than left side

context.sequence < 10

&&

And operator, Performs logical and operation between left and right side operand.

context.code === 'PCP1' && context.sequence >=10

  • One or Multiple conditional properties can be defined for any single value or enumerator property within a region

  • The linked conditions are evaluated whenever there is a change in the value of the property

  • Conditions cannot be linked to any multi-value property within a region, however, a condition on a single value property can influence display settings of a multi value property

  • For Tables Conditions can be defined at:

    • Column level

    • Overflow Region Level

    • For example JSON:

{
 "region": {
   "set1": {
    "tiles": [
     {
      "sequence": 1,
      "properties": [
       {
        "name": "subtype",
        "sequence": 1,
        "nonupdatable": true,
        "evaluateConditions": [
         {
          "name": "sigTypeCondition"
         }
        ]
       }]
   }]
  }
 }
}
  • Table Level Condition

{
 "table" : {
     "actions": [
      "add"
     ],
     "row": {
      "actions": [
       "remove"
      ],
      "columns": {
       "properties": [
        {
         "name": "sequence",
         "sequence": 1
        },
        {
         "name": "scheduleDefinition",
         "sequence": 2,
         "refType": {
          "type": "scheduledefinitions",
          "filter": "type.eq('G')"
         },
         "evaluateConditions": [
          {
           "name": "Condition1"
          },
          {
           "name": "Condition2"
          }
         ]
        }
      ]}
    }
  }
}

Conditional Display of Fields

  • Based on the conditions, dependent fields properties are updated, these include

    • Updating Properties for Fields within Region

    • Updating Properties for fields in context of a row within a table. For example:

      • Table Columns

        • Parameter Type

        • Amount

        • Percentage

      • Conditions:

        • If Parameter Type == Amount: Enable Amount Field for that record, Disable Percentage Field

        • If Parameter Type == Percentage: Enable Percentage Field for that record, Disable Amount Field

        • Show or Hide a tab: Use Tab Resource as reference to identify which Tab to show or hide

    • Conditions are applied in the context of page status for example, display a field if the page is in edit or create mode by specifying object state field.

  • Multiple conditions can be defined for the same property within the floor plan. These get evaluated at the run time with immediate effect in the UI

  • In case, of multiple floor plans, conditions are evaluated based on the selected floor plan

  • Conditions evaluates only when the properties with attached conditions changes or when page reloads

  • In case, field display is set to display never or a tab is hidden based on any condition:

    • The hidden values are never part of the Patch request when the updated data is saved if Set to null is not explicitly defined for the property

    • If 'setToNull' property is defined then remove or delete the properties or objects when hidden in the UI that is, when display is set to 'never'