Conditional event subprocess (non - interrupt)

Hello, I have the problem of several tokens being instantiated when the subprocess is started. in the “teste bpmn” was one of the attempts to model using two variables, but I don’t know if this is correct. As for the “teste bpmn 2”, two tokens are instantiated, I don’t understand why. I’ve tried in the event variable to use only the create or the update, but it still instantiates two instances or more.

note: I saw other topics talking about the same problem, but none came to fully resolve.
note: I also tried to set the variable using a delegate, and I wasn’t successful.
note: in the call activity there is no change in the variables used to start the subprocess, I just left it as an example.

Version camunda modeler: 3.7.3

teste bpmn 2.bpmn (5.7 KB)
teste bpmn.bpmn (7.6 KB)

Hi @Joao_Victor,

This behaviour is due to “Triggering on Scope Instantiation” so if the process gets started, event condition gets evaluated twice on scope instantiation and on create event.
The solution is to specify only “update” event for “Variable Events” so if the process gets started, event condition gets evaluated on scope instantiation only.

image

I just did a test only with the update and even so two tokens were created.

an image of the tokens that were created in the subprocess

Hi @Joao_Victor,

May I know please how you set the variables… I assumed that you start the process with variables supplied.

Hi @Joao_Victor,

Okay… when I opened the attached models I got the below warning

so please replace camunda:variableEvent with camunda:variableEvents and specify only “update” as a value

1 Like

hello, when I changed it to “camunda:variableEvents” it worked and created only one token, however I got a warning, for having made this change.

image

Hi @Joao_Victor,

I would suggest trying to edit it using visual property panel as illustrated in previously shared snip.

as you can see in the image, so there is the variable event, I have to make a direct change to the xml, I don’t know if it’s a version of the camunda I’m using that may be causing this but since it’s already resolved, it won’t be preventing this Warning. Thank you very much.

image