<?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 Re: How to retrieve business key from task delegate in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-business-key-from-task-delegate/m-p/37983#M20098</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That's not a good idea… You shouldn't use activiti API from within TaskListeners (nor from ExecutionListeners or JavaDelegates), this can mess up transactions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only way I can think of is casting the DelegateExecution (delegateTask.getExecution()) to the Impl and going all the way up to the root execution (which is the process-instance) and get the business-key from there.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Mar 2011 08:10:26 GMT</pubDate>
    <dc:creator>frederikherema1</dc:creator>
    <dc:date>2011-03-23T08:10:26Z</dc:date>
    <item>
      <title>How to retrieve business key from task delegate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-business-key-from-task-delegate/m-p/37981#M20096</link>
      <description>Our web app currently starts a process with a business key … String processName = getProcessName();String businessKey = getBusinessKey();ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();RuntimeService runTimeService = processEngine.getRuntimeService();ProcessInstance processIns</description>
      <pubDate>Tue, 22 Mar 2011 19:57:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-business-key-from-task-delegate/m-p/37981#M20096</guid>
      <dc:creator>yangyang_qian</dc:creator>
      <dc:date>2011-03-22T19:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve business key from task delegate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-business-key-from-task-delegate/m-p/37982#M20097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have not tested it. Propably you can give it a try. You have to inject an instance of your runtimeService to your Tasklistener.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;ProcessInstanceQuery processInstanceQuery = runtimeService.createProcessInstanceQuery();&lt;BR /&gt;ProcessInstance result = processInstanceQuery.processInstanceId(delegateExecution.getProcessInstanceId()).singleResult();&lt;BR /&gt;String businessKey = result.getBusinessKey();&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Daniel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2011 07:47:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-business-key-from-task-delegate/m-p/37982#M20097</guid>
      <dc:creator>dankre</dc:creator>
      <dc:date>2011-03-23T07:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve business key from task delegate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-business-key-from-task-delegate/m-p/37983#M20098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That's not a good idea… You shouldn't use activiti API from within TaskListeners (nor from ExecutionListeners or JavaDelegates), this can mess up transactions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only way I can think of is casting the DelegateExecution (delegateTask.getExecution()) to the Impl and going all the way up to the root execution (which is the process-instance) and get the business-key from there.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2011 08:10:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-business-key-from-task-delegate/m-p/37983#M20098</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-03-23T08:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve business key from task delegate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-business-key-from-task-delegate/m-p/37984#M20099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ah ok, didn't realize there wasn't a built-in way to grab the business key from the DelegateTask … &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think to play it safe I'll just stick with putting the business key in the variables map …&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;public class GenericRequest {&lt;BR /&gt;…&lt;BR /&gt;…&lt;BR /&gt;private void startWorkflow() {&lt;BR /&gt;&amp;nbsp; String processName = determineProcessNameFromFields();&lt;BR /&gt;&amp;nbsp; ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();&lt;BR /&gt;&amp;nbsp; RuntimeService runTimeService = processEngine.getRuntimeService();&lt;BR /&gt;&amp;nbsp; ProcessInstance processInstance = runTimeService.startProcessInstanceByKey(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; processName, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.businessKey,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CollectionUtil.singletonMap( &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "RequisitionId", &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.businessKey &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;BR /&gt; }&lt;BR /&gt;…&lt;BR /&gt;…&lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;and just retrieve it using getVariable&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;public class GenericHumanTaskListener implements TaskListener {&lt;BR /&gt;…&lt;BR /&gt;…&lt;BR /&gt;&lt;BR /&gt; @Override&lt;BR /&gt; public void notify (DelegateTask delegateTask) {&lt;BR /&gt;&amp;nbsp; String wfeTaskID = delegateTask.getId();&lt;BR /&gt;&amp;nbsp; String taskName = delegateTask.getName(); &lt;BR /&gt;&amp;nbsp; String businessKey = delegateTask.getVariable("RequisitionId").toString();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; …&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt; }&lt;BR /&gt;…&lt;BR /&gt;… &lt;BR /&gt; &lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the suggestions!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2011 14:21:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-business-key-from-task-delegate/m-p/37984#M20099</guid>
      <dc:creator>yangyang_qian</dc:creator>
      <dc:date>2011-03-23T14:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve business key from task delegate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-business-key-from-task-delegate/m-p/37985#M20100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, that's the safest. Maybe you can file an issue in our JIRA, because it should be easier to get business-key for a certain task/delegateTask&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 07:00:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-business-key-from-task-delegate/m-p/37985#M20100</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-03-24T07:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve business key from task delegate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-business-key-from-task-delegate/m-p/37986#M20101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Posted&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://jira.codehaus.org/browse/ACT-730" rel="nofollow noopener noreferrer"&gt;http://jira.codehaus.org/browse/ACT-730&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp; to Jira&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2011 16:39:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-retrieve-business-key-from-task-delegate/m-p/37986#M20101</guid>
      <dc:creator>yangyang_qian</dc:creator>
      <dc:date>2011-03-25T16:39:21Z</dc:date>
    </item>
  </channel>
</rss>

