Condition

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

For example, in the integration gateway application’s configuration page, the user can control the display of fields based on the agent configuration type. That is, in folder configuration or out folder configuration. In Policies application, group and policy parameter value fields can be enabled or disabled based on the selected parameter type. That is amount, currency, or number of units.

Other use cases include:

  • Dynamic logic page: Filters for LOVs (line of vertical) 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:

  • 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 restricted in the case of auto-included dynamic fields. Condition on the auto-included dynamic fields that are not loaded on the page is ignored (before an 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

The condition’s name is also specified as the conditional to evaluate the triggering property.

type

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

objectState

Indicates if the condition applies only when an object is in create or edit mode When not specified, it means the 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 the case of a 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, configure a standard condition on the dynamic logic page.

{
  "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, configure 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. For example, when a policy is created, the policyGroupAccountList and policyholderList must never be displayed at the tab level.

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

Other Details

  • Conditions are evaluated at page load based on the init block (see above), and whenever the linked property is changed, that is, it acts as a trigger condition. Trigger conditions are evaluated when the value of any property is changed, and then the condition gets fired. For example, on the dynamic logic page, change the filter on the signature depending on the subtype.

  • 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 or grandparent level) through context objects at the detail level. This is applicable to the following pages:

    • Person

    • Providers

    • Claims

    • Policies

    • Group client

    • Group account

    • Group account product for example, to change the behaviors of a field on the claims line based on the claim form, context.claim.claimForm.code=='formValue' can be used.

  • In case of multiple values evaluations, the operators AND or OR can be specified.

  • For each property, the following values can be evaluated:

Table 2. Other Details

=== or ==

The equal comparison operator checks if the left operand is equal to the right operand.

context.subtype=== "FUNC"

!== or !=

The not-equal comparison operator checks if the left operand is not equal to the right operand.

context.subtype!== "FUNC"

>=

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

context.sequence >= 10

>

The greater than operator checks if the left side operand is greater than the left side.

context.sequence > 10

The less than equal to operator checks if the left side operand is less than equal to the left side.

context.sequence ⇐ 10

<

The less than operator, checks if the left side operand is less than the left side.

context.sequence < 10

&&

The And operator performs logical and operation between the left and right side operand.

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

||

The Or operator performs logical or operation between the 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 multivalue properties within a region, tab-table, or table (view and edit page), the condition is evaluated at a record level and controls the settings on the other properties within the same row. The condition gets specified at the multivalue property level (tab or region).

    • Multivalue tab table (sub-resources), the initConditions and condition get 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 the 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 field properties are updated; these include:

    • Updating properties for fields within the region.

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

      • Table Columns

        • Parameter Type

        • Amount

        • Percentage

      • Conditions:

        • If Parameter Type == Amount: Enable the Amount field for that record and disable the Percentage field.

        • If Parameter Type == Percentage: Enable the Percentage field for that record and disable the 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 the 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 the case of multiple floor plans, conditions are evaluated based on the selected floor plan.

  • Conditions are evaluated only when the properties with attached conditions change or when the 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 setToNull 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 the display is set to never.