Fix documentation for custom actions

Change-Id: Iad6b281d9197a67e7e3a3be55e8d85ec1e967275
This commit is contained in:
Adriano Petrich 2017-04-25 14:46:54 +01:00
parent 121ba2f212
commit 6980ad070d
1 changed files with 11 additions and 4 deletions

View File

@ -13,9 +13,16 @@ How to write a Custom Action
# store the incoming params
self.param = param
def run(self):
# return your results here
return {'status': 0}
def run(self, context):
# Actions can be returned in a manner of ways. The simplest is
# return {'status': 0}
# or using a Result object. The Result has an optional parameter data
# that can be used to transfer information
return actions.Result()
# Failed executions can also be returned using a workflow Result object
# that contains an non empty error parameter such as:
# return actions.Result(error="error text")
2. Publish the class in a namespace (in your ``setup.cfg``)
@ -44,4 +51,4 @@ How to write a Custom Action
my_action_task:
action: example.runner
input:
param: avalue_to_pass_in
param: avalue_to_pass_in