<?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 Send reminders to task assignee in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/send-reminders-to-task-assignee/m-p/237324#M190454</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a workflow with parallel user tasks assigned to different users.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For each of these parallel tasks, I need to send reminders to the assignee. Because only the user that has not completed the task has to receive the reminder, I used a "multiple instance subprocess" to spawn the parallel tasks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Each task has a timer boundary that starts every N minutes a task service that is supposed to send the email reminder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Everything works but I would like to do a small change and for this I need to know to which user task the task service is "attached".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only solution I found is to add a listener in the user task that sets the following variable when the task is created:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;execution.setVariable("bpm_currentExecutionId", execution.getId());&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the handler for the service task, I can read this variable and use the ServiceTask to get the task:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;String userTaskExecutionId = execution.getVariable("bpm_currentExecutionId");&lt;BR /&gt;TaskEntity userTask = &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; execution.getEngineServices().getTaskService().createTaskQuery().executionId(userTaskExecutionId ).singleResult();&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a better way ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 01 Oct 2016 12:32:28 GMT</pubDate>
    <dc:creator>marco_altieri_7</dc:creator>
    <dc:date>2016-10-01T12:32:28Z</dc:date>
    <item>
      <title>Send reminders to task assignee</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/send-reminders-to-task-assignee/m-p/237324#M190454</link>
      <description>I have a workflow with parallel user tasks assigned to different users.For each of these parallel tasks, I need to send reminders to the assignee. Because only the user that has not completed the task has to receive the reminder, I used a "multiple instance subprocess" to spawn the parallel tasks.Ea</description>
      <pubDate>Sat, 01 Oct 2016 12:32:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/send-reminders-to-task-assignee/m-p/237324#M190454</guid>
      <dc:creator>marco_altieri_7</dc:creator>
      <dc:date>2016-10-01T12:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Send reminders to task assignee</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/send-reminders-to-task-assignee/m-p/237325#M190455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In the example above there are a couple of missing cast:&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;String userTaskExecutionId = (String) execution.getVariable("bpm_currentExecutionId");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TaskEntity userTask = &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (TaskEntity) execution.getEngineServices().getTaskService().createTaskQuery().executionId(userTaskExecutionId ).singleResult();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Oct 2016 12:38:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/send-reminders-to-task-assignee/m-p/237325#M190455</guid>
      <dc:creator>marco_altieri_7</dc:creator>
      <dc:date>2016-10-01T12:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Send reminders to task assignee</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/send-reminders-to-task-assignee/m-p/237326#M190456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Wouldn't it be more strightforward to set variable with the particular user name instead of execution id ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2016 12:41:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/send-reminders-to-task-assignee/m-p/237326#M190456</guid>
      <dc:creator>p4w3l</dc:creator>
      <dc:date>2016-10-04T12:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Send reminders to task assignee</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/send-reminders-to-task-assignee/m-p/237327#M190457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I need the task and not only the assignee because I want to be able to use the workflow notifications that are available OOTB in Alfresco: they need as input the user task. In general, because the solution that I am writing should be reusable for different use cases, I thought it could be better to easily get the whole task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By the way, the solution that I suggested does not work because the execution.setVariable() set the variable at the process level.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Oct 2016 19:02:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/send-reminders-to-task-assignee/m-p/237327#M190457</guid>
      <dc:creator>marco_altieri_7</dc:creator>
      <dc:date>2016-10-04T19:02:21Z</dc:date>
    </item>
  </channel>
</rss>

