Skip to content

Commit

Permalink
Merge pull request CloudSlang#213 from CloudSlang/nav_to_on_failure
Browse files Browse the repository at this point in the history
aligned to new on_failure rules
  • Loading branch information
gituser173 authored Jun 13, 2016
2 parents e3bfbba + f419610 commit 37ac797
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions cloudslang_dsl_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1184,8 +1184,8 @@ is mapped to the `result <#results>`__ returned by the called

By default, if no ``navigate`` section navigation is present, the flow continues
with the next `step <#step>`__ or navigates to the ``SUCCESS`` result of the
flow if the `step <#step>`__ is the final non-on_failure step. By default the
`on_failure <#on-failure>`__ `step <#step>`__ navigates to the ``FAILURE``
flow if the `step <#step>`__ is the final non-on_failure step. The
`on_failure <#on-failure>`__ `step <#step>`__ always navigates to the ``FAILURE``
result of the flow. For more information, see the
:ref:`Default Navigation <example_default_navigation>` example.

Expand Down Expand Up @@ -1214,8 +1214,7 @@ evaluated as ``SUCCESS``.
For a list of which contexts are available in the ``navigate`` section of a
`step <#step>`__, see `Contexts <#contexts>`__.

**Example - ILLEGAL result will navigate to flow's FAILURE result and
SUCCESS result will navigate to step named *printer***
**Example - ILLEGAL result will navigate to flow's FAILURE result and SUCCESS result will navigate to step named 'printer'**

.. code-block:: yaml
Expand All @@ -1235,11 +1234,17 @@ is mapped to a `step <#step>`__.
Defines the `step <#step>`__, which when using default
`navigation <#navigate>`__, is the target of a ``FAILURE``
`result <#results>`__ returned from an `operation <#operation>`__ or
`flow <#flow>`__. The ``on_failure`` `step's <#step>`__
`navigation <#navigate>`__ defaults to ``FAILURE``.
`flow <#flow>`__. The ``on_failure`` `step <#step>`__ can also be reached by
mapping one of a `step's <#step>`__ `navigation <#navigate>`__ keys to
``on_failure``. If a `step's <#step>`__ `navigation <#navigate>`__ explicitly
maps to ``on_failure``, but there is no ``on_failure`` `step <#step>`__ defined
in the flow, the flow ends with a `result <#results>`__ of ``FAILURE``.

**Example - failure step which call a print operation to print an error
message**
The ``on_failure`` `step <#step>`__ `navigation <#navigate>`__ cannot contain a
`navigation <#navigate>`__ section. It always causes the flow to end with a
`result <#results>`__ of ``FAILURE``.

**Example - failure step which calls a print operation to print an error message**

.. code-block:: yaml
Expand All @@ -1249,6 +1254,18 @@ message**
print:
- text: ${error_msg}
**Example - explicitly navigating to the on_failure step**

.. code-block:: yaml
- go_to_failure:
do:
some_operation:
- input1
navigate:
- SUCCESS: SUCCESS
- FAILURE: on_failure
.. _operation:

operation
Expand Down

0 comments on commit 37ac797

Please sign in to comment.