#010941: cancel workflow execution

Description:

It would be nice to have a method in the execution class that cancels a workflow.

In theory it's possible to implement this in the graph. But this would blow up the graph, as you'd need to implement a condition for each input node. (If that is enough - think about issue http://issues.ez.no/IssueView.php?Id=10923url: Jumping between different workflow states.)

I'm not sure how to handle rollbacks (perhaps needed for variable handlers or service objects).

Have a nice day

Thomas


Environment:

Operating System:
PHP Version: (please be specific, like '4.4.3' or '5.1.5')
Database and version:
Browser (and version):


- Attachments

No attachments for this issue.


- Comments

After writing many comments last night, perhaps it could be also an optional child in a node like:


<node ...>
  ...
  <cancel nodeId="..." />
</node>

Would this be an idea? Or would this be to complicated. E.g. if an execution is waiting for input of two nodes and is canceled and both have different cancel node ids. Or is this managable?

Thomas

#252863 by Thomas Nunninger on June 19th, 2007 [Permanent Link]

maybe it's just better to just run the rollback methods on each of the nodes if the workflow is cancelled. Or to have special methods for that. It can become quite complex if you have lots of loops with subworkflows etc....

#252874 by Frederik Holljen on June 19th, 2007 [Permanent Link]

You are right. But there is one problem: probably you can't execute some mail sending or whatever - without misusing the rollback function. Perhaps its easier to define only one cancel element for the whole workflow:


<workflow name="XXX" version="0">
  <cancel nodeId="y" />

  <!-- start and end node -->
  <node id="1" type="Start">
    <outNode id="3" />
  </node>
  ...
#252880 by Thomas Nunninger on June 19th, 2007 [Permanent Link]

I fail to understand your reasoning for the <cancel> element.

What I would like to propose is a new node type "Cancel Case" (in reference to the Workflow Pattern of the same name, see http://www.workflowpatterns.com/patterns/control/cancellation/wcp20.phpurl) that would be a specialization of the existing End node.

While an End node just ends the thread of execution it is in, the "Cancel Case" node would immediately end all threads.

#254561 by Sebastian Bergmann on November 12th, 2007 [Permanent Link]

I think this is similar to what I proposed - or even more powerfull. But one thing (I'm not totally sure about the pattern): if you cancel the workflow (or parts of it) this is not in all cases directly an end node. Think about writing a mail to somebody who gets informed about the cancellation. In my opinion, cancellation is just: reset the actual node and activate another node (not the standard out node).

Thomas

#254617 by Thomas Nunninger on November 14th, 2007 [Permanent Link]

Implemented in r7215.

#255512 by Sebastian Bergmann on January 21st, 2008 [Permanent Link]

Documented in r7664.

#256314 by Sebastian Bergmann on April 7th, 2008 [Permanent Link]

- History
Properties
Type Enhancement
Priority Medium
Components Components » Workflow
Documentation
Affects Unknown
Fix Versions 2008.1alpha1 - eZ components 2008.1alpha1
1.2alpha1 - Workflow 1.2alpha1
Reporter Thomas Nunninger
Responsible Sebastian Bergmann
Status 0 Closed
Resolution Implemented
Created June 14th, 2007
Updated April 7th, 2008
Resolved April 7th, 2008
 
Navigation [Permanent Link]
Previous Issue
Back to Issues List
Next Issue: #015537
  Graph shows to small and truncated rotated axis labels