Why is the getName() for a task returning the formKey?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Labels:
- Labels:
-
Alfresco Content Services
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
