Execute with
Event action – Abstract
Purpose: Executes event actions with an alternative reference object (entity).
The event action Execute with enables the temporary change of the reference object within an event handling in order to execute a block of event actions with an alternative reference object.
Parameter
Save Object in variable
The Save Object in variable parameter can optionally be used to specify the name of a variable that can be used to access the previous reference object while the alternative reference object applies.
►NOTE◄
Assigning the previous reference object as the value of the variable named in the Save Object to variable parameter only affects the execution context within the Execute with block. After completion of the block, this variable is assigned the previously valid value again (possibly 'no value').
In general, however, assignments to variables are valid inside and outside the block. Another exception, however, is the variable managed by the system entity which always refers to the respectively valid reference object.
The label of the parameter reflects the type of the previous reference object. If a more specific entity type than 'object' results from the context of the configuration, its name appears before '... save in variable' and at the interface to the event actions.
Object resolver
The Object resolver defines the alternative reference object valid within the Execute with block for the execution of the event actions contained therein. After their completion, the previously valid reference object applies again.
In relation to the event actions executed within the Execute with block, the 'reference object' has the following significance:
If other events are triggered within the Execute with block, they receive the alternative reference object as 'Input value'.
Value resolvers that refer to an inbound object process the alternative reference object, unless otherwise specified. Thus, an Object property value resolver resolves a specific field of the alternative reference object if it is not used within a concatenation.
►NOTE◄ The Execute with event action can be used in cascade to override the alternative reference object in steps. In each level of a cascade, there is access to the reference objects of the parent levels, provided that different variable names are used in the Save object in variable parameter in each case.
Event actions
In the block below the parameters, event actions can be added via the
symbol, which are executed at runtime with the alternative reference object.
Examples
Trigger notification to the owner of a business object
As soon as a business object of the 'Order' type (see Orders) is assigned the 'Released' working state, the company that is considered to be the owner of the order should receive an advice note.
The form of the notification should depend on the settings in the company account of the owner company. Details should control an event handling that reacts to a Custom action event ('Send advice') and expects the following data context:
As input value (entity) the company account of the company is to be passed, which – in the form defined in the company account – is to be notified.
A variable with the name order should contain the data of the order for which an advice note is to be sent.
The following configuration only shows how the notification is triggered using the Execute with event action. Notification details are omitted here.
►NOTE◄ An event handler that reacts to the 'Send advice ...' event also receives, together with the input value (company account), access to the variable order with the details of the order, which can therefore be used as the content of a message or also in connection with a Print document. |
|
Value assignments for multiple fields of the same object
Detailed data for a new flight are requested via a modal portal (see the following screenshot), which requires the IATA code and the ICAO code as required information:
|
Clicking the Create button triggers a Custom action event, in the data context of which the form data shown below is passed as the value of the formData variable: Form data (formData)
{ "codes" : { "IATA" : "BER" , "ICAO" : "EDDB" } } |
For further processing, the following structure is to be created from the input in the form:
{
"iataCode"
:
"BER"
,
"icaoCode"
:
"EDDB"
}
Configuration:
The transformation of the given form data into the target structure should be done within the event handling that reacts to the event triggered by the Create button in the portal.
Several fields must be transferred from the source structure in the variable formData into the fields of a target structure, which is to be newly created for this purpose in advance and stored in the variable newAirportObject. The entire process can be implemented in an Execute with action as shown on the right:
►NOTE◄ The parameter Save Object in variable (at the top) is not used here, because the portal does not provide an independent reference object anyway, but only the form data in the variable formData. |
|
Cascading use of "Execute with"
The cascading use of the Execute with event action is demonstrated here with a simple example. In practice, the 'nested' use of the event action often results in much more complex structures.
Based on the previous example, here is how an event handling could look like, which triggers the notification of a company, if a Custom action event of the type 'Send advice' is triggered.
The following configuration assumes that this event gets a company account as 'input value' and the data object of an order in the variable order as described above.
►REMARKS◄ Provisions for the possibility that no communication information with the context 'ADVICE' is found at all would be additionally recommended. The Execute with block is executed in this case with the value 'no value' (null) anyway. |
|