Hi all.
I'm using activiti v5.22, and in script task i want assign creater username into my string.
I found one solution is use ${initiator}, but i can use in script task content;
ex: var message = "Hello " + ${initiator}.
How can I do this?
Many thanks.
var message = "Hello " + execution.getVariable("initiator");
I have try, no error when execute, but result is NULL
message = "Helllo null";
If you set the initiator setting as the start event, you can get it.
initiator: identifies the variable name in which the authenticated user id will be stored when the process is started. Example:
Activiti User Guide 8.2.6. Start Events
1. initiator setting in bpmn
<startEvent id="request" activiti:initiator="initiator" />
2. If you set the above, you can get it with the following script.
var message = "Hello " + execution.getVariable("initiator");
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.