This activity can be used in both Microflows and Nanoflows.
The List operation activity can perform various actions on a list. The result of the action is returned as a new list in contrast to the Change list activity.
The actions which can be performed are:
See below for details on these actions.
An example of list operation properties is represented in the image below:
There are two sets of properties for this activity, those in the dialog box on the left, and those in the properties pane on the right.
The list operation properties pane consists of the following sections:
3 Action Section
The Action section of the properties pane shows the action associated with this activity.
You can open a dialog box to configure this action by clicking the ellipsis (…) next to the action.
You can also open the dialog box by double-clicking the activity in the microflow or right-clicking the activity and selecting Properties.
A list operation action can execute any of the following operations. The operations are categorized by the type of operands they have:
- Binary – operations which work with a second list or object
- Member Inspections – operations which work with specified elements (attributes and associations) of the objects in the list
- Unary – operations which work on the list with no other operands
These binary operations have as an input a list and either another list or an object. THey return another list or a Boolean, depending on the operation. All lists and objects must relate to the same entity.
|Union||The result is a combination of the elements of both parameters avoiding duplicates.||List|
|Intersect||The result is a list containing elements that appear in both parameters.||List|
|Subtract||The result is the first parameter with the element(s) of the second parameter removed.||List|
|Contains||Checks whether all elements of the second parameter are present in the first parameter.||Boolean|
|Equals||Checks whether the lists contain the same elements.||Boolean|
3.1.2 Member Inspections
These operations takes a list and one or more members (attributes or associations) as input. They return either an object or another list, depending on the operation.
|Sort||Allows you to sort a list based on a number of a attributes. The attributes are ordered to determine their priority while sorting. You cannot use associations to sort a list. Sorting attributes from generalized entities is not allowed.||List|
|Find||Find the first object of which the member has the given value.||Object|
|Filter||Find all objects of which the member has the given value.||List|
These unary operations have a list as the single operand and return either an object or another list, depending on the operation.
|Head||The result is the first element of the list, or empty if the parameter contains zero elements or was initialized as empty.||Object|
|Tail||The result is a list containing all elements of the parameter except the first, or an empty list if the parameter contains zero elements or was initialized as empty.||List|
3.2 List Name, Object Name, or Variable Name
This is the name of the resulting List, Object, or Boolean variable. The result can be used by all activities that follow this activity.
4 Common Section
For more information on properties in this section, see Common Properties.