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 the 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.

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 single value properties. They are as follows:

  • Display

  • Conditional always

  • Conditional never

  • Conditional notNull

  • Mandatory

  • Updatable

  • Read Only

  • Reference property

  • LOV to use

  • Filter

  • Default

  • Tab Visibility

  • Set To Null

Conditional display support is restrictive in case of auto included dynamic fields. Condition on the auto included dynamic fields which are not loaded on the page are ignored(i.e. before additional section is expanded).

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

Condition Configuration

Table 1. 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.

evaluateConditions.properties and its attributes

When condition evaluation or switch equals the result, specified property attributes are updated. In case of list, these are properties of the list.

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",
  "resource": "optional - specifies the list resource, applicable only for conditional display of list properties",
   "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.

  • It is possible to access information at the top ( parent/grandparent level) though context object at detail level. This is applicable for the following pages :

    • Person

    • Providers

    • Claims

    • Policies

    • Group Client

    • Group Account

    • Group Account Product For example, to change the behaviours of a field on claims line based on claim form, context.claim.claimForm.code=='formValue' can be used.

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

  • For each property the following values can be evaluated:

Table 2. Other Details

=== 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

||

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

context.code === "PCP1"

  • 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

  • For multi-value property within a region, tab-table, or table (view and edit page) the condition are evaluated at record level and control the settings on the other properties within the same row.

    • Multivalue tab table (sub resources), the initConditions and condition gets specified at the tab level.

{
   "resource":"",
   "floorplan_object_00":{
      "title":{
         "properties":[
            {
               "name":"code",
               "sequence":1
            }
         ]
      },
      "actions":[
         "edit",
         "delete"
      ],
      "region":{
         "set1":{
         }
      },
      "tabs":[
         {
            "sequence":1,
            "tabResource":{
               "listResource":""
            },
            "quickSearch":{

            },
            "initConditions":[
               "some init condition when tab loads"
            ],
            "conditions":[
            ],
            "table":{
               "actions":[
                  "add"
               ],
               "row":{
                  "actions":[
                     "remove"
                  ],
                  "columns":{
                     "properties":[
                        {
                           "name":"some property",
                           "sequence":1,
                           "evaluateConditions":[
                              {
                                 "name":"condition to be evaluated"
                              }
                           ]
                        }
                      "...."
                     ]
                  },
                  "region":{
                     "set1":{

                     },
                     "set2":{
                        "tiles":[
                           {
                              "sequence":1,
                              "properties":[
                                 {
                                    "name":"some property",
                                    "evaluateConditions":[
                                       {
                                          "name":"another condition to be evaluated"
                                       }
                                    ]
                                 ]
                              }
                           ]
                        }
                     }
                  }
               }
            }
         ]
The individual properties of a list within the tab table (region) cannot conditionally controlled.
  • Similarly, for conditionally controlling properties of a list configured in the region (at top level), the condition gets specified at the multivalue property configuration.

 "region": {
    "set1": {
        "tiles": [
            {
				"sequence": 1,
				"properties": [{
					"name": "sub resource list",
					"initConditions": [
						"init condition for the list resource "
					],
					"conditions": [

				    ],
					"properties": [
						{
							"name": "property of the sub resource",
							"sequence": 1,
							"evaluateConditions":[{
                                    "name":"condition to be evaluated"
                            }]
						}
					]
				}]
            }
        ]
	}
}
  • A table level condition "Condition1" on scheduleDefinition is evaluated for each row in the list and can be used to influence the settings of other properties within the same row.

{
 "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"
          }
         ]
        }
      ]}
    }
  }
}

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"