Engine instructions (pause, fail, succeed, rollback)

Registered by Renat Akhmerov

We need to be able to specify special engine instructions under clauses 'on-error', 'on-success', 'on-complete' to perform a predefined set of commands:

* pause - To pause workflow execution
* fail - Immediately finish workflow execution with a failure
* succeed - Immediately complete workflow execution with success
* rollback - Rollback workflow

Example:

taskA:
  action: my.action
  on-success:
    - taskB: $.my_val = 10 # Here we start two other tasks as usually (fork)
    - taskC: $.my_val = 5
  on-error:
    - pause: $.my_val = 20 # Here we use a special engine instruction on-condition

For both tasks and instructions conditions are optional.

We also need to be able to define the same clauses (with a little bit different names for clarity such as 'on-task-error', 'on-task-success', 'on-task-complete') at workflow level to specify, for example, error handler for all task in one place. Corresponding clause specified for individual task takes precedence.

Blueprint information

Status:
Complete
Approver:
Renat Akhmerov
Priority:
Medium
Drafter:
Renat Akhmerov
Direction:
Needs approval
Assignee:
Renat Akhmerov
Definition:
New
Series goal:
Accepted for juno
Implementation:
Implemented
Milestone target:
milestone icon 0.1
Started by
Renat Akhmerov
Completed by
Renat Akhmerov

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/mistral-engine-instructions,n,z

Addressed by: https://review.openstack.org/121605
    Fixing task v2 specification

Addressed by: https://review.openstack.org/121606
    Adding unit for tests engine instructions

Addressed by: https://review.openstack.org/121607
    Renaming 'stop_workflow' to 'pause_workflow'

Addressed by: https://review.openstack.org/121608
    Refactoring engine using abstraction of command

Addressed by: https://review.openstack.org/121706
    Fixing workflow handlers to return fail|succeed|pause|rollback commands

Addressed by: https://review.openstack.org/121713
    Fixing workflow specification to support 'on-task-XXX' clauses

Addressed by: https://review.openstack.org/121719
    Implementing workflow 'on-task-XXX' clauses

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.