cancel
Showing results for 
Search instead for 
Did you mean: 

BPMN: current execution id, process instance id

capacia
Champ in-the-making
Champ in-the-making
Is it possible to get the id of the current execution and/or of the current process instance within BPMN?
4 REPLIES 4

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
I do not have a real clue what you mean. If you are in a process instance, you have already access to it…  Or do you mean as an expression in e.g. a java task somewhere?

capacia
Champ in-the-making
Champ in-the-making
Yes as an expression. I want to call a service using a service task and one of the parameter shall be the process instance id and/or execution id.
For example:



<scriptTask id="scripttask1" name="Prepare Params" scriptFormat="groovy">
<script><![CDATA[
    piid = [processInstanceId];
    eid = [executionId];
]]></script>
</scriptTask>

<serviceTask id="servicetask" name="" activiti:expression="#{myService.doSomething(piid, eid)}"></serviceTask>

frederikherema1
Star Contributor
Star Contributor
In expressions (http://activiti.org/userguide/index.html#apiExpressions), you can use:


<serviceTask id="servicetask" name="" activiti:expression="#{myService.doSomething(execution.id, execution.processInstanceId)}"></serviceTask>

In script-tasks, unfortunately, the execution (DelegateExecution) is not yet exposed (only the variables). Can you create a JIRA improvement for this?

capacia
Champ in-the-making
Champ in-the-making
Thanks for your help.

The JIRA Improvement Ticket is created: ACT-800