Create list
Value resolver – Abstract
Purpose: Creates a data object of the 'List' (java.util.List) type and returns it – optionally pre-populated with the entries defined via value resolvers.
The Create list value resolver creates a data object of the 'List' (java.util.List) type and returns it.
The list can optionally be assigned values ($null, simple values or data objects) as entries.
The input value is not processed immediately, but is passed on to the value resolvers for list entries as an input value.
►NOTE◄ To create a List object without entries, the Create instance value resolver (with the class 'List'/java.util.List) can also be used.
Configuration
For optional assignment of entries for the generated list, instances can be added to the configuration by clicking on the
icon and Resolvers can be defined in them. Existing entries can be removed by clicking on the
icon.
Without entries (see screenshot above) the value resolver returns an 'empty list' (similar to the Create instance value resolver with the class 'List'/java.util.List).
|
Result (in JSON notation): { "class" : "list" , "data" : [ ] } |
By default, each entry is assigned 'No value' ($null). However, this does create a list entry that contains the value $null:
|
Result (in JSON notation): { "class" : "list" , "data" : [ null ] } |
►NOTE◄ When clicking the
to add the first item, the read-only 'template' for entries (with gray border) is replaced by an active entry (with blue border) in the configuration user interface.
Examples
Assignment to an object property that expects a list
The 'Companies' assigned to a certain user account (for the selection of the Company of session at login) are assigned automatically via event handling. The list should refer to exactly two company accounts statically predefined in the configuration.
Configuration:
The user account in question is defined as a reference object in the configuration on the right by an Execute with event action (not shown in the image). The assignment is done by a Set value event action:
|
|
Provide statically defined values for an In list comparison
An association criterion is intended to assess whether the 'Zip code' (zipcode) address property locates the Company of session in one of several 'hand-picked' regions in a given country.
Configuration:
Within a With rule (not shown completely in the image), the reference object is the company address in the 'address' (address) property of the company account returned by the Company of session value resolver. In the context of this address, two AND-linked instances of the Entity property rule are configured:
►NOTE◄ Instead of the Create list value resolver (right), the list could also be defined quite conveniently as static text in JSON notation (see below) and passed to a JSON to object value resolver via concatenation: [ "80" , "86" , "90" ] |
|
Provide list values for one iteration per For each loop
Using a For each loop, automatic information should be notified to stakeholders from the context of an entity as soon as it is deleted.
Specifically, the following stakeholders should be informed about the deletion of the entity:
The creator of the entity, i.e. the user referenced in the 'Creator' (creatorId) property.
If different from the creator: The user who last changed the entity according to the 'Last modified by' (lastModifierId) property.
The owner of the entity, i.e. the company referenced in the 'Owner' (ownerId) property.
It is assumed that the address (address) of the relevant accounts (Users/Company accounts) contains an e-mail address for notification.
Configuration:
Within an event handling that reacts to the event 'Delete' (see Common action event), the action part is configured as follows:
|
|
►NOTE◄ The Original entity value resolver is important because the user responsible for deleting the entity is already referenced by lastModifierId in the context of the 'Delete' event. However, the user who last sent to the server via 'Save' for the entity is informed.