<?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 Job in ACT_RU_JOB not being removed. in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/job-in-act-ru-job-not-being-removed/m-p/19246#M8866</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; I have an interesting problem with a TaskListener that I added to a UserTask for a CREATE event. I would like for it to check for a variable and if set to true set the DelegateTask to complete. I believe the correct way to do this would be to have an ExclusiveGateway before it and have that determine if the UserTask should be skipped or not. I chose to do it the wrong way since this skipping mechanism is only used by developers as we are testing and playing around and does not need to be visible to business analysts. I was able to do what I wanted to do by casting the DelegateTask passed to the notify method to a TaskEntity. From the TaskEntity I call complete(). This does what I want but I have run into another problem, which I believe was due to me breaking the rules. If I add a BoundaryEvent Timer to that UserTask, bad things happen. The tasks completes as we want but the Job in the ACT_RU_JOB table remains and then tries to fire at the desired time. This fails since the task it was attached to already completed and remains in the ACT_RU_JOB table until I manually remove it. Is this due to me breaking the rules or is it a bug? Is there a better way to do this within the TaskListener?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank You&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code Snippet:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp; void notify(DelegateTask task) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Casting to TaskEntity which is overkill since I am using Groovy, but there for dramatic effect&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TaskEntity entity = task;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String mySkip = skip?.getValue(task)?.toString();&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (mySkip &amp;amp;&amp;amp; mySkip.equalsIgnoreCase('true')) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Only update if we are in a CREATE listener&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (entity.getEventName()?.equals(EVENTNAME_CREATE)) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Bad things happen If there is a timer attached to the task&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; entity.complete();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Mar 2011 23:08:56 GMT</pubDate>
    <dc:creator>richard1</dc:creator>
    <dc:date>2011-03-30T23:08:56Z</dc:date>
    <item>
      <title>Job in ACT_RU_JOB not being removed.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/job-in-act-ru-job-not-being-removed/m-p/19246#M8866</link>
      <description>Hello all,&amp;nbsp;&amp;nbsp; I have an interesting problem with a TaskListener that I added to a UserTask for a CREATE event. I would like for it to check for a variable and if set to true set the DelegateTask to complete. I believe the correct way to do this would be to have an ExclusiveGateway before it and have</description>
      <pubDate>Wed, 30 Mar 2011 23:08:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/job-in-act-ru-job-not-being-removed/m-p/19246#M8866</guid>
      <dc:creator>richard1</dc:creator>
      <dc:date>2011-03-30T23:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Job in ACT_RU_JOB not being removed.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/job-in-act-ru-job-not-being-removed/m-p/19247#M8867</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;You shouldn't try to complete the task in a taskListener, it's just asking for trouble. Thats also the reason why the timer is still available even when task is finished, due to the fact that the finishing didn't happen the way it should (as normal flow would do)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2011 05:11:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/job-in-act-ru-job-not-being-removed/m-p/19247#M8867</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-03-31T05:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Job in ACT_RU_JOB not being removed.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/job-in-act-ru-job-not-being-removed/m-p/19248#M8868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes I agree but other than doing it the right way&amp;nbsp; &lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://connect.hyland.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt; and using an ExclusiveGateway to direct the path around the task we want skipped can you think of a less wrong way? We are trying to avoid the visibility of the UserTask skipping to the diagram and business analyst since skipping is not part of the regular workflow, it is used by the developers to test and force certain scenarios. If skipping were part of the actual flow we would do it the right way, we are just trying to be sneaking.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reply.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2011 15:53:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/job-in-act-ru-job-not-being-removed/m-p/19248#M8868</guid>
      <dc:creator>richard1</dc:creator>
      <dc:date>2011-03-31T15:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Job in ACT_RU_JOB not being removed.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/job-in-act-ru-job-not-being-removed/m-p/19249#M8869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can't think of any other way that just completing the task using the API (not from the taskListeners). &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone any other thoughts?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 06:13:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/job-in-act-ru-job-not-being-removed/m-p/19249#M8869</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-04-01T06:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Job in ACT_RU_JOB not being removed.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/job-in-act-ru-job-not-being-removed/m-p/19250#M8870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After stepping back I saw the forest through the trees. Most of our user tasks are for automated processing so we have processes that act just like a user, grab a task, work it, then give it back. All this done using Spring Integration, so it is less work for us to build one of these processes to grab a task, do nothing, then give it back. This will do what we wanted, do it the right way, and really be a better test.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help, sorry for being stubborn about forcing it to do it the wrong way.&amp;nbsp; &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 22:45:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/job-in-act-ru-job-not-being-removed/m-p/19250#M8870</guid>
      <dc:creator>richard1</dc:creator>
      <dc:date>2011-04-01T22:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Job in ACT_RU_JOB not being removed.</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/job-in-act-ru-job-not-being-removed/m-p/19251#M8871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No problem, have fun using activiti &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2011 06:50:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/job-in-act-ru-job-not-being-removed/m-p/19251#M8871</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-04-04T06:50:43Z</dc:date>
    </item>
  </channel>
</rss>

