From 6980ad070d6c66d697ee5cdca76732e2799b62a6 Mon Sep 17 00:00:00 2001 From: Adriano Petrich Date: Tue, 25 Apr 2017 14:46:54 +0100 Subject: [PATCH] Fix documentation for custom actions Change-Id: Iad6b281d9197a67e7e3a3be55e8d85ec1e967275 --- doc/source/creating_custom_actions.rst | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/doc/source/creating_custom_actions.rst b/doc/source/creating_custom_actions.rst index d1c5b72..2aed5ef 100644 --- a/doc/source/creating_custom_actions.rst +++ b/doc/source/creating_custom_actions.rst @@ -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 \ No newline at end of file + param: avalue_to_pass_in