I have a multi-instance sub-process that iterates over an ArrayList of names (eg Joe, Dave) as the "MI Collection input" that correctly uses the iterator to extract an email address from a parallel ArrayList of email addresses (eg JoeE...@email.com, Dave...@email.com) in a script task.
I want to send an email using the Email plugin to the email address extracted (ie to JoeE...@email.com for Joe in the first instance of the sub-process).
However, despite assigning either the "MI Data Output" of the multi-instance sub-process or to a "Process Variable" of the multi-instance sub-process the variable is null after it leaves the script task where it was assigned (and so null at the Email work item).
Where do I define the variable such that it can be used as the email address (ie it exists for the lifetime of the multi-instance sub-process)?
I am trying to do this entirely within JBPM, as I have many other components in Java and this seems like a JBPM-scope issue. I have attached JPGs of the two ways I have tried to define the email address and the trivial process.