Search code examples
camunda

Delegate Expression Called Twice


I’ve got a really simple workflow that has a User Task and Service Task. Once I make a REST call to complete the User Task, the Service Task executes twice. Any ideas why the Service Task is executed twice?

enter image description here


Solution

  • The contract is that a Delegate expression returns a Delegate on which Camunda will call the execute method with the execution as parameter. You can simply provide the name of your bean, without adding .execute(execution) in the expression.

    If you want to control by yourself which method should be called with which paramters, then you can switch the implementation to 'Expression'. In this case Camunda will not assume that the expression result implements the JavaDelegate interface and won't automatically try to call an execute(DelegateExecution) method.