How to properly model an exclusive gateway


I’m trying to figure out how an exclusive gateway can use an expression that checks a variable from a previous task.

In my understanding, I have to set
execution.setVariable("is_OK", true);

in my JavaDelegate CheckStuff, but this doesn’t work.
What am I missing?
I also tried with input- and output parameters, but this didn’t work either.


diagram.bpmn (6.7 KB)

Hi Matthias,

I think you process can’t even be deployed since your service task has no implementation or type.

As first you have to define the implementation type, in your case a Java class.
So adjust your service task. Add an implementation and point to your JavaDelegate. You need to specify the package name and class name in the Java Class field. This should look in the xml similar to this: camunda:class="package.CheckStuff"

After that you need to remove the specified input/output mapping. You have no need to use the mapping, if you set the variable directly in the Java delegate. Your mapping overwrites the current is_OK variable with the null value. See the documentation for a more deeper explanation
Process Variables |
There you can also find the example and explanation, which says if you define no value the value will be null.

The content of an input/outputParameter specifies the value that is mapped to the corresponding variable. It can be a simple constant string or an expression. An empty body sets the variable to the value null.

  <camunda:inputParameter name="willBeNull"/>

Hope it helps.


1 Like

Hi Chris,

thank’s a lot for your quick response.
I did not completely model the CheckStuff part in my process, I only wanted to illustrate the problem, as the real process is more complex.

Nevertheless, you were right. After removing the input/output mapping, it worked as expected.
So this looks like a typical RTFM case, right ? :wink:


1 Like

Hi Matthias,

yeah we could summarize it like this :smiley:
But no worries, I also had to read the documentation.