mistral/mistral
Dougal Matthews 6356bce814 Add a way to save action executions that run synchronously
When using the command `mistral run-action`, by default it will run the action
synchronously unless the action can only be used asynchronously
(action.is_sync returns False). When it runs synchronously the result of the
action is not saved. When it is ran asynchronously the result is saved, as you
need to retrieve it from Mistral afterwards.

There is a argument on the command `--save-result` that can be used, it causes
the action to be ran asynchronously and the result is saved. There is no way
to have the action run synchronously and have the result be saved.

This patch adds a new API parameter `run_sync` which will be exposed by the
CLI as `--run-sync`. This new argument is intended to be used with `--save-
result` but can be be used independently to ensure an action isn't ran
synchronously by mistake. With the new argument the behaviour of the command
is now as follows:

* `mistral run-action` This behaves as it did before, it runs synchronously if
  it can, or it schedules for later and saves the action.

* `mistral run-action --save-result` Again, this is the same as before, it
  schedules the action to run later and the action is saved.

* `mistral run-action --run-sync` This is similar to having no argument
  passed, however, if you try to run an action that can't be used
  synchronously it will be rejected and an error is returned.

* `mistral run-action --run-sync --save-result` The combination of the two
  arguments runs the actions synchronously and saves the result. If the action
  can't be ran synchronously then an error is returned.

(This commit message uses the CLI to demonstrate the API usage, the new
argument is added in in a mistralclient patch. It can of course be used
directly via the API also.)

Change-Id: I4417750fd5ff47016357655370410e9e7348cc25
(cherry picked from commit 0ed4f05d63)
2016-10-06 07:18:04 +00:00
..
actions Disable Client Caching 2016-09-28 21:45:53 +00:00
api Add a way to save action executions that run synchronously 2016-10-06 07:18:04 +00:00
cmd Fix for timeouting actions on run-action 2016-09-26 09:29:27 +00:00
db Merge "Avoid storing workflow input in task inbound context" into stable/newton 2016-09-27 06:50:51 +00:00
engine Add a way to save action executions that run synchronously 2016-10-06 07:18:04 +00:00
hacking Hacking log for warning 2016-03-30 11:50:15 +00:00
resources Fix for YaqlEvaluationException in std.create_instance workflow. 2016-07-12 00:29:23 -04:00
services Remove environment data from task inbound context 2016-09-29 05:03:49 +00:00
tests Add a way to save action executions that run synchronously 2016-10-06 07:18:04 +00:00
utils Take os_actions_endpoint_type into use 2016-09-26 09:23:07 +00:00
workbook Optimize the logic that check if 'join' task is allowed to start 2016-09-15 14:27:25 +03:00
workflow Remove environment data from task inbound context 2016-09-29 05:03:49 +00:00
__init__.py Remove eventlet monkey patch in mistral __init__ 2015-02-20 07:49:56 +00:00
config.py Take os_actions_endpoint_type into use 2016-09-26 09:23:07 +00:00
context.py Remove context.spawn 2016-09-26 09:26:13 +00:00
coordination.py Raise user-friendly exception in case of connection failed 2015-08-19 10:40:43 +08:00
exceptions.py Fix for raising excepton from kombu 2016-09-26 09:25:08 +00:00
expressions.py Refactoring exception hierarchy 2016-05-11 10:13:33 +00:00
messaging.py Add event configuration for event trigger 2016-09-01 10:28:59 +12:00
version.py Adjusting all license headers in python files so they look the same 2013-12-30 13:27:06 +07:00