<?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 Activiti Integration: How receive notification for UserTask in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-how-receive-notification-for-usertask/m-p/90142#M61342</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We are integrating Activiti into our own software standing up and configuring our own ProcessEngine. We've managed to get most everything working, but we're a bit stumped on handling UserTasks when they are encountered in a given Process Instance. We are creating our own Activiti Explorer type interface that will query the engine's task service for a given user to display tasks they need to complete. I've got a good understanding on this portion, so my question is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way to receive notification from the Process Engine saying "hey user blah needs to complete task blah"? I can't seem to find a place anywhere on the ProcessEngine instance, any of ProcessEngine's services, or an a ProcessInstance to place a listener. I know you can manually insert a listener in the BPMN XML for a workflow, but I don't want my user to have to add a listener on every single UserTask they put in their workflow. The only way I can think of right now, is to occasionally poll the ProcessEngine's TaskService looking for tasks to complete. Our software is very large with tons of data and thousands of users, polling is just too intensive for our application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there anything I have missed here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Jun 2012 18:44:17 GMT</pubDate>
    <dc:creator>joeysr20det</dc:creator>
    <dc:date>2012-06-18T18:44:17Z</dc:date>
    <item>
      <title>Activiti Integration: How receive notification for UserTask</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-how-receive-notification-for-usertask/m-p/90142#M61342</link>
      <description>We are integrating Activiti into our own software standing up and configuring our own ProcessEngine. We've managed to get most everything working, but we're a bit stumped on handling UserTasks when they are encountered in a given Process Instance. We are creating our own Activiti Explorer type inter</description>
      <pubDate>Mon, 18 Jun 2012 18:44:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-how-receive-notification-for-usertask/m-p/90142#M61342</guid>
      <dc:creator>joeysr20det</dc:creator>
      <dc:date>2012-06-18T18:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Integration: How receive notification for UserTask</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-how-receive-notification-for-usertask/m-p/90143#M61343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can create a custom BpmnParseListener implementation to add execution listeners globally for all processes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;public class CustomBpmnParseListener implements BpmnParseListener {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; // …&lt;BR /&gt;&lt;BR /&gt; @Override&lt;BR /&gt; public void parseUserTask(Element userTaskElement, ScopeImpl scope, ActivityImpl activity) {&lt;BR /&gt;&amp;nbsp; activity.addExecutionListener(ExecutionListener.EVENTNAME_CREATE, new MyHandler());&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Then add it to your process engine configuration:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;BR /&gt;&amp;lt;beans xmlns="&lt;A href="http://www.springframework.org/schema/beans" rel="nofollow noopener noreferrer"&gt;http://www.springframework.org/schema/beans&lt;/A&gt;" xmlns:xsi="&lt;A href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow noopener noreferrer"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;"&lt;BR /&gt;&amp;nbsp; xsi:schemaLocation="&lt;A href="http://www.springframework.org/schema/beans" rel="nofollow noopener noreferrer"&gt;http://www.springframework.org/schema/beans&lt;/A&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="http://www.springframework.org/schema/beans/spring-beans.xsd" rel="nofollow noopener noreferrer"&gt;http://www.springframework.org/schema/beans/spring-beans.xsd&lt;/A&gt;"&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;bean id="processEngineConfiguration" class="org.activiti.cdi.CdiJtaProcessEngineConfiguration"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="customPostBPMNParseListeners"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;list&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bean class="my.company.activiti.CustomBpmnParseListener" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/list&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/bean&amp;gt;&lt;BR /&gt;&amp;lt;/beans&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;I've seen more examples on the forums, just search for the BpmnParseListener interface. Of course this not only applies to user tasks, but all BPMN elements that are parsed by Activiti.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Peter&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2012 04:42:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-how-receive-notification-for-usertask/m-p/90143#M61343</guid>
      <dc:creator>naag</dc:creator>
      <dc:date>2012-06-19T04:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Integration: How receive notification for UserTask</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-how-receive-notification-for-usertask/m-p/90144#M61344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Awesome. This is exactly what I was after. I can figure it out from here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2012 14:23:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-how-receive-notification-for-usertask/m-p/90144#M61344</guid>
      <dc:creator>joeysr20det</dc:creator>
      <dc:date>2012-06-19T14:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Integration: How receive notification for UserTask</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-how-receive-notification-for-usertask/m-p/90145#M61345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So from your example above, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;public class CustomBpmnParseListener implements BpmnParseListener {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; // …&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; public void parseUserTask(Element userTaskElement, ScopeImpl scope, ActivityImpl activity) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; activity.addExecutionListener(ExecutionListener.EVENTNAME_CREATE, new MyHandler());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the ActivityImpl's addExecutionListener only takes an ExecutionListener and ExecutionListener does not contain a EVENTNAME_CREATE only ExecutionListener.START, ExecutionListener.END, ExecutionListener.TAKE. I can't seem to see how to use ExecutionListener here; is there something I'm missing?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2012 15:43:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-how-receive-notification-for-usertask/m-p/90145#M61345</guid>
      <dc:creator>joeysr20det</dc:creator>
      <dc:date>2012-06-19T15:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Integration: How receive notification for UserTask</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-how-receive-notification-for-usertask/m-p/90146#M61346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok I found what I needed to do. I instead just need to cast activity.getBehavoir to a UserTaskActivityBehavior and then add my listener. i.e.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; public void parseUserTask(Element userTaskElement, ScopeImpl scope, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActivityImpl activity)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActivityBehavior ab = activity.getActivityBehavior();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (ab instanceof UserTaskActivityBehavior)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UserTaskActivityBehavior uab = (UserTaskActivityBehavior)ab;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uab.getTaskDefinition().addTaskListener(TaskListener.EVENTNAME_CREATE, new MyTaskListener());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for getting me in the right direction.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2012 17:37:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-how-receive-notification-for-usertask/m-p/90146#M61346</guid>
      <dc:creator>joeysr20det</dc:creator>
      <dc:date>2012-06-19T17:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Integration: How receive notification for UserTask</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-how-receive-notification-for-usertask/m-p/90147#M61347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Seems I didn't read your post carefully enough, but your solution looks like what we're also doing &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; And also what Alfresco is doing (e.g. &lt;/SPAN&gt;&lt;A href="http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/repository/source/java/org/alfresco/repo/workflow/activiti/AlfrescoBpmnParseListener.java" rel="nofollow noopener noreferrer"&gt;http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/repository/source/java/org/alfresco/repo/workflow/activiti/AlfrescoBpmnParseListener.java&lt;/A&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 04:35:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-integration-how-receive-notification-for-usertask/m-p/90147#M61347</guid>
      <dc:creator>naag</dc:creator>
      <dc:date>2012-06-22T04:35:44Z</dc:date>
    </item>
  </channel>
</rss>

