Skip to main content
October 12, 2021
Question

iterate records in a process model

  • October 12, 2021
  • 4 replies
  • 0 views

Hi All,

I have a process model accepting list of values below. 

[value1: "testA", value2: "testA", executeFlag: true], [value1: "testB", value2: "testC", executeFlag: false], [value1: "testA", value2: "testB", executeFlag: true]

I want my process model to iterate over the list and see if executeFlag is true route to Flow A else route to Flow B. 

can this be achieved ?

Thanks in advance for your time and support [emoticon:c4563cd7d5574777a71c318021cbbcc8]

4 replies

stewart.burchell
October 12, 2021

Your best bet is to pass this list to an Expression Rule that separates the items into two lists - those that have 'executeFlag' set to true, and those that don't. You can then use those lists to start the relevant process models as sub-processes, perhaps using the MNI option (depending on how many you're dealing with), or an old-fashioned explicit sequential loop.

October 12, 2021

Hi Stewart,

thank you and appreciate your time and response.

example list provided in the ask is just an example.

However, I have a complex structure where I need to iterate within process model, apply a condition, filter out results and then iterate to "write to data store entity "  
I hope my statement is clear. 

stewart.burchell
October 12, 2021

Unless you can persuade me otherwise I think you can do all you're asking for in a set of Expression Rules. This is by far the easiest way to develop, test and then integrate into a much simpler process model.

andrewh0007
October 13, 2021

I'd approach this like Stewart said.

  1. Get list that meet condition(s)
  2. Iterate on this list

I don't see how complexity interferes with this. In fact, complexity makes expression rules more attractive (to me).

What extra details can you give for us to help more and/or better understand why expression rules and sub-lists wouldn't be a good option.