Add workflow state tracking into CLI commands

Registered by Renat Akhmerov

When we run a command like:

$ mistral execution-create my_workflow input.json

It would be useful to be able to add a key that makes this command track the state of the workflow. For example:

$ mistral execution-create my_workflow input.json --track-state

+--------------------+--------------------------------------+
| Field | Value |
+--------------------+--------------------------------------+
| ID | 04c8408a-277d-4223-834d-a0825d721809 |
| Workflow ID | b053dcc8-1e40-4219-9fcd-853ede3a7ead |
| Workflow name | with_items_2000 |
| Workflow namespace | |
| Description | |
| Task Execution ID | <none> |
| Root Execution ID | <none> |
| State | RUNNING |
| State info | None |
| Created at | 2020-05-18 06:19:59 |
| Updated at | 2020-05-18 06:19:59 |
| Duration | 0:00:13... |
+--------------------+--------------------------------------+

Still running after 20 seconds..
Still running after 30 seconds..
Still running after 40 seconds..
....
....
Workflow completed:
+--------------------+--------------------------------------+
| Field | Value |
+--------------------+--------------------------------------+
| ID | 04c8408a-277d-4223-834d-a0825d721809 |
| Workflow ID | b053dcc8-1e40-4219-9fcd-853ede3a7ead |
| Workflow name | with_items_2000 |
| Workflow namespace | |
| Description | |
| Task Execution ID | <none> |
| Root Execution ID | <none> |
| State | SUCCESS |
| State info | None |
| Created at | 2020-05-18 06:19:59 |
| Updated at | 2020-05-18 06:19:59 |
| Duration | 0:00:53 |
+--------------------+--------------------------------------+
This is just an example of the output. In the final version of the patch we may come up with better ideas.

Also, this tracking functionality can be implemented either as a new command (e.g. $ mistral execution-track-state) or added into "execution-get" as an optional key.

The same tracking function can be made for task and action executions.

Blueprint information

Status:
Not started
Approver:
Renat Akhmerov
Priority:
Medium
Drafter:
Renat Akhmerov
Direction:
Approved
Assignee:
ali abdelal
Definition:
Approved
Series goal:
Accepted for victoria
Implementation:
Not started
Milestone target:
milestone icon wallaby-1

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.