bsoares
November 23, 2017, 6:55am
1
Hi everyone.
How do I get the Process Version or VersionTag of the current process using Groovy?
Searching for it I found the post https://forum.camunda.io/t/get-current-process-instance-id-in-groovy-script/2840/12 that get the Process Instance ID in this way ${execution.getProcessInstanceId()}.
I need something like this execution.getProcessVersion() or execution.getProcessVersionTag()
Thank you.
kristin
November 23, 2017, 8:51am
2
Hi @bsoares ,
you can use execution.getProcessEngineServices() to get access to the engine API services. Then, you can execute different queries.
See for more details: https://docs.camunda.org/manual/7.7/user-guide/process-engine/scripting/#accessing-process-engine-services-using-scripts
Cheers
kristin
2 Likes
bsoares
November 23, 2017, 1:53pm
3
Thank you so much @kristin !
With ProcessEngineServices in hand I can get the Version Tag in this way:
${execution.getProcessEngineServices().getRepositoryService().getProcessDefinition(execution.getProcessDefinitionId()).getVersionTag()}
getVersion() is also available.
1 Like