<?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: Completing a Task from within a CreateListener? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134516#M94436</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Completing the task from within a task-create/assign listener is a no go, regardless of the version of activiti you're using. The purpose of a user-task is to have a user complete it. Isn't it possible to have a gateway before that task that bypasses the task if not needed?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or have the logic in the layer above, that is calling the API. Instead of delegating the task, you can complete() it instead, based on whatever conditions there are.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Jun 2013 07:36:42 GMT</pubDate>
    <dc:creator>frederikherema1</dc:creator>
    <dc:date>2013-06-18T07:36:42Z</dc:date>
    <item>
      <title>Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134507#M94427</link>
      <description>I have a special situation where in some cases, when a UserTask is created, I want to 'automatically' complete it – but I still need to do some work, such as log that it was automatically created and approved. When I call getTaskService().completeTask(id) from inside the TaskListener, I get an excep</description>
      <pubDate>Fri, 15 Mar 2013 17:37:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134507#M94427</guid>
      <dc:creator>ankhara33</dc:creator>
      <dc:date>2013-03-15T17:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134508#M94428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Isn't there another way to model your use case? It sounds now like you are trying to work around something which it wasn't designed for.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 15:43:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134508#M94428</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2013-03-18T15:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134509#M94429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have similar task. My process have dozens of approve tasks, that have different candidate groups.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Each candidate group normally has one user in it, and my create listener assigns this user to the task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, if a user is in e.g. three different groups, and approves a document once, I want to close all other approve-tasks, that will be assigned to him automatically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course there is a solution: I can use exclusive gateway before each task. But there are so many tasks, that it is not a convinient option.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I need to close this tasks automatically. Is there some way to achieve this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 04:55:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134509#M94429</guid>
      <dc:creator>t5d</dc:creator>
      <dc:date>2013-06-06T04:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134510#M94430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;well yeah… as described above you could complete the other ones in a listener.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2013 14:36:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134510#M94430</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2013-06-10T14:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134511#M94431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, Joram. Thank you for your attention!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Have I understood you correctly: there is a way to complete a task within TaskListener?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If so, please, give me a reference or just describe, how to do it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 07:14:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134511#M94431</guid>
      <dc:creator>t5d</dc:creator>
      <dc:date>2013-06-17T07:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134512#M94432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can just use the TaskService in the TaskListener implementation to complete all the tasks you want to complete.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 08:29:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134512#M94432</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2013-06-17T08:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134513#M94433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, trademak. Thank you for your response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It turned out, that I can't just use TaskService, because while in TaskListener (create/assignment) the task is not yet persisted and it can not be found by TaskService.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I did this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt; taskService.complete(delegateTask.getId(), variables);&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And it threw exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By the way, I have tried other variants (which did not work for me):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- signal execution by runtimeService&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt; DelegateExecution execution = delegateTask.getExecution();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; runtimeService.signal(execution.getId());&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- listen for the transaction commit and do my work post-commit&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;Context.getCommandContext()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; .getTransactionContext()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; .addTransactionListener(TransactionState.COMMITTED, new TransactionListener() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void execute(CommandContext commandContext) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; taskService.complete(taskId, variables);&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;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It seemed to execute smoothly on Activiti side, but failed to commit on external transaction (Alfresco transaction), where I caught exception, that a node was changed concurrently in several transactions (other listeners do this job).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- listen for the external (Alfresco) transaction commit and do my work post-commit&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I caught the same exception as previous.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe it is more correct to post this question on Alfresco forums?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I suppose, that Alfresco-like configuration is not the unique one: other configurations also can use external transactions and face similar problems.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 04:44:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134513#M94433</guid>
      <dc:creator>t5d</dc:creator>
      <dc:date>2013-06-18T04:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134514#M94434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Now I don't understand your question anymore. You said that you wanted to complete "other" tasks, not the task for which you registered the task listener on. In your last post it seems like you want to complete the task for which you have defined the task listener, is that correct? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When you want the task on which you defined a task listener with create event you should be able to do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;blockcode&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; delegateTask.getExecution().getEngineServices().getTaskService().complete(delegateTask.getId());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/blockcode&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Doesn't that work for you?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 06:50:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134514#M94434</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2013-06-18T06:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134515#M94435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;trademak: in short: I need to close the task, that was just created and delegated to me in TaskListener.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The method you proposed does not work for me - it throws exception, that task does not exist - I have written it all above, and I suppose Ankhara33 (the author of original question) have tried the same.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;By the way, I am using Activiti bundled with Alfresco 4.0.c - it is Activiti v.5.7.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 07:25:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134515#M94435</guid>
      <dc:creator>t5d</dc:creator>
      <dc:date>2013-06-18T07:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134516#M94436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Completing the task from within a task-create/assign listener is a no go, regardless of the version of activiti you're using. The purpose of a user-task is to have a user complete it. Isn't it possible to have a gateway before that task that bypasses the task if not needed?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or have the logic in the layer above, that is calling the API. Instead of delegating the task, you can complete() it instead, based on whatever conditions there are.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 07:36:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134516#M94436</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-06-18T07:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134517#M94437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, Frederik. Thank you for your response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I understand, that this logic is not within design of Activiti.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Having exclusive gateways in front of every task is too expensive and uncontrollable, as we have dozens of tasks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Following your logic: I should post some message from create listener to some external layer, so that it finds out that the task should be closed. I think that after-commit listener (post #7) is much like this, but it confuses external transaction somehow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How would you design the external layer, that should complete the task automatically and post message to it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 08:29:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134517#M94437</guid>
      <dc:creator>t5d</dc:creator>
      <dc:date>2013-06-18T08:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134518#M94438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No, I mean in the place where you call the activiti API that could potentially cause such a task to be created. After calling the appropriate method on Activiti API (e.g. startProcessByKey()), you can query for tasks in the process that should be auto-completed due to some condition being true. If such tasks are found, complete them using the taskService. Ideally, having transaction-manager setup so that transactions span both API-calls (e.g. using spring transaction manager).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, Tijs told me that completing the task from within the listener should work (in case no special conditions are true, like a multi-instance task). Is it a create or assignment-listener? Perhaps it works with more recent versions of Activiti.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 13:03:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134518#M94438</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-06-19T13:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134519#M94439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The calls to Activiti are made in Alfresco code, however, there are some hook points like form filters, I should try this variant.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My listener is a create listener. As far as I understood Activiti manual, assignment-listener can be called before it to set task assignee, so I used create listener.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;First two tasks (on which I check this behaviour) are connected sequentally, no multi-instance, nothing special…&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps, newer version allows to complete task from listener, I can check this process in latest Alfresco 4.2.c with Activiti 5.10.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another question:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When in listener, the code is executed from wrapped LogInterceptor, SpringTransactionInterceptor, CommandContextInterceptor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When I call TaskService method from listener its code is also wrapped in this interceptors - i.e. another transaction will be opened.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wouldn't this cause any transaction-related problems?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 07:53:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134519#M94439</guid>
      <dc:creator>t5d</dc:creator>
      <dc:date>2013-06-20T07:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134520#M94440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If I'm not mistaken, the transaction will be reused, as a transaction-context is active already… As of 5.13, activiti offers access to the Services through the DelegateTask, ensuring correct transaction handling. But due to the integration in alfresco, the shared transaction manager will make sure the same transaction is used (unless a REQUIRES_NEW is explicit ally required, by e.g.? failing job-executor).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 17:59:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134520#M94440</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-06-24T17:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134521#M94441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, Frederik. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Finally, I succeeded with your way - call TaskService.complete() after calls to other Activiti code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;To be precise - I did this in Alfresco form filter in afterPersist method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your advice.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jun 2013 01:20:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134521#M94441</guid>
      <dc:creator>t5d</dc:creator>
      <dc:date>2013-06-25T01:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134522#M94442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;dear t5d&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i have a same issue and need you support to solve this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;please let me know how you implement TaskService.complete() methout to auto complete a task&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2015 13:53:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134522#M94442</guid>
      <dc:creator>dineshwijesingh</dc:creator>
      <dc:date>2015-10-15T13:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134523#M94443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My piece of code - it works form at least:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@Service&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;public class CustomListener&amp;nbsp; implements ActivitiEventListener {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; switch (event.getType()){&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; case TASK_CREATED:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; onTaskCreated((ActivitiEntityEventImpl) event);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; break;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;private void onTaskCreated(ActivitiEntityEventImpl event) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; TaskEntity task=(TaskEntity) event.getEntity();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; String decision=procS.getLastDecision(event.getExecutionId());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; if(decision!=null &amp;amp;&amp;amp; decision.equals(StatusType.REJECTED)){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; task.complete(null, true);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; else{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; serviceUserTask.setDefultAssignee(task);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Nov 2015 19:48:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134523#M94443</guid>
      <dc:creator>lmazurk</dc:creator>
      <dc:date>2015-11-03T19:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: Completing a Task from within a CreateListener?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134524#M94444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Imazurk,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to complete the user task automatically with ActivitiEventListener, as you did. Task is getting completed, but when it moves to next task throwing persistence exception: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;### Error updating database.&amp;nbsp; Cause: org.postgresql.util.PSQLException: ERROR: insert or update on table "act_ru_identitylink" violates foreign key constraint "act_fk_tskass_task"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;18:47:41,755 INFO&amp;nbsp; [stdout] (http-localhost/127.0.0.1:8080-1)&amp;nbsp;&amp;nbsp; Detail: Key (task_id_)=(207521) is not present in table "act_ru_task".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you please help me on this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2016 13:34:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/completing-a-task-from-within-a-createlistener/m-p/134524#M94444</guid>
      <dc:creator>imkeshav</dc:creator>
      <dc:date>2016-04-14T13:34:04Z</dc:date>
    </item>
  </channel>
</rss>

