<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: End a suspended Task</title><link>https://answers.axonivy.com/questions/1114/end-a-suspended-task</link><description>&lt;p&gt;How can I end a suspended task?
In IWorkflowSession there is a mehtod: &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;public abstract void endWorkingTask(ITask paramITask, String paramString1, String paramString2, String paramString3, boolean paramBoolean)
    throws PersistencyException;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But its undocumented.&lt;/p&gt;
&lt;p&gt;Or is it better to call ITask.destroy()?&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1114/end-a-suspended-task" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 12 Jan 2015 15:37:59 -0500</lastBuildDate><item><title>Answer by Reto Weiss</title><link>https://answers.axonivy.com/questions/1114/end-a-suspended-task/1119</link><description>&lt;p&gt;The method &lt;code&gt;endWorkingTask(...)&lt;/code&gt; of &lt;code&gt;IWorkflowSession&lt;/code&gt; is not public API and should not be used. It is reserved for ivy internal only.&lt;/p&gt;
&lt;p&gt;The method &lt;code&gt;destroy()&lt;/code&gt; of &lt;code&gt;ITask&lt;/code&gt; can be used. It will destroy the task which means:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The task is canceled/aborted&lt;/li&gt;
&lt;li&gt;No user can work on the task later.&lt;/li&gt;
&lt;li&gt;If this is the last running task of a case then the case is also destroyed.&lt;/li&gt;
&lt;li&gt;If other tasks are tried to join on a task element with the task you have destroyed then the tasks will never be joined. This means the case will never end.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you want to cancel the whole process instance (case) then you should use the method &lt;code&gt;destroy&lt;/code&gt; of &lt;code&gt;ICase&lt;/code&gt;.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Mon, 12 Jan 2015 15:37:59 -0500</pubDate><guid>https://answers.axonivy.com/questions/1114/end-a-suspended-task/1119</guid></item></channel></rss>