mistral/doc/source/terminology/workbooks.rst
csatari a7cd611c78 Applying Pike document structure
This change aligns the Mistral documents folder structure to
the one specified for Pike [1].
Documents were move to thir appropriate folder, but the different
guides do not follow their cookie cutted structure yet.
Install guide is in a separate change [2], while I could not
found the cookie cutter for the rest of the guides.

test-requirements.txt updated with the missing modules.

tox_install.sh modified to do not pass $MODULE_NAME and -e parameter to
edit-constraints.

[1]: http://specs.openstack.org/openstack/docs-specs/specs/pike/os-manuals-migration.html
[2]: https://review.openstack.org/#/c/476499/
[3]: https://etherpad.openstack.org/p/doc-migration-tracking

Change-Id: Ia1101fa2eada446d8eebfefa9bd15d8facd8b3b0
Depends-On: Ia750cb049c0f53a234ea70ce1f2bbbb7a2aa9454
Signed-off-by: csatari <gergely.csatari@nokia.com>
2017-07-11 09:24:17 +02:00

2.5 KiB

Workbooks

Using workbooks users can combine multiple entities of any type (workflows and actions) into one document and upload to Mistral service. When uploading a workbook, Mistral will parse it and save its workflows and actions as independent objects which will be accessible via their own API endpoints (/workflows and /actions). Once it's done the workbook comes out of the game. User can just start workflows and use references to workflows/actions as if they were uploaded without workbook in the first place. However, if need to modify these individual objects user can modify the same workbook definition and re-upload it to Mistral (or, of course, user can do it independently).

Namespacing

One thing that's worth noting is that when using a workbook Mistral uses its name as a prefix for generating final names of workflows and actions included into the workbook. To illustrate this principle let's take a look at the figure below:

image

So after a workbook has been uploaded its workflows and actions become independent objects but with slightly different names.

YAML example

---
version: '2.0'

name: my_workbook
description: My set of workflows and ad-hoc actions

workflows:
  local_workflow1:
    type: direct

    tasks:
      task1:
        action: local_action str1='Hi' str2=' Mistral!'
        on-complete:
          - task2

    task2:
      action: global_action
      ...

  local_workflow2:
    type: reverse

    tasks:
      task1:
        workflow: local_workflow1

      task2:
        workflow: global_workflow param1='val1' param2='val2'
        requires: [task1]
        ...

actions:
  local_action:
    input:
      - str1
      - str2
    base: std.echo output="<% $.str1 %><% $.str2 %>"

NOTE: Even though names of objects inside workbooks change upon uploading Mistral allows referencing between those objects using local names declared in the original workbook.

Attributes

  • name - Workbook name. Required.
  • description - Workbook description. Optional.
  • tags - String with arbitrary comma-separated values. Optional.
  • workflows - Dictionary containing workflow definitions. Optional.
  • actions - Dictionary containing ad-hoc action definitions. Optional.

For more details about Mistral Workflow Language itself, please see Mistral Workflow Language specification </admin/dsl_v2>