Conditional Event and Variable Change Event

Hi,

I modeled a Conditional Boundary Event in my process which as a simple condition

${myVar== ‘Val1’}

As Variable Event I specified ‘update’ so that the event is only triggered if myVar is updated and its value is ‘Val1’.

The problem is that myVar is updated before activity with Conditional Boundary Event is reached.
I thought that Variable Event ‘update’ is only evaluated to true if Conditional Boundary Event is active but when process instance reaches specific activity with Conditional Boundary Event it is directly evaluated.

Do I misunderstand behavior of conditional event?

Best regards,

Markus

I added a simple png which shows how it is modeled.

Hi @Markus,

have a look at our documentation

https://docs.camunda.org/manual/7.8/reference/bpmn20/events/conditional-events/#triggering-on-scope-instantiation

In short words: If the condition is true when the process execution reaches something with a conditional event, it is taken immediately. So the behaviour that you describe is expected.

I would try to model your use case in a different way, but I cannot give advice without knowing your use case :wink:

If you really want to mimic the behaviour that you expected, you could hack it by setting myVar to something different than ‘val1’ in a start listener of “Wait for something other”. But again, I guess there is a more elegant way to solve your problem…

Regards,
Ragnar

1 Like

Hu @Ragnar,

Ok i misunderstood the documentation at this point.
Thanks for your input, I will try to review my model and maybe remodel it.

Best regards,

Markus