Pass BusinessKey in expression


#1

How do I access the Business Key in an expression?
I have a method in a Spring service, flowableBpmPlugin;
public void sendEmail(String reference)
{
System.out.println("sendEmail reference= "+reference);
}

I would like to pass in the business key from a service task. I have tried;

${flowableBpmPlugin.sendEmail(execution.businessKey)}

which passes null

In order to get this to work I have had to add a new method that accepts the execution.
public void sendEmail(DelegateExecution e)
{
String reference = e.getProcessInstanceBusinessKey();
System.out.println("sendEmail reference= "+reference);
}
and change the expression to

${flowableBpmPlugin.sendEmail(execution)}

What do I need to do to pass the process instance business key as a String?