AnsweredAssumed Answered

User Task form expression behavior and evaluation in Parallel Multi-instance Sub Process

Question asked by ohallos on Mar 1, 2019

 

I'm using the community edition, version 6.0.0. I am using the activiti-app and the form builder included with it. I don't understand how user tasks and expressions behave within a multi-instance (parallel) sub process. I made a simple process to show where my confusion is.

 

Here is a description of my process: There is a multi-instance sub process which is set to be parallel with a cardinality of 2. Within this sub process there is a single user task assigned to the initiator named “Form Behavior for loop# ${loopCounter}”. In this user task there is a form with two expressions: “Expression behavior using '$' expression construct: loopCounter=${loopCounter}” and “Expression behavior using '#' expression construct: loopCounter=#{loopCounter}”.

 

This is what I expect should happen/ what I want to happen when the process is started. One user task  (I’ll call it userTask0) is created named “Form Behavior for loop# 0” and another user task (userTask1) is created named “Form Behavior for loop# 1”. In userTask0, the expressions in the form evaluate to “0”, and in userTask1 the expressions evaluate to “1”.

 

Here is what actually happens: One user task  (userTask0) is created named “Form Behavior for loop# 0” and another user task (userTask1) is created named “Form Behavior for loop# 1”. All the expressions used in the form evaluate to “1” in both user tasks.

 

It seems that the user tasks themselves are being created in a way I expect since the names which rely on the loopCounter are different, but I don't understand why the expressions in the form aren’t evaluated the same as the task names. Is there a difference between the # and $ notation for expressions? Is there a way I can structure the BPMN to give me the outcome I expect as described above. Even if this is trivial to do, please mention it since I am not very knowledgeable of BPM or Activiti. Thanks

Outcomes