Condition

This component allows for custom conditions within a floorplan 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 agent configuration page one can control display of fields based on the Agent Configuration Type i.e. In folder Configuration or Out Folder configuration, in oracle health insurance enterprise policy administration, group and policy parameter values can be enable or disable fields based on the selected Parameter Type i.e. 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

The conditions can be defined to steer the following behaviors of the properties:

  • Display

  • Conditional always

  • Conditionalnever

  • ConditionalnotNull* Mandatory

  • Updatable

  • Read Only

  • Reference property

  • LOV to use

  • Filter* Default

  • applicable for single value properties and enum’s* Tab Visibility

  • Set To Null

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

Conditions can be made object state aware, that is different behaviors depending on whether an object is being created vs 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/switch equals the result, specified property attributes are updated.

init

Specifies the list of conditions that must be evaluated when the page is (re)loaded. Note that the object state is take 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"
         }
        ]
       }
      ]
     }
   ]
  }
 ]
}

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

Example : Configuring a switch case condition on the dynamic logic page to change the filter on signature deepening 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 (re)loaded 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 changes i.e. it acts as a trigger condition

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

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

  • 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

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 their 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 defied at:

  • Column level

  • Overflow Region Level

    • 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 the depended fields properties are updated, these include

    • Updating Properties for Fields within Region

    • Updating Properties for fields in context of a row within a table. 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/hide

    • Conditions are applied in the context of page status e.g. 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 floorplan. These gets evaluated at the run time with immediate effect in the UI

      • In case, of multiple floorplans, conditions will be evaluated based on the selected floorplan

      • Conditions evaluates only when the properties with attached conditions chnages or when page gets reloaded

      • 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/delete the properties/objects when hidden in the UI i.e. when display is set to 'never'