Binding Module

Create binding context

Description:
Create a new binding context object and provide its associated bId (binding context ID). The generated bId is then assigned to the process’s parameters as process.parameters.bId = bId. This enables the establishment of a custom binding context for the process, allowing for the use of binding expressions derived from this newly created context. Ensure that you dispose of it when you are done using “free_context“.

{
    "type": "binding",
    "action": "create_context",
    "args": {
        "context_id": "my_context"
     }
}

In the mentioned example, a context_id is supplied to inform the binding engine of the name for this context. However, you can omit this if your process object already has an ‘id’ property defined. If unsure, it’s advisable to provide a context_id.

Free binding context

Description:
Delete the binding context corresponding the current process. Ensure to remove only those binding contexts that were established using “create_context“.

{
   "type": "binding",
   "action": "free_context"
}

Get binding context property

Description:
If a bId exists in the process parameters, retrieve the value of a specific property from the binding context associated with that bId.

{
    "type": "binding",
    "action": "get_property",
    "args": {
       "property": "firstName",
       "target": "$data.firstName"
    }
 }

Set binding context property

Description:
If a bId exists in the process parameters, set the value of a specific property on the binding context.

{
    "type": "binding",
    "action": "set_property",
    "args": {
        "property": "firstName",
        "value": "John"
    }
}

Get binding context data object

Description:
Should a bId be present in the process parameters, fetch the complete binding context data object, which contains all stored values, and save it to a specified target for convenient retrieval.

{
    "type": "binding",
    "action": "get_data",
    "args": {
        "target": "my_data"
    }
}

Set global context property

Description:
Set a property with a specified value on the global binding context.

{
    "type": "binding",
    "action": "set_global",
    "args": {
        "property": "isMenuOpen",
        "value": true
    }
}

Set multiple global context properties

Description:
Set multiple properties with specified values on the global binding context.

{
    "type": "binding",
    "action": "set_globals",
    "args": {
        "values": {
            "isMenuOpen": true,
            "status": "idle"
        }
    }
}

Get global binding context value

Description:
Retrieve the value of a property from the global binding context. This is typically performed to gain access to the value in the subsequent step of the process for further processing and action.

{
    "type": "binding",
    "action": "get_global",
    "args": {
        "property": "isMenuOpen",
        "target": "$data.isMenuOpen"
    }
}

Get multiple binding context values

Description:
Access several property values from the global binding context. These properties are specified in an array consisting of strings that denote the names of the global context properties. The outcome is an array where each index, corresponding to a property name, is replaced with the property’s value. This array is then stored in a designated target for subsequent utilization.

{
    "type": "binding",
    "action": "get_globals",
    "args": {
        "values": ["isMenuOpen", "status"],
        "target": "$data.uiState"
    }
}