Pass list of users through pipeline to calculate a roster

I would like to calculate a list of users and then like to pass this list to other blocks within the pipeline to make further decisions on which notification profile to use with the roster.

I’ve got a fairly complicated script to calculate a roster inside of a notification block. I’d want to move the calculation of the user list (but not the assembly of the roster with contact info) out of the notification block so I can trigger either an SMS profile, Email profile, or both. The user list will be the same for both, the only different condition will be “SMS enable” and “email enable” bits that are tag properties. Because of the complexity of the script, I do not want to copy and paste the same scripting (with the exception of the SMS or Email enable conditions) to both notification blocks. I want to generate the list of users once, then use expression blocks to decide whether or not to route to the 2 notification blocks. Each notification block would take as an input the list of users and grab the contact info for each user to generate the roster using the builder object and perform the notification.

The part I’m unsure of is passing the list of users from a script block to another part of the pipeline.Thanks!

I don’t have ignition on this computer so I can’t test things out, but you should be able to add a property to the alarm event and use this to store the user list, so that you can access it in another block.

There might be better ways, but this one is simple enough.

Thanks, this worked. I was initially thinking I couldn’t do this because the list is only relevant to that alarm event and I thought writing it would change it at the tag level, but writing to an alarm associated data property in the pipeline does only effect that alarm event.

# Script block 
# My scripting for generating the user list
# userList = ........
event['MyAssocatedDataProp"] = userList

And then some expression nodes to deciced whether to call the 2 notification blocks, in each notification block:

# Notification block
userList = event['MyAssociatedDataProp']

# Get contact info from gateway, use builder to build calculated roster, etc