Add Item to Collection
Description
This is a function that allows a particular value or data object to be added to a collection. It is specified in a process node. The editor is located in the dropdown menu for the "collections" item in the top bar menu of the process node editor.
Use
The function is used to create the value in a specified or next available position within a collection.
Tips and Tricks
This part can be used to generate a list of items (e.g. recommendations) based off user inputs. Using the LogicNets Assessment framework, create a report net with rules that check for user inputs, and when true, use add to collection part to add a recommendation (text) to the collection (e.g. called list_of_recommendations). Multiple rules and recommendations can be placed in the net, such that the logicnet model will create the custom list of recommendations based on what rules were true.
Watchout: given that the LogicNets Assessment framework cycles through all nets on each user click, you will need to initialize the collection at the top of the report net to insure it starts out as empty. Use the Delete data object process step for this. Without this step recommendations under the true leg of each rule will get added on each click and you'll see that in the output as duplicated values.
Editor Fields
Field Name | Description/Use | Type/Options | Optional/Mandatory |
Data Object | This is the data object the system will insert into a collection. Specify a pre-existing data object to be stored within a target collection. You can include the compound form of the data object using the convention [Group Name].[Object Name], in which case the following Group field can be left blank. Instead of typing the data object name, click the ellipses button to the right and then select a data object from the data model the system displays. | Text | Mandatory |
By reference | When this is checked the system will insert the reference to the data object instead of a copy of the data-object. | Checkbox | Optional |
Group | This is the group containing the data object to be inserted into a collection. Specify the group containing the data object you specified in the first parameter. This field is left blank if either there is no group to which the data object specified in the field above belongs OR if the group name has been specified in the field above as part of a compound data-object name. | Text | Optional |
Collection | This is the collection into which the system will insert a data object from the first parameter. Specify a pre-existing collection into which the data object from parameter one will be inserted. The collection name can be chosen from the data model by pushing the ellipses button to the right. |
Text | Mandatory |
Position | This is the position in the collection into which the system will insert the data object. This can be left empty and the value will be inserted in the next available position by default. Alternatively, specify the numeric position within the collection into which the data object will be stored. This field can be left blank if the user has specified the position in the previous parameter using the $(collection_name)[position#] compound naming convention. |
Number | Optional |
Example
Download and import this example project in your workspace.