07-08-2021 04:14 PM
I have this declared as my start task for a workflow:
<startEvent id="StartWriteMessage" name="Start" activiti:formKey="elpwf:startAndAssignUser"> <extensionElements> <activiti:taskListener xsi:type="xsd:anyType" event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> <activiti:field xsi:type="xsd:anyType" name="script"> <activiti:string xsi:type="xsd:anyType">execution.setVariable('elpwf_assignUser', task.getVariable('elpwf_assignUser'));</activiti:string> </activiti:field> </activiti:taskListener> </extensionElements> <outgoing>SequenceFlow_1</outgoing> </startEvent>
When I start the workflow and use the Alfresco WorkflowService to get the start task instance like this:
WorkflowTask task = workflowService.getStartTask(workflowInstanceId); String name = task.getName(); logger.debug("task name is:{}",name);
That is printing "elpwf:startAndAssignUser" and I am obviously expecting "Start" (The name in the deffinition) and not the formKey.
What am I doing wrong?
07-09-2021 04:26 AM
You should provide label of that formkey.
You have declared that in workflow model so you have to provide name there.
Explore our Alfresco products with the links below. Use labels to filter content by product module.