<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to get the responsible user/role for an expired task?</title><link>https://answers.axonivy.com/questions/413/how-to-get-the-responsible-user-role-for-an-expired-task</link><description>&lt;p&gt;If a task expires I want to send an email to the user responsible. Unfortunately I do not find a way to get the user/role assigned for the expired task. If I use &lt;code&gt;ivy.task.getActivator()&lt;/code&gt;, &lt;code&gt;ivy.task.getOriginalActivator()&lt;/code&gt; or &lt;code&gt;ivy.task.getWorkerUser()&lt;/code&gt; then always &lt;code&gt;SYSTEM&lt;/code&gt; is returned. I would expect here the user/role of the task before the expiration. So how do I get this user/role?&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/413/how-to-get-the-responsible-user-role-for-an-expired-task" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 06 Jun 2011 09:08:17 -0400</lastBuildDate><item><title>Answer by Bruno Bütler</title><link>https://answers.axonivy.com/questions/413/how-to-get-the-responsible-user-role-for-an-expired-task/414</link><description>&lt;p&gt;If you ask for &lt;code&gt;ivy.task&lt;/code&gt; in the exception process you will get &lt;code&gt;SYSTEM&lt;/code&gt; returned because the exception runs in a &lt;code&gt;SYSTEM&lt;/code&gt; task. &lt;/p&gt;
&lt;p&gt;If you call &lt;code&gt;ivy.case.getActiveTasks()&lt;/code&gt; in the exception process, then you get all the active tasks of the current case. The last entry in the list will be the current &lt;code&gt;SYSTEM&lt;/code&gt; task of the running exception. Filter for the expired task(s) in this list to get your expired task. If there are more than one, then you may need to filter for additional criteria. &lt;/p&gt;
&lt;p&gt;Another workaround is to store the resposnible user/role into a member of the process data before reaching a task switch. In the exception you still can access this data and work with it.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bruno Bütler</dc:creator><pubDate>Mon, 06 Jun 2011 09:08:17 -0400</pubDate><guid>https://answers.axonivy.com/questions/413/how-to-get-the-responsible-user-role-for-an-expired-task/414</guid></item></channel></rss>