<?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: Pushing available tasks to a custom UI - what Activity Event(s) to hook into? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222619#M175749</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, I was trying to decide between ENTITY_CREATED and TASK_CREATED events.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I do the low-level ENTITY_CREATED event, I fear there a chance that some information is set up yet that would cause the "claim" of it to fail or possibly not be able to load identity links for candidates.&amp;nbsp; Is that true?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps, TASK_CREATED is published only after all these things are related, but I don't know.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Mar 2016 01:37:55 GMT</pubDate>
    <dc:creator>jwestra</dc:creator>
    <dc:date>2016-03-08T01:37:55Z</dc:date>
    <item>
      <title>Pushing available tasks to a custom UI - what Activity Event(s) to hook into?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222617#M175747</link>
      <description>Hi!I have a custom UI that has a Task Queue (available for claim) and I'm using Web Sockets to push data from the Server to each browser.&amp;nbsp; The solution I'd like to create is as follows:1. Each time a new task is available for a set of candidates (whether it is an adhoc Task or a UserTask within a Pr</description>
      <pubDate>Fri, 04 Mar 2016 05:04:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222617#M175747</guid>
      <dc:creator>jwestra</dc:creator>
      <dc:date>2016-03-04T05:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Pushing available tasks to a custom UI - what Activity Event(s) to hook into?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222618#M175748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;the TASK_ASSIGNED would be the one for removing it of the group queue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think that you'll need a lowlevel entity_created event (and check if its a TaskEntity) to know that the task is there.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2016 09:55:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222618#M175748</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-03-07T09:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Pushing available tasks to a custom UI - what Activity Event(s) to hook into?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222619#M175749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, I was trying to decide between ENTITY_CREATED and TASK_CREATED events.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I do the low-level ENTITY_CREATED event, I fear there a chance that some information is set up yet that would cause the "claim" of it to fail or possibly not be able to load identity links for candidates.&amp;nbsp; Is that true?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps, TASK_CREATED is published only after all these things are related, but I don't know.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2016 01:37:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222619#M175749</guid>
      <dc:creator>jwestra</dc:creator>
      <dc:date>2016-03-08T01:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Pushing available tasks to a custom UI - what Activity Event(s) to hook into?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222620#M175750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, the created event would have more data populated (like assignee)… the entity created event is low-lever and would come quicker.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 09:08:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222620#M175750</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-03-11T09:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Pushing available tasks to a custom UI - what Activity Event(s) to hook into?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222621#M175751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It looks like TASK_CREATED does not do what I want either, at least not completely (refer to original post)…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is what my code does:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I store candidate groups along with the Task in the same transaction and I listen for the TASK_CREATED event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;@Transactional&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;public Task saveTask(Task newTask) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; taskService.saveTasK(newTask);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; taskService.addCandidateGroup(newTask.getId(), "someGroup");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return newTask;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//Spring @Transaction commit;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;TASK_CREATED listener looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;public void onEvent(ActivitiEvent event) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ActivitiEntityEvent entityEvent = (ActivitiEntityEvent) event;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Task taskEntity = (Task) entityEvent.getEntity();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;IdentityLink&amp;gt; identityLinkList = taskService&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getIdentityLinksForTask(taskId);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// Get IdentityLink's that are type CANDIDATE and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// Broadcast using WebSockets to the browsers to tell each "candidate's" Queue there is a new task available for them to claim&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, the identityLinkList is empty inside the ActivitiEventListener, so I do not have the information I need to broadcast to the candidate browsers at this time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It appears that the ActivitiEntityEvent TASK_CREATED is received before the transaction commit and if I look for candidates in that event listener, I see none.&amp;nbsp; Activiti must be using READ_COMMITTED on the call to TaskService.getIdentityLinksForTask(taskId), hence, it does not see that I wanted a candidate group for it.&amp;nbsp; Yes, still, I would've hoped a query inside the same transaction would read back the data.&amp;nbsp; This is using the H2 DataSource, BTW.&amp;nbsp; Would behavior be different on PostgreSQL?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would be great if the TASK_CREATED was not raised until after Txn Commit.&amp;nbsp; Then, ActivitiEventListeners that receive the event can ask questions about it and get the answers consistent with the Txn &amp;amp; DB regardless of Driver &amp;amp; Database.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If there is another way to accomplish my goals that I am not seeing, please let me know.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 17:55:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222621#M175751</guid>
      <dc:creator>jwestra</dc:creator>
      <dc:date>2016-03-11T17:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Pushing available tasks to a custom UI - what Activity Event(s) to hook into?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222622#M175752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The database does not matter. Activiti flushes at the _end_ of the transaction, hence why the call TaskService.getIdentityLinksForTask(taskId) does not give you the results. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One option you could look into is postponing the firing of your event after the transaction has been committed. The CommandContextCloseListener allows you do that. It would mean you have to 'collect' the data/callbacks you want to execute until after the transaction has been committed (the commandContext class has a 'attributes' member to store such information).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2016 10:12:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222622#M175752</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-03-15T10:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Pushing available tasks to a custom UI - what Activity Event(s) to hook into?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222623#M175753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank Joram.&amp;nbsp; I just to a look at that class and it appears to have an "impl" in the package, so I am hesitant about hooking in that deep.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess will opt to postpone my logic until after the transaction commit by hooking into Spring's TransactionSynchronizationManager and wait for TransactionSynchronization.afterCommit() to handle things.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That said, it would be sweet if Activiti handled event firing like that in the future, especially given it's tight coupling to Spring anyway &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2016 23:57:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222623#M175753</guid>
      <dc:creator>jwestra</dc:creator>
      <dc:date>2016-03-15T23:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Pushing available tasks to a custom UI - what Activity Event(s) to hook into?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222624#M175754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, it's a planned feature (for the v6) to add that as a first class method.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2016 13:28:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/pushing-available-tasks-to-a-custom-ui-what-activity-event-s-to/m-p/222624#M175754</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-03-18T13:28:10Z</dc:date>
    </item>
  </channel>
</rss>

