I’m trying to use the Process Instance name as a variable, to show it in the body of a MailTask.
However, I’m having difficulties doing so. I can’t seem to find it mapped to any variable.
I dug around the code for a bit, and it seems that in VariableContainerELResolver the only variables that are mapped are the ones set during process execution and the “initiator”, which leads me to believe maybe this isn’t mapped.
As a workaround, I tried using a Script Task to set the Process Instance’s name using the following Script:
String title = execution.getName();
execution.setVariable("title", title);
This sets the variable title, but maps it to null. I assume getProcessInstanceName() does not return what I expect it to.
I know Execution has a getProcessInstanceId(), how can I get the Instance name from the given Id?