Exclusive Gateway with numbers instead of boolean

Hello there,

I get following Error:

The process could not be started. : Cannot instantiate process definition Process_1p7yu57:2:0880db2b-d0bd-11ea-a57d-34f39aa06df0: condition expression returns non-Boolean: result has class java.lang.Long and not java.lang.Boolean

My setup is like:

Im trying a Spring Boot Application to execute following BPMN Process:

diagram_3.bpmn (5.2 KB)

This is my ReadRFIDDelegate class. I want to demo a process. I want to set a variable as int “Auftragsnummer” and then in the next following Exclusive Gateway check this number, and if its 4711 I want to go the upper way, else the other way.

package com.example.workflow;

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;

public class ReadRFIDDelegate implements JavaDelegate {

    @Override
    public void execute(DelegateExecution delegateExecution) throws Exception {
        delegateExecution.setVariable("Auftragsnummer",4711);
        System.out.println("Read RFID chip");
    }
}

Im setting this in Modeler for the path to upper task:
Condition Type: Expression
Expression: #{4711}

Is it possbile to set Expression types for Integers/numbers ? How can I do that in Modeller and in Code. What I have to do ?

Hi there @andii04

Can you take a look at the style guide before posting a question. I would suggest things like upload the model your talking about and information on how to format the post.

HI Niall, I updated my Question, I hope now it works better

Thanks a lot @andii04

I see your problem - the expression on the gateway needs to return a boolean so that it can decided which route to take. so our expression should probably ready something like this:

#{Auftragsnummer == '4711'}

1 Like

This solved my problem. Thanks a lot

1 Like