In Alloy Workflows, the inputs and outputs of actions are item IDs. Depending on the setting of the Single Instance switch, a next node may execute once, or as many times as the number of outputs of the previous node. Sometimes, however, we need more flexibility than that.
Consider the following example:
- A Query action retrieves two asset items.
- A WFC on the Query nodes generates 3 dates of future inspections on those assets. The inspection dates are not Alloy items under any design, they are just held in a variable of the WFC.
- A Create action follows that produces 6 inspections, 3 for each asset based on those dates.
In this example, we need the output to be 2 (assets) x 3 (dates) = 6. So we need the next node that follows (i.e., the Create node) to execute 6 times.
Is such a multiplicative output possible?
Additional observation: The Output action does not seem to help, as the output items need to be item IDs too (so, for example, they cannot be dates or numbers in a List). If the Output node allowed to output not just Alloy items, but also other primitives, such as a list of numbers, or dates, the above scenario would seem possible.