Create Lists

A list notation is a vertical list of elements, where each element is an independent logical notation. The output of a list notation contains outputs of all its elements. You can also invoke the output of a particular list element from another decision.

To create a decision with the list notation:
  1. Add a new decision element to the model.
    1. In graph view, click Expand Expand/Collapse icon next to Decision on the diagram palette. Select List and drag it onto the canvas. Double-click the element to edit its logic. You can also edit the list's logic from the properties pane; select the element, then select Open Properties Open Properties icon, and in the properties pane click Edit Edit icon next to the Name field.
      Click Close Close icon to return to the canvas.
    2. In list view, click Add new decision Add New Decision icon in the Decisions bar and select List from the Create Decision window.
    An empty list is created.
  2. Click Add Add icon to create a new list entry. An entry is created with the expression notation selected by default.
  3. To change the logical notation for an entry, click Edit Edit icon for the particular entry. Select a different notation from the available options.
  4. In the entry field, configure the logic for the selected notation. You can use input variables or built-in functions to define the logic.
  5. Repeat steps 2 to 4 to add another entry into the list.
  6. Click Save to save and validate changes manually. Changes you make within the decision model are also automatically saved and validated from time to time. Errors, if any, are displayed within the decision.
    To delete a list entry, click Edit for the particular entry and select Delete.

The following example is a list of simple expressions containing prime numbers that are less than 10:

Description of dmn-list.png follows
Description of the illustration dmn-list.png

In a list of n elements, use List_name[n] to invoke the nth element from the beginning of the list, and use List_name[-n] to invoke the nth element from the end of the list. In this example, to invoke the list entry of 2, you can either use Prime Numbers[1] or Prime Numbers[-4].

You can also use suitable built-in list functions on a decision containing a List notation. For example, the following Expression decision returns the sum of all items in the Prime Numbers decision.

Description of dmn_listcall-png.png follows
Description of the illustration dmn_listcall-png.png

Note:

  • If you add a function as one of the list entries, then the list notation as a whole doesn’t return a result. However, you will still be able to invoke results of other list entries throughout the decision model.

  • According to the FEEL syntax, you can also define horizontal lists in expression fields across all notations. For example, a list of all prime numbers less than 10 can be defined as [2,3,5,7].