<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: BPMN Tansactional Subprocess modelled with Xpert.Ivy</title><link>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy</link><description>&lt;p&gt;I am trying to implement an use case to cancel the current case flow. Simplified example can be described as: &lt;/p&gt;
&lt;p&gt;There are two activities 'A' immediately followed by 'B'. 'B' Activity involves human interaction (an entry in todo list) and can be postponed. The challenge is to 'restart' 'A' activity and perform some steps to cancel already started 'B' activity. &lt;/p&gt;
&lt;p&gt;With BPMN i would model 'B' activity with transactional subprocess and cancel event. Quick web searching for 'BPMN Cancel' leads to the usable examples. &lt;/p&gt;
&lt;p&gt;AFAIK there are no direct counterparts neither for BPMN 2.0 Transactional Subporcess nor for cancel event in xIvy.Designer. &lt;/p&gt;
&lt;p&gt;The questions are: &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Is it possible to model it in xPert.Ivy or there are show stoppers? &lt;/li&gt;
&lt;li&gt;There is an API to find and cancel case. Can I set the case to the defined state, say a task? &lt;/li&gt;
&lt;li&gt;Probably another solution for the problem?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Best regards, &lt;/p&gt;
&lt;p&gt;Mikhail.&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 17 Jul 2014 17:11:07 -0400</lastBuildDate><item><title>Comment by Christian Strebel on Christian Strebel's answer</title><link>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy#866</link><description>&lt;p&gt;See question &lt;a href="/questions/744/"&gt;How can I disable Xpert.ivy security/permission checks&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian Strebel</dc:creator><pubDate>Thu, 17 Jul 2014 17:11:07 -0400</pubDate><guid>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy#866</guid></item><item><title>Comment by Christian Strebel on Christian Strebel's answer</title><link>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy#865</link><description>&lt;p&gt;Your "Cancel task" process could be execute the ITask.setActivator()  code as system (user), then you have this permission anyway and you do not have to give this permission directly to anybody. So your process has to check if this step is allowed or not.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian Strebel</dc:creator><pubDate>Thu, 17 Jul 2014 14:07:11 -0400</pubDate><guid>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy#865</guid></item><item><title>Comment by Christian Strebel on Christian Strebel's answer</title><link>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy#864</link><description>&lt;p&gt;Active Tasks are all states except DESTROYED, DONE and ZOMBIE.&lt;/p&gt;
&lt;p&gt;A Task Switch Gateway allows multiple out arcs, and every one generates a own task, this means you can have multiple/parallel tasks per case. You have to use again a Task Switch Gateway to join multiple tasks (multiple input arcs).&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian Strebel</dc:creator><pubDate>Thu, 17 Jul 2014 13:55:13 -0400</pubDate><guid>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy#864</guid></item><item><title>Comment by mgalyutin on Christian Strebel's answer</title><link>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy#863</link><description>&lt;p&gt;To be able to set the activator i should be able to find a case and the actual task. The case can be found using business information (i.e OrderNumber) but how to figure the current task? Documentation states that ICase.getActiveTasks() returns task list in 'active' state. Could it be more then one active task at time? What states on your diagram considered to be 'active'? &lt;/p&gt;
&lt;p&gt;There is also security consideration: ITask.setActivator() require TaskWriteActivator PERMISSION OR OWNS TaskWriteActivator@SYSTEM PERMISSION,but it applies AFIK to any task in the system. Can it be somehow limited?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">mgalyutin</dc:creator><pubDate>Thu, 17 Jul 2014 11:40:02 -0400</pubDate><guid>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy#863</guid></item><item><title>Answer by Christian Strebel</title><link>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy/862</link><description>&lt;p&gt;Possible other Workarounds:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can destroy a Task per API &lt;code&gt;ITask.destroy()&lt;/code&gt; (if there was only this task aktive the case is then finished).&lt;/li&gt;
&lt;li&gt;You can destroy a whole case per API &lt;code&gt;ICase.destroy()&lt;/code&gt; (also all tasks of this case are destoryed).&lt;/li&gt;
&lt;li&gt;You can set another activator to the Task if in state suspended per API &lt;code&gt;ITask.setActivator(...)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;You can also set the "system user" as activator, then the task is automatically executed by the system &lt;code&gt;ITask.setActivator(ivy.session.getSecurityContext().getSystemUser())&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;You could check with an Alternative Process Element if you are executed with a "normal" user and do the happy path or by the system and then make your "compensation" path. See example screenshot &lt;img alt="process_with_system_compensation" src="/upfiles/process_with_system_compensation_1.png"&gt;&lt;/li&gt;
&lt;/ul&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian Strebel</dc:creator><pubDate>Wed, 16 Jul 2014 16:04:11 -0400</pubDate><guid>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy/862</guid></item><item><title>Answer by Christian Strebel</title><link>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy/861</link><description>&lt;p&gt;The following diagram shows the wrofklow task states and the possible state changes of a workflow task in an overview. 
&lt;img alt="TaskStateOverview" src="/upfiles/TaskStateOverview.png"&gt;
The next diagram shows the state SUSPENDED and all possible state changes from or to this state:
&lt;img alt="SuspendedTaskStates" src="/upfiles/SuspendedTaskStates.png"&gt;
The next diagram shows the state RESUMED and all possible state changes from or to this state:
&lt;img alt="ResumedTaskStates" src="/upfiles/ResumedTaskStates.png"&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian Strebel</dc:creator><pubDate>Wed, 16 Jul 2014 15:18:57 -0400</pubDate><guid>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy/861</guid></item><item><title>Comment by mgalyutin on MichaelDänzer's answer</title><link>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy#855</link><description>&lt;p&gt;Have you information about task life cycle? &lt;/p&gt;
&lt;p&gt;The accessible documentation &lt;a href="http://ttp://www.xpertivy.ch/releases/Xpert.ivy/5.0.12/documents/publicApi/ch/ivyteam/ivy/workflow/TaskState.html"&gt;link text&lt;/a&gt; only enumerates possible states without the description of possible transitions.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">mgalyutin</dc:creator><pubDate>Tue, 15 Jul 2014 13:35:22 -0400</pubDate><guid>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy#855</guid></item><item><title>Comment by mgalyutin on MichaelDänzer's answer</title><link>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy#853</link><description>&lt;p&gt;You are absolutely right. Tasks (or Activities) in BPMN semantically differ from the xIvy Tasks. Furthermore xIvy Activity B from your example is not semantically equivalent to the B Activity i meant, because the user can start and see the xIvy task in TODO only at Events (Start,Intermediate etc) or Task Gateway elements in process model.&lt;/p&gt;
&lt;p&gt;If right understood, there is no possibility to reset a task after it has reached End Task Switch gateway (you wrote 'during task execution' in your answer). Is that true?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">mgalyutin</dc:creator><pubDate>Tue, 15 Jul 2014 13:31:03 -0400</pubDate><guid>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy#853</guid></item><item><title>Answer by MichaelDänzer</title><link>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy/851</link><description>&lt;p&gt;I start with a short explanation of the default behavior in Ivy. On the process level everything what happens between two events is atomic. It means either the execution completes successfully or (if not) it is reset to the start (i.e. to the first event). So consider the following situation: &lt;/p&gt;
&lt;p&gt;&lt;img alt="Task in ivy" src="/upfiles/task_1.png"&gt; &lt;/p&gt;
&lt;p&gt;This is what we call a &lt;strong&gt;task&lt;/strong&gt; in Ivy. A sequence of activities (and gateways) between two events (this is in fact a simplification but explains the principle). Note, that a task in BPMN is semantically something else. Now, if during the execution something in A or B fails, then the whole task is reset automatically by Ivy to the &lt;em&gt;Start&lt;/em&gt; event. In case of user interactions this is also true if the session timeout is reached. On the other hand, if everything is working properly then the case has reached the next step and will be proceeded from the &lt;em&gt;End&lt;/em&gt; event. &lt;/p&gt;
&lt;p&gt;&lt;em&gt;2. There is an API to find and cancel case. Can I set the case to the defined state, say a task?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;No, what you can do by API is &lt;a href="http://www.xpertivy.ch/releases/Xpert.ivy/5.0.12/documents/publicApi/ch/ivyteam/ivy/workflow/ITask.html#reset()"&gt;reset a task&lt;/a&gt;. If you call this during the execution, then the task will be reset to its start (the &lt;em&gt;Start&lt;/em&gt; event).&lt;/p&gt;
&lt;p&gt;&lt;em&gt;1. Is it possible to model it in Xpert.ivy or there are show stoppers?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;What you do not have in Ivy is the notion of compensation. There is no such thing as a &lt;em&gt;compensation activity&lt;/em&gt; that is triggered in case of a rollback (or reset in Ivy terms). If you need this, then you must workaround through this. For example, your activities could create some sort of commands that have a compensation mechanisms that are put in a queue. Then the queue is processed at the end of the Ivy task in Java with a transaction framework or something like that.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">MichaelDänzer</dc:creator><pubDate>Tue, 15 Jul 2014 12:00:47 -0400</pubDate><guid>https://answers.axonivy.com/questions/845/bpmn-tansactional-subprocess-modelled-with-xpert-ivy/851</guid></item></channel></rss>