mistral/doc/source/developer/creating_custom_action.rst
Zhao Lei 0f140c7b96 Fix some spelling typo in manual and program output
Fixed following typos.
 infomation -> information
 initilization -> initialization
 intialize -> initialize
 compatability -> compatibility
 compatability -> compatibility
 quering -> querying
 initilization -> initialization
 infomation -> information
 incomming -> incoming

Also fixed some small typo in source comment.

Change-Id: I381aed76094f19f8ef7e821e965fafb0dfe900b2
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
2015-09-24 21:10:36 +08:00

1.1 KiB

How to write an Action Plugin

  1. Write a class inherited from mistral.actions.base.Action
from mistral.actions import base

class RunnerAction(base.Action):
    def __init__(self, param):
        # store the incoming params
        self.param = param

    def run(self):
        # return your results here
        return {'status': 0}
  1. Publish the class in a namespace (in your setup.cfg)
[entry_points]
mistral.actions =
    example.runner = my.mistral_plugins.somefile:RunnerAction
  1. Reinstall Mistral if it was installed in system (not in virtualenv).
  2. Run db-sync tool via either
$ tools/sync_db.sh --config-file <path-to-config>

or

$ mistral-db-manage --config-file <path-to-config> populate
  1. Now you can call the action example.runner
my_workflow:
  tasks:
    my_action_task:
      action: example.runner
      input:
        param: avalue_to_pass_in