<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Get process data of a delayed task</title><link>https://answers.axonivy.com/questions/1394/get-process-data-of-a-delayed-task</link><description>&lt;p&gt;I start cases via a trigger element with a delay (blocking period) and some parameters.
In another prozess I query this delayed tasks an want to retrieve the parameters with the getStartProcessData() method like with other running tasks. But the method here returns always null.
Is there a way to get the input parameter of a delayed started case?&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1394/get-process-data-of-a-delayed-task" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 10 Jul 2015 09:59:03 -0400</lastBuildDate><item><title>Comment by Peter Weber on Flavio Sadeghi's answer</title><link>https://answers.axonivy.com/questions/1394/get-process-data-of-a-delayed-task#1397</link><description>&lt;p&gt;Very good. With this internal API I solved my problem for 100%.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peter Weber</dc:creator><pubDate>Fri, 10 Jul 2015 09:59:03 -0400</pubDate><guid>https://answers.axonivy.com/questions/1394/get-process-data-of-a-delayed-task#1397</guid></item><item><title>Answer by Flavio Sadeghi</title><link>https://answers.axonivy.com/questions/1394/get-process-data-of-a-delayed-task/1396</link><description>&lt;p&gt;This is a known issue - or - it works as designed.&lt;/p&gt;
&lt;p&gt;The method &lt;code&gt;ITask.getStartProcessData()&lt;/code&gt; returns the 'in' object of the process-data. &lt;/p&gt;
&lt;p&gt;On a Task Switch Element this in-object is created, when the Task is created. Therefore, as soon as the Task exists, also the start process data exists.&lt;/p&gt;
&lt;p&gt;When a Request Start Element is triggered, the in-object will be created when the start element is executeded. Because the Request Start Element is triggered, this element is no executed on Task creation and therefore no start process data exists.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;As a workaround you could run the triggered Task as System and in a next Step you create the Task for the user with a normal Task Switch.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you are interessted on the param-object (this one is available on a triggered task), you could call the below method. Please note, this is &lt;strong&gt;NOT public API&lt;/strong&gt;!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;public final class MyHelper {
    private MyHelper(){}

    public static Tuple getTriggeredTaskStartParamTuple(final ITask task) throws Exception {
        return SecurityManagerFactory.getSecurityManager().executeAsSystem(
            new Callable&amp;lt;Tuple&amp;gt;() {
                @Override
                public Tuple call() throws Exception {
                    IProcessData processData = task.getInternalStartProcessData();
                    if (processData != null &amp;amp;&amp;amp; ArrayUtils.contains(processData.getValueNames(), "param")) {
                        Object paramTuple = processData.getValue("param");
                        if (paramTuple instanceof Tuple) {
                            return (Tuple) paramTuple;
                        }
                    }
                    return null;
                }
            });
    }
}
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Flavio Sadeghi</dc:creator><pubDate>Thu, 09 Jul 2015 16:44:56 -0400</pubDate><guid>https://answers.axonivy.com/questions/1394/get-process-data-of-a-delayed-task/1396</guid></item></channel></rss>