How does a variable take a value before the XOR gateway evaluation?

Hi to all.

In the following BPMN diagram, there is a XOR gateway which evaluates the value of a variable named “newProductNeeded”.

Based on here Data-based Exclusive Gateway (XOR) | docs.camunda.org,
I’ve defined the expression for the 2 outgoing sequence flows as “true” in the one case and “false” in the other one.

I suppose that I must write an expression or script in the incoming sequence flow of XOR gateway but I don’t find the way in Docs.

Does anyone know sth on this please?

Thanks in advance,
Steve

Hi Steve,

This is where process variables are useful. Conditions like this typically refer to process variables. This reference [1] on process variables may be of interest.

The expression notation is a shorthand way of accessing these process variables. Hence if you had a process variable called CART_ITEM_COUNT, a conditional expression could be ${CART_ITEM_COUNT > 0}

regards

Rob

[1] https://docs.camunda.org/manual/7.9/user-guide/process-engine/variables/