Inside a multi-instance subprocess NOT sequential, we must check a condition with the value of a variable that has to be different for each subprocess's instance launched. The condition should be a JUEL expression of this kind: ${foundFile_${loopCounter}

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
kodiak
Member II

Inside a multi-instance subprocess NOT sequential, we must check a condition with the value of a variable that has to be different for each subprocess's instance launched. The condition should be a JUEL expression of this kind: ${foundFile_${loopCounter}

Seeking any valid syntax building that it is admitted by Activiti.

2 Replies
thuynh
Established Member II

Re: Inside a multi-instance subprocess NOT sequential, we must check a condition with the value of a variable that has to be different for each subprocess's instance launched. The condition should be a JUEL expression of this kind: ${foundFile_${loopCoun

Hi  ,

Could you please elaborate more on your question?

Do you have a unit test to share? 

Thanks,

Thong Huynh

kodiak
Member II

Re: Inside a multi-instance subprocess NOT sequential, we must check a condition with the value of a variable that has to be different for each subprocess's instance launched. The condition should be a JUEL expression of this kind: ${foundFile_${loopCoun

Sorry, it is my first time here in this forum, and I was wrong introducing inside title the full question text, resulting in final part of it truncated.

No unit test yet.

So proceed to trying to explain it again:

We have multi-instance whole subprocess and would like to be NOT sequential, becuase of trying to download several files from a repository in parallel way (most efficient). For logic purposes, we must check a condition based on found or not each one of these files in that repository. So, the boolean variable inner name 'foundFile' has to of different name inside each of the instance deployed (as it is parallel, other way Activiti would not know what of the 'n-sime' foundFile value has to take in consideration). The way we have found to make this is to add a suffix to that variable name with '_${loopCounter}' value, index established as unique for each instance.

The problem is that evaluate this condition:

${foundFile_${loopCounter} == true}

is not valid according to EL v2.2 expressions specification (nesting $ references), which is the one that manages our Activiti 5.19.0 versión.

Any ideas to make a condition based expression that be valid and follows the rule of make different variable names for each instance?

Thank you again.