12-27-2017 08:52 PM
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.
12-28-2017 12:53 AM
var message = "Hello " + execution.getVariable("initiator");
12-28-2017 01:11 AM
I have try, no error when execute, but result is NULL
message = "Helllo null";
12-28-2017 04:10 AM
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");
Explore our Alfresco products with the links below. Use labels to filter content by product module.