<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Why is the getName() for a task returning the formKey? in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/why-is-the-getname-for-a-task-returning-the-formkey/m-p/145898#M38665</link>
    <description>&lt;P&gt;I have this declared as my start task for a workflow:&lt;/P&gt;&lt;PRE&gt;    &amp;lt;startEvent id="StartWriteMessage" name="Start" activiti:formKey="elpwf:startAndAssignUser"&amp;gt;
      &amp;lt;extensionElements&amp;gt;
        &amp;lt;activiti:taskListener xsi:type="xsd:anyType" event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"&amp;gt;
          &amp;lt;activiti:field xsi:type="xsd:anyType" name="script"&amp;gt;
            &amp;lt;activiti:string xsi:type="xsd:anyType"&amp;gt;execution.setVariable('elpwf_assignUser', task.getVariable('elpwf_assignUser'));&amp;lt;/activiti:string&amp;gt;
          &amp;lt;/activiti:field&amp;gt;
        &amp;lt;/activiti:taskListener&amp;gt;
      &amp;lt;/extensionElements&amp;gt;
      &amp;lt;outgoing&amp;gt;SequenceFlow_1&amp;lt;/outgoing&amp;gt;
    &amp;lt;/startEvent&amp;gt;&lt;/PRE&gt;&lt;P&gt;When I start the workflow and use the Alfresco WorkflowService to get the start task instance like this:&lt;/P&gt;&lt;PRE&gt;WorkflowTask task = workflowService.getStartTask(workflowInstanceId);
String name = task.getName();
logger.debug("task name is:{}",name);&lt;/PRE&gt;&lt;P&gt;That is printing&amp;nbsp; "elpwf:startAndAssignUser"&amp;nbsp; and I am obviously expecting "Start" (The name in the deffinition)&amp;nbsp; and not the formKey.&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jul 2021 20:14:33 GMT</pubDate>
    <dc:creator>mangar</dc:creator>
    <dc:date>2021-07-08T20:14:33Z</dc:date>
    <item>
      <title>Why is the getName() for a task returning the formKey?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/why-is-the-getname-for-a-task-returning-the-formkey/m-p/145898#M38665</link>
      <description>&lt;P&gt;I have this declared as my start task for a workflow:&lt;/P&gt;&lt;PRE&gt;    &amp;lt;startEvent id="StartWriteMessage" name="Start" activiti:formKey="elpwf:startAndAssignUser"&amp;gt;
      &amp;lt;extensionElements&amp;gt;
        &amp;lt;activiti:taskListener xsi:type="xsd:anyType" event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"&amp;gt;
          &amp;lt;activiti:field xsi:type="xsd:anyType" name="script"&amp;gt;
            &amp;lt;activiti:string xsi:type="xsd:anyType"&amp;gt;execution.setVariable('elpwf_assignUser', task.getVariable('elpwf_assignUser'));&amp;lt;/activiti:string&amp;gt;
          &amp;lt;/activiti:field&amp;gt;
        &amp;lt;/activiti:taskListener&amp;gt;
      &amp;lt;/extensionElements&amp;gt;
      &amp;lt;outgoing&amp;gt;SequenceFlow_1&amp;lt;/outgoing&amp;gt;
    &amp;lt;/startEvent&amp;gt;&lt;/PRE&gt;&lt;P&gt;When I start the workflow and use the Alfresco WorkflowService to get the start task instance like this:&lt;/P&gt;&lt;PRE&gt;WorkflowTask task = workflowService.getStartTask(workflowInstanceId);
String name = task.getName();
logger.debug("task name is:{}",name);&lt;/PRE&gt;&lt;P&gt;That is printing&amp;nbsp; "elpwf:startAndAssignUser"&amp;nbsp; and I am obviously expecting "Start" (The name in the deffinition)&amp;nbsp; and not the formKey.&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 20:14:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/why-is-the-getname-for-a-task-returning-the-formkey/m-p/145898#M38665</guid>
      <dc:creator>mangar</dc:creator>
      <dc:date>2021-07-08T20:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the getName() for a task returning the formKey?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/why-is-the-getname-for-a-task-returning-the-formkey/m-p/145899#M38666</link>
      <description>&lt;P&gt;You should provide label of that formkey.&lt;/P&gt;&lt;P&gt;You have declared that in workflow model so you have to provide name there.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 08:26:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/why-is-the-getname-for-a-task-returning-the-formkey/m-p/145899#M38666</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2021-07-09T08:26:22Z</dc:date>
    </item>
  </channel>
</rss>

