Search code examples
alfrescoactivitialfresco-webscripts

How to get workflow taskId in Alfresco process service using script task


I wanted to get workflow taskId in a script task variable(Java Script/Groovy) and want's display it on user form.

Please let me know if you have any Idea regarding this.

we are using Alfresco process service 1.9 version

Thanks in Advance.


Solution

  • Store the taskId in a process variable using a *ExecutionListener. create a spring bean that implements the activiti Execution Listener, in the overriden method notify(DelegateExecution execution) set your variable like:

    execution.setVariable("your_var", your_var_value);

    In the Script Task you can access process variables using the Execution. e.g.:

    execution.getVariable("your_var");

    follow the developer series for more details.