Pass in Camunda execution environment to Java Delegate Expression?

796 views Asked by At

I am trying to use a Java Delegate Expression (Similar to TaskListener's Expression where you can pass a TaskDelegate to the expression context). In a nutshell - am trying to accomplish what taskListener allows to pass in a TaskDelegate using the expression ${myDelegate.doSomething(task)} which works fine for TaskListener!

However Im trying to do the same using the Delegate's expression. I understand we can do this which works ${myDelegate.doSomething()} (without any Runtime Engine's params) but I need the Runtime from which we can get the ProcessRuntimeExecution etc! I don't want to use the Java Delegate's execute method since I am reusing this Delegate for a User Task's TaskListener methods.

${myDelegate.doSomething(WHAT DO I PASS HERE TO GET Camunda Runtime?)}

public class MyDelegate implements JavaDelegate {
    public void doSomething( CAMUNDA RUNTIME? ) {
        // Get the ProcessEngine etc
    }
}
1

There are 1 answers

0
Jan Galinski On

You are looking for the DelegateExcecution.