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?
You should provide label of that formkey.
You have declared that in workflow model so you have to provide name there.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
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.