diff --git a/cloudslang_content.rst b/cloudslang_content.rst index 8e4fcef..3a907b5 100644 --- a/cloudslang_content.rst +++ b/cloudslang_content.rst @@ -40,7 +40,7 @@ Running Content Dependent on External Python Modules ==================================================== Some of the content is dependent on external python modules. To run this content -follow the instructions found in the :ref:`python_script` section of the DSL +follow the instructions found in the :ref:`python_action` section of the DSL Reference. Contributing Content diff --git a/cloudslang_dsl_reference.rst b/cloudslang_dsl_reference.rst index 025bc44..db9b25b 100644 --- a/cloudslang_dsl_reference.rst +++ b/cloudslang_dsl_reference.rst @@ -126,7 +126,15 @@ and concepts are explained in detail below. - `default <#default>`__ - `private <#private>`__ - - `action <#action>`__ + - `python_action <#python-action>`__ + + - `script <#script>`__ + + - `java_action <#java-action>`__ + + - `class_name <#class_name>`__ + - `method_name <#method_name>`__ + - `outputs <#outputs>`__ - `results <#results>`__ @@ -292,22 +300,13 @@ context labeled as **P0** overrides the context labeled as **P1**. Keywords (A-Z) ============== -.. _action: - -action ------- - -The key ``action`` is a property of an `operation <#operation>`__. It is -mapped to a property that defines the type of action, which can be a -`java_action <#java-action>`__ or `python_script <#python-script>`__. - .. _java_action: java_action -~~~~~~~~~~~~ +----------- -The key ``java_action`` is a property of `action <#action>`__. -It is mapped to the properties ``className`` and ``methodName`` that define the +The key ``java_action`` is a property of an `operation <#operation>`__. It is +mapped to the properties ``className`` and ``methodName`` that define the class and method where an annotated Java @Action resides. **Example - CloudSlang call to a Java action** @@ -327,17 +326,16 @@ class and method where an annotated Java @Action resides. - subject - body - action: - java_action: - className: io.cloudslang.content.mail.actions.SendMailAction - methodName: execute + java_action: + className: io.cloudslang.content.mail.actions.SendMailAction + methodName: execute results: - SUCCESS: ${ returnCode == '0' } - FAILURE Existing Java Actions -^^^^^^^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~~~~~~~ There are many existing Java actions which are bundled with the :doc:`CloudSlang CLI `. The source code for these Java actions @@ -345,7 +343,7 @@ can be found in the `score-actions `__ repository. Adding a New Java Action -^^^^^^^^^^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~~~~~~~~~~ To add a new Java action: @@ -354,7 +352,7 @@ To add a new Java action: - `Add the Jar to the lib folder in the CLI <#add-the-jar-to-the-lib-folder-in-the-cli>`__ Write an Annotated Java Method -****************************** +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Create a Java method that conforms to the signature ``public Map doSomething(paramaters)`` and use the following @@ -427,7 +425,7 @@ that matches a CloudSlang output. } Package the Method in a Jar -*************************** +^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use Maven to package the class containing the Java action method. Below is an example **pom.xml** file that can be used for your Maven project. @@ -466,169 +464,12 @@ example **pom.xml** file that can be used for your Maven project. Add the Jar to the lib Folder in the CLI -**************************************** +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Place the Jar created by Maven in the **cslang/lib** folder and restart the CLI. You can now call the Java action from a CloudSlang operation as explained `above <#java-action>`__. -.. _python_script: - -python_script -~~~~~~~~~~~~~ - -The key ``python_script`` is a property of `action <#action>`__. -It is mapped to a value containing a Python script. - -All variables in scope at the conclusion of the Python script must be -serializable. If non-serializable variables are used, remove them from -scope by using the ``del`` keyword before the script exits. - -.. note:: - - CloudSlang uses the `Jython `__ - implementation of Python 2.7. For information on Jython's limitations, - see the `Jython FAQ `__. - -**Example - action with Python script that divides two numbers** - -.. code-block:: yaml - - name: divide - - inputs: - - dividend - - divisor - - action: - python_script: | - if divisor == '0': - quotient = 'division by zero error' - else: - quotient = float(dividend) / float(divisor) - - outputs: - - quotient - - results: - - ILLEGAL: ${quotient == 'division by zero error'} - - SUCCESS - -.. note:: - - Single-line Python scripts can be written inline with the - ``python_script`` key. Multi-line Python scripts can use the YAML pipe - (``|``) indicator as in the example above. - -Importing External Python Packages -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -There are three approaches to importing and using external Python -modules: - -- Installing packages into the **python-lib** folder -- Editing the executable file -- Adding the package location to ``sys.path`` - -**Installing packages into the python-lib folder:** - -Prerequisites: Python 2.7 and pip. - -You can download Python (version 2.7) from `here `__. -Python 2.7.9 and later include pip by default. If you already have Python but -don't have pip, see the pip -`documentation `__ for -installation instructions. - -1. Edit the **requirements.txt** file in the **python-lib** folder, - which is found at the same level as the **bin** folder that contains - the CLI executable. - - - If not using a pre-built CLI, you may have to create the - **python-lib** folder and **requirements.txt** file. - -2. Enter the Python package and all its dependencies in the requirements - file. - - - See the **pip** - `documentation `__ - for information on how to format the requirements file (see - example below). - -3. Run the following command from inside the **python-lib** folder: - ``pip install -r requirements.txt -t``. - - .. note:: - - If your machine is behind a proxy you will need to specify - the proxy using pip's ``--proxy`` flag. - -4. Import the package as you normally would in Python from within the - action's ``python_script``: - -.. code-block:: yaml - - action: - python_script: | - from pyfiglet import Figlet - f = Figlet(font='slant') - print f.renderText(text) - -**Example - requirements file** - -:: - - pyfiglet == 0.7.2 - setuptools - -.. note:: - - If you have defined a ``JYTHONPATH`` environment variable, you - will need to add the **python-lib** folder's path to its value. - -**Editing the executable file** - -1. Open the executable found in the **bin** folder for editing. -2. Change the ``Dpython.path`` key's value to the desired path. -3. Import the package as you normally would in Python from within the - action's ``python_script``. - -**Adding the package location to sys.path:** - -1. In the action's Pyton script, import the ``sys`` module. -2. Use ``sys.path.append()`` to add the path to the desired module. -3. Import the module and use it. - -**Example - takes path as input parameter, adds it to sys.path and -imports desired module** - -.. code-block:: yaml - - inputs: - - path - action: - python_script: | - import sys - sys.path.append(path) - import module_to_import - print module_to_import.something() - -Importing Python Scripts -~~~~~~~~~~~~~~~~~~~~~~~~ - -To import a Python script in a ``python_script`` action: - -1. Add the Python script to the **python-lib** folder, which is found at - the same level as the **bin** folder that contains the CLI - executable. -2. Import the script as you normally would in Python from within the - action's ``python_script``. - -.. note:: - - If you have defined a ``JYTHONPATH`` environment variable, you - will need to add the **python-lib** folder's path to its value. - .. _aggregate: aggregate @@ -915,9 +756,9 @@ For a list of which contexts are available in the arguments section of a inputs: - text - punctuation: "." - action: - python_script: | - print text + punctuation + python_action: + script: | + print text + punctuation .. _extensions: @@ -1402,22 +1243,23 @@ operation The key ``operation`` is mapped to the properties which make up the operation contents. -+-------------+----------+-------------+------------------------+----------------------+--------------------------+ -| Property | Required | Default | Value Type | Description | More Info | -+=============+==========+=============+========================+======================+==========================+ -| ``name`` | yes | -- | string | | name of the | `name <#name>`__ | -| | | | | | operation | | -+-------------+----------+-------------+------------------------+----------------------+--------------------------+ -| ``inputs`` | no | -- | list | operation inputs | `inputs <#inputs>`__ | -+-------------+----------+-------------+------------------------+----------------------+--------------------------+ -| ``action`` | yes | -- | | ``python_script`` or | operation logic | `action <#action>`__ | -| | | | | ``java_action`` | | | -+-------------+----------+-------------+------------------------+----------------------+--------------------------+ -| ``outputs`` | no | -- | list | operation outputs | `outputs <#outputs>`__ | -+-------------+----------+-------------+------------------------+----------------------+--------------------------+ -| ``results`` | no | ``SUCCESS`` | list | | possible operation | `results <#results>`__ | -| | | | | | results | | -+-------------+----------+-------------+------------------------+----------------------+--------------------------+ ++-------------------+----------+-------------+----------------+----------------------+------------------------------------+ +| Property | Required | Default | Value Type | Description | More Info | ++===================+==========+=============+================+======================+====================================+ +| ``name`` | yes | -- | string | | name of the | `name <#name>`__ | +| | | | | | operation | | ++-------------------+----------+-------------+----------------+----------------------+------------------------------------+ +| ``inputs`` | no | -- | list | operation inputs | `inputs <#inputs>`__ | ++-------------------+----------+-------------+----------------+----------------------+------------------------------------+ +| ``python_action`` | no | -- | ``script`` key | operation logic | `python_action <#python-action>`__ | ++-------------------+----------+-------------+----------------+----------------------+------------------------------------+ +| ``java_action`` | | | map | operation logic | `java_action <#java-action>`__ | ++-------------------+----------+-------------+----------------+----------------------+------------------------------------+ +| ``outputs`` | no | -- | list | operation outputs | `outputs <#outputs>`__ | ++-------------------+----------+-------------+----------------+----------------------+------------------------------------+ +| ``results`` | no | ``SUCCESS`` | list | | possible operation | `results <#results>`__ | +| | | | | | results | | ++-------------------+----------+-------------+----------------+----------------------+------------------------------------+ **Example - operation that adds two inputs and outputs the answer** @@ -1429,8 +1271,8 @@ operation contents. - left - right - action: - python_script: ans = left + right + python_action: + script: ans = left + right outputs: - out: ${ans} @@ -1609,6 +1451,14 @@ received from finished branches, allowing for aggregation. aggregate: - name_list: ${map(lambda x:str(x['name']), branches_context)} +.. _python_action: + +python_action +------------- + +The key ``python_action`` is a property of an `operation <#operation>`__. It is +mapped to a ``script`` property that contains the actual Python script. + .. _results: results @@ -1704,6 +1554,166 @@ receive a value or declare a `default <#default>`__ value. - input2: required: false +.. _script: + +script +------ + +The key ``script`` is a property of `python_action <#python-action>`__. +It is mapped to a value containing a Python script. + +All variables in scope at the conclusion of the Python script must be +serializable. If non-serializable variables are used, remove them from +scope by using the ``del`` keyword before the script exits. + +.. note:: + + CloudSlang uses the `Jython `__ + implementation of Python 2.7. For information on Jython's limitations, + see the `Jython FAQ `__. + +**Example - action with Python script that divides two numbers** + +.. code-block:: yaml + + name: divide + + inputs: + - dividend + - divisor + + python_action: + script: | + if divisor == '0': + quotient = 'division by zero error' + else: + quotient = float(dividend) / float(divisor) + + outputs: + - quotient + + results: + - ILLEGAL: ${quotient == 'division by zero error'} + - SUCCESS + +.. note:: + + Single-line Python scripts can be written inline with the + ``script`` key. Multi-line Python scripts can use the YAML pipe + (``|``) indicator as in the example above. + +Importing External Python Packages +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +There are three approaches to importing and using external Python +modules: + +- Installing packages into the **python-lib** folder +- Editing the executable file +- Adding the package location to ``sys.path`` + +Installing Packages into the python-lib Folder +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Prerequisites: Python 2.7 and pip. + +You can download Python (version 2.7) from `here `__. +Python 2.7.9 and later include pip by default. If you already have Python but +don't have pip, see the pip +`documentation `__ for +installation instructions. + +1. Edit the **requirements.txt** file in the **python-lib** folder, + which is found at the same level as the **bin** folder that contains + the CLI executable. + + - If not using a pre-built CLI, you may have to create the + **python-lib** folder and **requirements.txt** file. + +2. Enter the Python package and all its dependencies in the requirements + file. + + - See the **pip** + `documentation `__ + for information on how to format the requirements file (see + example below). + +3. Run the following command from inside the **python-lib** folder: + ``pip install -r requirements.txt -t``. + + .. note:: + + If your machine is behind a proxy you will need to specify + the proxy using pip's ``--proxy`` flag. + +4. Import the package as you normally would in Python from within the + action's ``script``: + +.. code-block:: yaml + + python_action: + script: | + from pyfiglet import Figlet + f = Figlet(font='slant') + print f.renderText(text) + +**Example - requirements file** + +:: + + pyfiglet == 0.7.2 + setuptools + +.. note:: + + If you have defined a ``JYTHONPATH`` environment variable, you + will need to add the **python-lib** folder's path to its value. + +Editing the Executable File +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +1. Open the executable found in the **bin** folder for editing. +2. Change the ``Dpython.path`` key's value to the desired path. +3. Import the package as you normally would in Python from within the + action's ``script``. + +Adding the Package Location to sys.path +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +1. In the action's Pyton script, import the ``sys`` module. +2. Use ``sys.path.append()`` to add the path to the desired module. +3. Import the module and use it. + +**Example - takes path as input parameter, adds it to sys.path and +imports desired module** + +.. code-block:: yaml + + inputs: + - path + python_action: + script: | + import sys + sys.path.append(path) + import module_to_import + print module_to_import.something() + +Importing Python Scripts +~~~~~~~~~~~~~~~~~~~~~~~~ + +To import a Python script in a ``python_action``: + +1. Add the Python script to the **python-lib** folder, which is found at + the same level as the **bin** folder that contains the CLI + executable. +2. Import the script as you normally would in Python from within the + action's ``script``. + +.. note:: + + If you have defined a ``JYTHONPATH`` environment variable, you + will need to add the **python-lib** folder's path to its value. + .. _step: step @@ -1941,8 +1951,8 @@ value associated with ``expression2``. name: operation inputs: - in1 - action: - python_script: | + python_action: + script: | out1 = 'not x' if in1 != 'x' else None outputs: - out1 diff --git a/cloudslang_examples.rst b/cloudslang_examples.rst index a465d9a..3f09632 100644 --- a/cloudslang_examples.rst +++ b/cloudslang_examples.rst @@ -84,8 +84,8 @@ user-defined result of ``ILLEGAL``. - dividend - divisor - action: - python_script: | + python_action: + script: | if divisor == '0': quotient = 'division by zero error' else: @@ -110,8 +110,8 @@ user-defined result of ``ILLEGAL``. inputs: - text - action: - python_script: print text + python_action: + script: print text results: - SUCCESS @@ -178,8 +178,8 @@ the success of its first step. inputs: - navigation_type - action: - python_script: | + python_action: + script: | print 'Default navigation based on input of - ' + navigation_type results: @@ -195,8 +195,8 @@ the success of its first step. operation: name: something - action: - python_script: | + python_action: + script: | print 'Doing something important' **Operation - send_email_mock.sl** @@ -212,8 +212,8 @@ the success of its first step. - recipient - subject - action: - python_script: | + python_action: + script: | print 'Email sent to ' + recipient + ' with subject - ' + subject Example 3 - Subflow @@ -356,8 +356,8 @@ looped on and various methods for handling loop breaks. inputs: - text - action: - python_script: print text + python_action: + script: print text results: - CUSTOM: ${int(text) == 3} @@ -375,8 +375,8 @@ looped on and various methods for handling loop breaks. inputs: - text - action: - python_script: print text + python_action: + script: print text outputs: - out: ${text} @@ -440,8 +440,8 @@ aggregation. inputs: - ID - action: - python_script: | + python_action: + script: | name = 'branch ' + str(ID) print 'Hello from ' + name @@ -520,8 +520,8 @@ This example uses the following folder structure: inputs: - text - action: - python_script: print text + python_action: + script: print text **Operation - op2.sl** @@ -535,8 +535,8 @@ This example uses the following folder structure: inputs: - text - action: - python_script: print text + python_action: + script: print text **Operation - op3.sl** @@ -550,8 +550,8 @@ This example uses the following folder structure: inputs: - text - action: - python_script: print text + python_action: + script: print text **Operation - op4.sl** @@ -565,5 +565,5 @@ This example uses the following folder structure: inputs: - text - action: - python_script: print text + python_action: + script: print text diff --git a/code/examples_code/examples/async.zip b/code/examples_code/examples/async.zip index 4b39518..79f2cb6 100644 Binary files a/code/examples_code/examples/async.zip and b/code/examples_code/examples/async.zip differ diff --git a/code/examples_code/examples/async/print_branch.sl b/code/examples_code/examples/async/print_branch.sl index 3d31708..af12309 100644 --- a/code/examples_code/examples/async/print_branch.sl +++ b/code/examples_code/examples/async/print_branch.sl @@ -6,8 +6,8 @@ operation: inputs: - ID - action: - python_script: | + python_action: + script: | name = 'branch ' + str(ID) print 'Hello from ' + name diff --git a/code/examples_code/examples/defaultnav.zip b/code/examples_code/examples/defaultnav.zip index 4095a35..46dbcbc 100644 Binary files a/code/examples_code/examples/defaultnav.zip and b/code/examples_code/examples/defaultnav.zip differ diff --git a/code/examples_code/examples/defaultnav/produce_default_navigation.sl b/code/examples_code/examples/defaultnav/produce_default_navigation.sl index 78edebd..96ffa28 100644 --- a/code/examples_code/examples/defaultnav/produce_default_navigation.sl +++ b/code/examples_code/examples/defaultnav/produce_default_navigation.sl @@ -6,8 +6,8 @@ operation: inputs: - navigation_type - action: - python_script: | + python_action: + script: | print 'Default navigation based on input of - ' + navigation_type results: diff --git a/code/examples_code/examples/defaultnav/send_email_mock.sl b/code/examples_code/examples/defaultnav/send_email_mock.sl index 22fd30a..19b6b97 100644 --- a/code/examples_code/examples/defaultnav/send_email_mock.sl +++ b/code/examples_code/examples/defaultnav/send_email_mock.sl @@ -7,6 +7,6 @@ operation: - recipient - subject - action: - python_script: | + python_action: + script: | print 'Email sent to ' + recipient + ' with subject - ' + subject diff --git a/code/examples_code/examples/defaultnav/something.sl b/code/examples_code/examples/defaultnav/something.sl index de0402f..1c848f9 100644 --- a/code/examples_code/examples/defaultnav/something.sl +++ b/code/examples_code/examples/defaultnav/something.sl @@ -3,6 +3,6 @@ namespace: examples.defaultnav operation: name: something - action: - python_script: | + python_action: + script: | print 'Doing something important' diff --git a/code/examples_code/examples/divide.zip b/code/examples_code/examples/divide.zip index c53ada0..c8e1573 100644 Binary files a/code/examples_code/examples/divide.zip and b/code/examples_code/examples/divide.zip differ diff --git a/code/examples_code/examples/divide/divide.sl b/code/examples_code/examples/divide/divide.sl index 2b33cdd..2fe3d62 100644 --- a/code/examples_code/examples/divide/divide.sl +++ b/code/examples_code/examples/divide/divide.sl @@ -8,8 +8,8 @@ operation: - dividend - divisor - action: - python_script: | + python_action: + script: | if divisor == '0': quotient = 'division by zero error' else: diff --git a/code/examples_code/examples/divide/print.sl b/code/examples_code/examples/divide/print.sl index c9048f8..04559ed 100644 --- a/code/examples_code/examples/divide/print.sl +++ b/code/examples_code/examples/divide/print.sl @@ -6,8 +6,8 @@ operation: inputs: - text - action: - python_script: print text + python_action: + script: print text results: - SUCCESS diff --git a/code/examples_code/examples/hello_world.zip b/code/examples_code/examples/hello_world.zip index da85f35..6192bd4 100644 Binary files a/code/examples_code/examples/hello_world.zip and b/code/examples_code/examples/hello_world.zip differ diff --git a/code/examples_code/examples/hello_world/print.sl b/code/examples_code/examples/hello_world/print.sl index 0b02c7f..a2673b7 100644 --- a/code/examples_code/examples/hello_world/print.sl +++ b/code/examples_code/examples/hello_world/print.sl @@ -7,8 +7,8 @@ operation: inputs: - text - action: - python_script: print text + python_action: + script: print text results: - SUCCESS diff --git a/code/examples_code/examples/loops.zip b/code/examples_code/examples/loops.zip index 27dcc7c..bf4bfff 100644 Binary files a/code/examples_code/examples/loops.zip and b/code/examples_code/examples/loops.zip differ diff --git a/code/examples_code/examples/loops/custom3.sl b/code/examples_code/examples/loops/custom3.sl index 191346d..21f3f88 100644 --- a/code/examples_code/examples/loops/custom3.sl +++ b/code/examples_code/examples/loops/custom3.sl @@ -6,8 +6,8 @@ operation: inputs: - text - action: - python_script: print text + python_action: + script: print text results: - CUSTOM: ${int(text) == 3} diff --git a/code/examples_code/examples/loops/fail3.sl b/code/examples_code/examples/loops/fail3.sl index 4555828..34a0c9e 100644 --- a/code/examples_code/examples/loops/fail3.sl +++ b/code/examples_code/examples/loops/fail3.sl @@ -6,8 +6,8 @@ operation: inputs: - text - action: - python_script: print text + python_action: + script: print text results: - FAILURE: ${int(text) == 3} diff --git a/code/examples_code/examples/loops/print.sl b/code/examples_code/examples/loops/print.sl index 07f9841..981592b 100644 --- a/code/examples_code/examples/loops/print.sl +++ b/code/examples_code/examples/loops/print.sl @@ -6,8 +6,8 @@ operation: inputs: - text - action: - python_script: print text + python_action: + script: print text outputs: - out: ${text} diff --git a/code/examples_code/examples/paths.zip b/code/examples_code/examples/paths.zip index 236c779..380ea08 100644 Binary files a/code/examples_code/examples/paths.zip and b/code/examples_code/examples/paths.zip differ diff --git a/code/examples_code/examples/paths/folder_a/op2.sl b/code/examples_code/examples/paths/folder_a/op2.sl index 1be206e..60d7c78 100644 --- a/code/examples_code/examples/paths/folder_a/op2.sl +++ b/code/examples_code/examples/paths/folder_a/op2.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text + python_action: + script: print text diff --git a/code/examples_code/examples/paths/folder_b/folder_c/op4.sl b/code/examples_code/examples/paths/folder_b/folder_c/op4.sl index 6081d1d..e4f1930 100644 --- a/code/examples_code/examples/paths/folder_b/folder_c/op4.sl +++ b/code/examples_code/examples/paths/folder_b/folder_c/op4.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text + python_action: + script: print text diff --git a/code/examples_code/examples/paths/folder_b/op3.sl b/code/examples_code/examples/paths/folder_b/op3.sl index 44b40e2..f2cd564 100644 --- a/code/examples_code/examples/paths/folder_b/op3.sl +++ b/code/examples_code/examples/paths/folder_b/op3.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text + python_action: + script: print text diff --git a/code/examples_code/examples/paths/op1.sl b/code/examples_code/examples/paths/op1.sl index bad5b8e..8daf863 100644 --- a/code/examples_code/examples/paths/op1.sl +++ b/code/examples_code/examples/paths/op1.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text + python_action: + script: print text diff --git a/code/tutorial_code/io/cloudslang/base/mail/send_mail.sl b/code/tutorial_code/io/cloudslang/base/mail/send_mail.sl index 1eab04c..2d67bf2 100644 --- a/code/tutorial_code/io/cloudslang/base/mail/send_mail.sl +++ b/code/tutorial_code/io/cloudslang/base/mail/send_mail.sl @@ -64,10 +64,9 @@ operation: required: false - delimiter: required: false - action: - java_action: - className: io.cloudslang.content.mail.actions.SendMailAction - methodName: execute + java_action: + className: io.cloudslang.content.mail.actions.SendMailAction + methodName: execute results: - SUCCESS: ${ returnCode == '0' } - - FAILURE \ No newline at end of file + - FAILURE diff --git a/code/tutorial_code/tutorials_02.zip b/code/tutorial_code/tutorials_02.zip index 9f768ae..c68220c 100644 Binary files a/code/tutorial_code/tutorials_02.zip and b/code/tutorial_code/tutorials_02.zip differ diff --git a/code/tutorial_code/tutorials_02/base/print.sl b/code/tutorial_code/tutorials_02/base/print.sl index 046a07d..2459d99 100644 --- a/code/tutorial_code/tutorials_02/base/print.sl +++ b/code/tutorial_code/tutorials_02/base/print.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text \ No newline at end of file + python_action: + script: print text diff --git a/code/tutorial_code/tutorials_03.zip b/code/tutorial_code/tutorials_03.zip index 5995955..8093a5b 100644 Binary files a/code/tutorial_code/tutorials_03.zip and b/code/tutorial_code/tutorials_03.zip differ diff --git a/code/tutorial_code/tutorials_03/base/print.sl b/code/tutorial_code/tutorials_03/base/print.sl index 11c34dc..02e05c8 100644 --- a/code/tutorial_code/tutorials_03/base/print.sl +++ b/code/tutorial_code/tutorials_03/base/print.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text \ No newline at end of file + python_action: + script: print text diff --git a/code/tutorial_code/tutorials_04.zip b/code/tutorial_code/tutorials_04.zip index 5373067..e69e9f5 100644 Binary files a/code/tutorial_code/tutorials_04.zip and b/code/tutorial_code/tutorials_04.zip differ diff --git a/code/tutorial_code/tutorials_04/base/print.sl b/code/tutorial_code/tutorials_04/base/print.sl index a76ac19..022b555 100644 --- a/code/tutorial_code/tutorials_04/base/print.sl +++ b/code/tutorial_code/tutorials_04/base/print.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text \ No newline at end of file + python_action: + script: print text diff --git a/code/tutorial_code/tutorials_04/hiring/check_availability.sl b/code/tutorial_code/tutorials_04/hiring/check_availability.sl index 2cffecb..6464464 100644 --- a/code/tutorial_code/tutorials_04/hiring/check_availability.sl +++ b/code/tutorial_code/tutorials_04/hiring/check_availability.sl @@ -6,8 +6,8 @@ operation: inputs: - address - action: - python_script: | + python_action: + script: | import random rand = random.randint(0, 2) vacant = rand != 0 diff --git a/code/tutorial_code/tutorials_05.zip b/code/tutorial_code/tutorials_05.zip index bb33f9f..c23b09b 100644 Binary files a/code/tutorial_code/tutorials_05.zip and b/code/tutorial_code/tutorials_05.zip differ diff --git a/code/tutorial_code/tutorials_05/base/print.sl b/code/tutorial_code/tutorials_05/base/print.sl index 72f7dc7..9a6455a 100644 --- a/code/tutorial_code/tutorials_05/base/print.sl +++ b/code/tutorial_code/tutorials_05/base/print.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text \ No newline at end of file + python_action: + script: print text diff --git a/code/tutorial_code/tutorials_05/hiring/check_availability.sl b/code/tutorial_code/tutorials_05/hiring/check_availability.sl index 37e8b72..9adbf5a 100644 --- a/code/tutorial_code/tutorials_05/hiring/check_availability.sl +++ b/code/tutorial_code/tutorials_05/hiring/check_availability.sl @@ -6,8 +6,8 @@ operation: inputs: - address - action: - python_script: | + python_action: + script: | import random rand = random.randint(0, 2) vacant = rand != 0 diff --git a/code/tutorial_code/tutorials_06.zip b/code/tutorial_code/tutorials_06.zip index d49a7fe..bc3d4d6 100644 Binary files a/code/tutorial_code/tutorials_06.zip and b/code/tutorial_code/tutorials_06.zip differ diff --git a/code/tutorial_code/tutorials_06/base/print.sl b/code/tutorial_code/tutorials_06/base/print.sl index 1399987..9a486ee 100644 --- a/code/tutorial_code/tutorials_06/base/print.sl +++ b/code/tutorial_code/tutorials_06/base/print.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text \ No newline at end of file + python_action: + script: print text diff --git a/code/tutorial_code/tutorials_06/hiring/check_availability.sl b/code/tutorial_code/tutorials_06/hiring/check_availability.sl index 59d1f65..d2b2789 100644 --- a/code/tutorial_code/tutorials_06/hiring/check_availability.sl +++ b/code/tutorial_code/tutorials_06/hiring/check_availability.sl @@ -6,8 +6,8 @@ operation: inputs: - address - action: - python_script: | + python_action: + script: | import random rand = random.randint(0, 2) vacant = rand != 0 diff --git a/code/tutorial_code/tutorials_07.zip b/code/tutorial_code/tutorials_07.zip index f904a48..756a1a3 100644 Binary files a/code/tutorial_code/tutorials_07.zip and b/code/tutorial_code/tutorials_07.zip differ diff --git a/code/tutorial_code/tutorials_07/base/print.sl b/code/tutorial_code/tutorials_07/base/print.sl index 57dc786..c1ed932 100644 --- a/code/tutorial_code/tutorials_07/base/print.sl +++ b/code/tutorial_code/tutorials_07/base/print.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text \ No newline at end of file + python_action: + script: print text diff --git a/code/tutorial_code/tutorials_07/hiring/check_availability.sl b/code/tutorial_code/tutorials_07/hiring/check_availability.sl index 37197d5..4acf203 100644 --- a/code/tutorial_code/tutorials_07/hiring/check_availability.sl +++ b/code/tutorial_code/tutorials_07/hiring/check_availability.sl @@ -6,8 +6,8 @@ operation: inputs: - address - action: - python_script: | + python_action: + script: | import random rand = random.randint(0, 2) vacant = rand != 0 diff --git a/code/tutorial_code/tutorials_08.zip b/code/tutorial_code/tutorials_08.zip index 4f7926f..b7bd41c 100644 Binary files a/code/tutorial_code/tutorials_08.zip and b/code/tutorial_code/tutorials_08.zip differ diff --git a/code/tutorial_code/tutorials_08/base/print.sl b/code/tutorial_code/tutorials_08/base/print.sl index dd267b5..99c6ba1 100644 --- a/code/tutorial_code/tutorials_08/base/print.sl +++ b/code/tutorial_code/tutorials_08/base/print.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text \ No newline at end of file + python_action: + script: print text diff --git a/code/tutorial_code/tutorials_08/hiring/check_availability.sl b/code/tutorial_code/tutorials_08/hiring/check_availability.sl index 9826708..cc437fe 100644 --- a/code/tutorial_code/tutorials_08/hiring/check_availability.sl +++ b/code/tutorial_code/tutorials_08/hiring/check_availability.sl @@ -6,8 +6,8 @@ operation: inputs: - address - action: - python_script: | + python_action: + script: | import random rand = random.randint(0, 2) vacant = rand != 0 diff --git a/code/tutorial_code/tutorials_08/hiring/generate_user_email.sl b/code/tutorial_code/tutorials_08/hiring/generate_user_email.sl index bc0cc68..ba8075a 100644 --- a/code/tutorial_code/tutorials_08/hiring/generate_user_email.sl +++ b/code/tutorial_code/tutorials_08/hiring/generate_user_email.sl @@ -14,8 +14,8 @@ operation: private: true - attempt - action: - python_script: | + python_action: + script: | attempt = int(attempt) if attempt == 1: address = first_name[0:1] + '.' + last_name + '@' + domain diff --git a/code/tutorial_code/tutorials_09.zip b/code/tutorial_code/tutorials_09.zip index 65009f9..53b841a 100644 Binary files a/code/tutorial_code/tutorials_09.zip and b/code/tutorial_code/tutorials_09.zip differ diff --git a/code/tutorial_code/tutorials_09/base/print.sl b/code/tutorial_code/tutorials_09/base/print.sl index b6c8663..ce5fa8e 100644 --- a/code/tutorial_code/tutorials_09/base/print.sl +++ b/code/tutorial_code/tutorials_09/base/print.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text \ No newline at end of file + python_action: + script: print text diff --git a/code/tutorial_code/tutorials_09/hiring/check_availability.sl b/code/tutorial_code/tutorials_09/hiring/check_availability.sl index 4bf899f..dc4b651 100644 --- a/code/tutorial_code/tutorials_09/hiring/check_availability.sl +++ b/code/tutorial_code/tutorials_09/hiring/check_availability.sl @@ -6,8 +6,8 @@ operation: inputs: - address - action: - python_script: | + python_action: + script: | import random rand = random.randint(0, 2) vacant = rand != 0 diff --git a/code/tutorial_code/tutorials_09/hiring/generate_user_email.sl b/code/tutorial_code/tutorials_09/hiring/generate_user_email.sl index 09ef6dc..f874157 100644 --- a/code/tutorial_code/tutorials_09/hiring/generate_user_email.sl +++ b/code/tutorial_code/tutorials_09/hiring/generate_user_email.sl @@ -13,8 +13,8 @@ operation: private: true - attempt - action: - python_script: | + python_action: + script: | attempt = int(attempt) if attempt == 1: address = first_name[0:1] + '.' + last_name + '@' + domain diff --git a/code/tutorial_code/tutorials_10.zip b/code/tutorial_code/tutorials_10.zip index b00fa72..cf3ccaa 100644 Binary files a/code/tutorial_code/tutorials_10.zip and b/code/tutorial_code/tutorials_10.zip differ diff --git a/code/tutorial_code/tutorials_10/base/print.sl b/code/tutorial_code/tutorials_10/base/print.sl index f02fe63..6a2a47f 100644 --- a/code/tutorial_code/tutorials_10/base/print.sl +++ b/code/tutorial_code/tutorials_10/base/print.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text \ No newline at end of file + python_action: + script: print text diff --git a/code/tutorial_code/tutorials_10/hiring/check_availability.sl b/code/tutorial_code/tutorials_10/hiring/check_availability.sl index 5a3da78..e9f55e5 100644 --- a/code/tutorial_code/tutorials_10/hiring/check_availability.sl +++ b/code/tutorial_code/tutorials_10/hiring/check_availability.sl @@ -6,8 +6,8 @@ operation: inputs: - address - action: - python_script: | + python_action: + script: | import random rand = random.randint(0, 2) vacant = rand != 0 diff --git a/code/tutorial_code/tutorials_10/hiring/generate_user_email.sl b/code/tutorial_code/tutorials_10/hiring/generate_user_email.sl index b24445e..dbbc672 100644 --- a/code/tutorial_code/tutorials_10/hiring/generate_user_email.sl +++ b/code/tutorial_code/tutorials_10/hiring/generate_user_email.sl @@ -13,8 +13,8 @@ operation: private: true - attempt - action: - python_script: | + python_action: + script: | attempt = int(attempt) if attempt == 1: address = first_name[0:1] + '.' + last_name + '@' + domain diff --git a/code/tutorial_code/tutorials_11.zip b/code/tutorial_code/tutorials_11.zip index ff285d8..3acd341 100644 Binary files a/code/tutorial_code/tutorials_11.zip and b/code/tutorial_code/tutorials_11.zip differ diff --git a/code/tutorial_code/tutorials_11/base/print.sl b/code/tutorial_code/tutorials_11/base/print.sl index 0cb83d0..bcf9edb 100644 --- a/code/tutorial_code/tutorials_11/base/print.sl +++ b/code/tutorial_code/tutorials_11/base/print.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text \ No newline at end of file + python_action: + script: print text diff --git a/code/tutorial_code/tutorials_11/hiring/check_availability.sl b/code/tutorial_code/tutorials_11/hiring/check_availability.sl index 2f9f935..3dcdae5 100644 --- a/code/tutorial_code/tutorials_11/hiring/check_availability.sl +++ b/code/tutorial_code/tutorials_11/hiring/check_availability.sl @@ -6,8 +6,8 @@ operation: inputs: - address - action: - python_script: | + python_action: + script: | import random rand = random.randint(0, 2) vacant = rand != 0 diff --git a/code/tutorial_code/tutorials_11/hiring/generate_user_email.sl b/code/tutorial_code/tutorials_11/hiring/generate_user_email.sl index 2373132..dd7824b 100644 --- a/code/tutorial_code/tutorials_11/hiring/generate_user_email.sl +++ b/code/tutorial_code/tutorials_11/hiring/generate_user_email.sl @@ -13,8 +13,8 @@ operation: private: true - attempt - action: - python_script: | + python_action: + script: | attempt = int(attempt) if attempt == 1: address = first_name[0:1] + '.' + last_name + '@' + domain diff --git a/code/tutorial_code/tutorials_11/hiring/order.sl b/code/tutorial_code/tutorials_11/hiring/order.sl index 6345b54..a0c24b1 100644 --- a/code/tutorial_code/tutorials_11/hiring/order.sl +++ b/code/tutorial_code/tutorials_11/hiring/order.sl @@ -7,8 +7,8 @@ operation: - item - price - action: - python_script: | + python_action: + script: | print 'Ordering: ' + item import random rand = random.randint(0, 2) diff --git a/code/tutorial_code/tutorials_12.zip b/code/tutorial_code/tutorials_12.zip index ba37d2f..7781fa0 100644 Binary files a/code/tutorial_code/tutorials_12.zip and b/code/tutorial_code/tutorials_12.zip differ diff --git a/code/tutorial_code/tutorials_12/base/print.sl b/code/tutorial_code/tutorials_12/base/print.sl index 1e6a386..203ecdc 100644 --- a/code/tutorial_code/tutorials_12/base/print.sl +++ b/code/tutorial_code/tutorials_12/base/print.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text \ No newline at end of file + python_action: + script: print text diff --git a/code/tutorial_code/tutorials_12/hiring/check_availability.sl b/code/tutorial_code/tutorials_12/hiring/check_availability.sl index bfeff80..085046f 100644 --- a/code/tutorial_code/tutorials_12/hiring/check_availability.sl +++ b/code/tutorial_code/tutorials_12/hiring/check_availability.sl @@ -6,8 +6,8 @@ operation: inputs: - address - action: - python_script: | + python_action: + script: | import random rand = random.randint(0, 2) vacant = rand != 0 diff --git a/code/tutorial_code/tutorials_12/hiring/generate_user_email.sl b/code/tutorial_code/tutorials_12/hiring/generate_user_email.sl index 4d73034..0b0b694 100644 --- a/code/tutorial_code/tutorials_12/hiring/generate_user_email.sl +++ b/code/tutorial_code/tutorials_12/hiring/generate_user_email.sl @@ -13,8 +13,8 @@ operation: private: true - attempt - action: - python_script: | + python_action: + script: | attempt = int(attempt) if attempt == 1: address = first_name[0:1] + '.' + last_name + '@' + domain diff --git a/code/tutorial_code/tutorials_12/hiring/order.sl b/code/tutorial_code/tutorials_12/hiring/order.sl index 117e4e3..911ec88 100644 --- a/code/tutorial_code/tutorials_12/hiring/order.sl +++ b/code/tutorial_code/tutorials_12/hiring/order.sl @@ -7,8 +7,8 @@ operation: - item - price - action: - python_script: | + python_action: + script: | print 'Ordering: ' + item import random rand = random.randint(0, 2) diff --git a/code/tutorial_code/tutorials_13.zip b/code/tutorial_code/tutorials_13.zip index d8a6884..32dafdd 100644 Binary files a/code/tutorial_code/tutorials_13.zip and b/code/tutorial_code/tutorials_13.zip differ diff --git a/code/tutorial_code/tutorials_13/base/print.sl b/code/tutorial_code/tutorials_13/base/print.sl index 6d27056..e8cc0cd 100644 --- a/code/tutorial_code/tutorials_13/base/print.sl +++ b/code/tutorial_code/tutorials_13/base/print.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text \ No newline at end of file + python_action: + script: print text diff --git a/code/tutorial_code/tutorials_13/hiring/check_availability.sl b/code/tutorial_code/tutorials_13/hiring/check_availability.sl index fab6da5..865f3cf 100644 --- a/code/tutorial_code/tutorials_13/hiring/check_availability.sl +++ b/code/tutorial_code/tutorials_13/hiring/check_availability.sl @@ -6,8 +6,8 @@ operation: inputs: - address - action: - python_script: | + python_action: + script: | import random rand = random.randint(0, 2) vacant = rand != 0 diff --git a/code/tutorial_code/tutorials_13/hiring/generate_user_email.sl b/code/tutorial_code/tutorials_13/hiring/generate_user_email.sl index bcb2d7a..d27d1c7 100644 --- a/code/tutorial_code/tutorials_13/hiring/generate_user_email.sl +++ b/code/tutorial_code/tutorials_13/hiring/generate_user_email.sl @@ -13,8 +13,8 @@ operation: private: true - attempt - action: - python_script: | + python_action: + script: | attempt = int(attempt) if attempt == 1: address = first_name[0:1] + '.' + last_name + '@' + domain diff --git a/code/tutorial_code/tutorials_13/hiring/order.sl b/code/tutorial_code/tutorials_13/hiring/order.sl index 3882cd2..69de571 100644 --- a/code/tutorial_code/tutorials_13/hiring/order.sl +++ b/code/tutorial_code/tutorials_13/hiring/order.sl @@ -7,8 +7,8 @@ operation: - item - price - action: - python_script: | + python_action: + script: | print 'Ordering: ' + item import random rand = random.randint(0, 2) diff --git a/code/tutorial_code/tutorials_14.zip b/code/tutorial_code/tutorials_14.zip index 89e645c..c8b23aa 100644 Binary files a/code/tutorial_code/tutorials_14.zip and b/code/tutorial_code/tutorials_14.zip differ diff --git a/code/tutorial_code/tutorials_14/base/print.sl b/code/tutorial_code/tutorials_14/base/print.sl index c22e6de..115d919 100644 --- a/code/tutorial_code/tutorials_14/base/print.sl +++ b/code/tutorial_code/tutorials_14/base/print.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text \ No newline at end of file + python_action: + script: print text diff --git a/code/tutorial_code/tutorials_14/hiring/check_availability.sl b/code/tutorial_code/tutorials_14/hiring/check_availability.sl index 1d6fcb4..d679765 100644 --- a/code/tutorial_code/tutorials_14/hiring/check_availability.sl +++ b/code/tutorial_code/tutorials_14/hiring/check_availability.sl @@ -6,8 +6,8 @@ operation: inputs: - address - action: - python_script: | + python_action: + script: | import random rand = random.randint(0, 2) vacant = rand != 0 diff --git a/code/tutorial_code/tutorials_14/hiring/fancy_text.sl b/code/tutorial_code/tutorials_14/hiring/fancy_text.sl index d5c427b..14781c0 100644 --- a/code/tutorial_code/tutorials_14/hiring/fancy_text.sl +++ b/code/tutorial_code/tutorials_14/hiring/fancy_text.sl @@ -6,8 +6,8 @@ operation: inputs: - text - action: - python_script: | + python_action: + script: | from pyfiglet import Figlet f = Figlet(font='slant') fancy = '
' + f.renderText(text).replace('\n','
').replace(' ', ' ') + '
' diff --git a/code/tutorial_code/tutorials_14/hiring/generate_user_email.sl b/code/tutorial_code/tutorials_14/hiring/generate_user_email.sl index 4d9cce0..eca4778 100644 --- a/code/tutorial_code/tutorials_14/hiring/generate_user_email.sl +++ b/code/tutorial_code/tutorials_14/hiring/generate_user_email.sl @@ -13,8 +13,8 @@ operation: private: true - attempt - action: - python_script: | + python_action: + script: | attempt = int(attempt) if attempt == 1: address = first_name[0:1] + '.' + last_name + '@' + domain diff --git a/code/tutorial_code/tutorials_14/hiring/order.sl b/code/tutorial_code/tutorials_14/hiring/order.sl index 476356c..001ec80 100644 --- a/code/tutorial_code/tutorials_14/hiring/order.sl +++ b/code/tutorial_code/tutorials_14/hiring/order.sl @@ -7,8 +7,8 @@ operation: - item - price - action: - python_script: | + python_action: + script: | print 'Ordering: ' + item import random rand = random.randint(0, 2) diff --git a/code/tutorial_code/tutorials_15.zip b/code/tutorial_code/tutorials_15.zip index d01ff1e..fed6c93 100644 Binary files a/code/tutorial_code/tutorials_15.zip and b/code/tutorial_code/tutorials_15.zip differ diff --git a/code/tutorial_code/tutorials_15/base/print.sl b/code/tutorial_code/tutorials_15/base/print.sl index ff484ed..9d7b1f1 100644 --- a/code/tutorial_code/tutorials_15/base/print.sl +++ b/code/tutorial_code/tutorials_15/base/print.sl @@ -6,5 +6,5 @@ operation: inputs: - text - action: - python_script: print text \ No newline at end of file + python_action: + script: print text diff --git a/code/tutorial_code/tutorials_15/hiring/check_availability.sl b/code/tutorial_code/tutorials_15/hiring/check_availability.sl index 5a3e40a..e1f474f 100644 --- a/code/tutorial_code/tutorials_15/hiring/check_availability.sl +++ b/code/tutorial_code/tutorials_15/hiring/check_availability.sl @@ -6,8 +6,8 @@ operation: inputs: - address - action: - python_script: | + python_action: + script: | import random rand = random.randint(0, 2) vacant = rand != 0 diff --git a/code/tutorial_code/tutorials_15/hiring/fancy_text.sl b/code/tutorial_code/tutorials_15/hiring/fancy_text.sl index 374e80d..ccca142 100644 --- a/code/tutorial_code/tutorials_15/hiring/fancy_text.sl +++ b/code/tutorial_code/tutorials_15/hiring/fancy_text.sl @@ -6,8 +6,8 @@ operation: inputs: - text - action: - python_script: | + python_action: + script: | from pyfiglet import Figlet f = Figlet(font='slant') fancy = '
' + f.renderText(text).replace('\n','
').replace(' ', ' ') + '
' diff --git a/code/tutorial_code/tutorials_15/hiring/generate_user_email.sl b/code/tutorial_code/tutorials_15/hiring/generate_user_email.sl index a31b22e..d25e0b9 100644 --- a/code/tutorial_code/tutorials_15/hiring/generate_user_email.sl +++ b/code/tutorial_code/tutorials_15/hiring/generate_user_email.sl @@ -13,8 +13,8 @@ operation: private: true - attempt - action: - python_script: | + python_action: + script: | attempt = int(attempt) if attempt == 1: address = first_name[0:1] + '.' + last_name + '@' + domain diff --git a/code/tutorial_code/tutorials_15/hiring/order.sl b/code/tutorial_code/tutorials_15/hiring/order.sl index 782c83d..2cd5e11 100644 --- a/code/tutorial_code/tutorials_15/hiring/order.sl +++ b/code/tutorial_code/tutorials_15/hiring/order.sl @@ -7,8 +7,8 @@ operation: - item - price - action: - python_script: | + python_action: + script: | print 'Ordering: ' + item import random rand = random.randint(0, 2) diff --git a/developer_cloudslang.rst b/developer_cloudslang.rst index 3900e78..fe88c2f 100644 --- a/developer_cloudslang.rst +++ b/developer_cloudslang.rst @@ -176,8 +176,8 @@ Code inputs: - text - action: - python_script: print text + python_action: + script: print text results: - SUCCESS diff --git a/hello_world.rst b/hello_world.rst index 53ca3be..55be2fc 100644 --- a/hello_world.rst +++ b/hello_world.rst @@ -66,8 +66,8 @@ Copy the code below into the corresponding files. inputs: - text - action: - python_script: print text + python_action: + script: print text results: - SUCCESS @@ -109,8 +109,8 @@ The :ref:`flow` named ``hello_world`` begins its :ref:`workflow`. The :ref:`workflow` has one :ref:`step` named ``sayHi`` which calls the ``print`` :ref:`operation`. The :ref:`flow` passes the string ``"Hello, World"`` to the ``text`` :ref:`input ` of the ``print`` -:ref:`operation`. The print :ref:`operation` performs its :ref:`action`, which -is a simple Python script that prints the :ref:`input `, and then +:ref:`operation`. The print :ref:`operation` performs its :ref:`python_action`, +which is a simple Python script that prints the :ref:`input `, and then returns a :ref:`result ` of ``SUCCESS``. Since the flow does not contain any more :ref:`steps ` the :ref:`flow` finishes with a :ref:`result ` of ``SUCCESS``. diff --git a/tutorial/02_lesson.rst b/tutorial/02_lesson.rst index 6e33bcd..95536ed 100644 --- a/tutorial/02_lesson.rst +++ b/tutorial/02_lesson.rst @@ -92,15 +92,13 @@ two types of actions in CloudSlang, Python-based actions and Java-based actions. We'll start off by creating a Python action that simply prints the text -that was input. To do so, we add an ``action`` key that maps to the -action contents. Since our action is a python script we add a key:value -pair with ``python_script`` as the key and the script itself as the -value. +that was input. To do so, we add ``python_action`` and ``script`` keys that map +to the action contents. .. code-block:: yaml - action: - python_script: print text + python_action: + script: print text .. note:: @@ -112,7 +110,7 @@ Python scripts that need 3rd party packages may import them using the procedures described in lesson :doc:`14 - 3rd Party Python Packages <14_lesson>`. -For more information, see :ref:`action` in the DSL reference. +For more information, see :ref:`python_action` in the DSL reference. The usage of Java-based actions is beyond the scope of this tutorial. For more information, see the :ref:`java_action` in the DSL reference. @@ -162,5 +160,5 @@ New Code - Complete inputs: - text - action: - python_script: print text + python_action: + script: print text diff --git a/tutorial/04_lesson.rst b/tutorial/04_lesson.rst index a5f2aef..a7d915d 100644 --- a/tutorial/04_lesson.rst +++ b/tutorial/04_lesson.rst @@ -43,8 +43,8 @@ during testing to see that our operation is working as expected. .. code-block:: yaml - action: - python_script: | + python_action: + script: | import random rand = random.randint(0, 2) vacant = rand != 0 @@ -151,8 +151,8 @@ New Code - Complete inputs: - address - action: - python_script: | + python_action: + script: | import random rand = random.randint(0, 2) vacant = rand != 0 diff --git a/tutorial/07_lesson.rst b/tutorial/07_lesson.rst index 63856ac..72cc71c 100644 --- a/tutorial/07_lesson.rst +++ b/tutorial/07_lesson.rst @@ -133,8 +133,8 @@ New Code - Complete inputs: - address - action: - python_script: | + python_action: + script: | import random rand = random.randint(0, 2) vacant = rand != 0 diff --git a/tutorial/08_lesson.rst b/tutorial/08_lesson.rst index 65479ae..2e32193 100644 --- a/tutorial/08_lesson.rst +++ b/tutorial/08_lesson.rst @@ -35,8 +35,8 @@ it as a starting point for a discussion on input properties. - domain - attempt - action: - python_script: | + python_action: + script: | attempt = int(attempt) if attempt == 1: address = first_name[0:1] + '.' + last_name + '@' + domain @@ -357,8 +357,8 @@ New Code - Complete private: true - attempt - action: - python_script: | + python_action: + script: | attempt = int(attempt) if attempt == 1: address = first_name[0:1] + '.' + last_name + '@' + domain diff --git a/tutorial/11_lesson.rst b/tutorial/11_lesson.rst index b2ea6d4..e0bf4ca 100644 --- a/tutorial/11_lesson.rst +++ b/tutorial/11_lesson.rst @@ -39,8 +39,8 @@ output. - item - price - action: - python_script: | + python_action: + script: | print 'Ordering: ' + item import random rand = random.randint(0, 2) @@ -280,8 +280,8 @@ New Code - Complete - item - price - action: - python_script: | + python_action: + script: | print 'Ordering: ' + item import random rand = random.randint(0, 2) diff --git a/tutorial/12_lesson.rst b/tutorial/12_lesson.rst index d0408fe..6098440 100644 --- a/tutorial/12_lesson.rst +++ b/tutorial/12_lesson.rst @@ -85,12 +85,6 @@ content folder or by running ``inspect`` on the flow. When calling the operation, we'll need to pass values for all the arguments listed in the documentation that are not optional. -You might have noticed that operation and flow inputs are generally -named using snake_case. This is in keeping with Python conventions, -especially when using an operation that has a ``python_script`` type -action. The ``send_mail`` operation though, uses a ``java_action`` so -its inputs follow the Java camelCase convention. - Imports ------- diff --git a/tutorial/13_lesson.rst b/tutorial/13_lesson.rst index 895933e..94bb66f 100644 --- a/tutorial/13_lesson.rst +++ b/tutorial/13_lesson.rst @@ -254,8 +254,8 @@ New Code - Complete private: true - attempt - action: - python_script: | + python_action: + script: | attempt = int(attempt) if attempt == 1: address = first_name[0:1] + '.' + last_name + '@' + domain diff --git a/tutorial/14_lesson.rst b/tutorial/14_lesson.rst index 0e90070..11377bc 100644 --- a/tutorial/14_lesson.rst +++ b/tutorial/14_lesson.rst @@ -5,7 +5,7 @@ Goal ---- In this lesson we'll learn how to import 3rd party Python packages to -use in an operation's ``python_script`` action. +use in an operation's ``python_action``. Get Started ----------- @@ -106,8 +106,8 @@ email. inputs: - text - action: - python_script: | + python_action: + script: | from pyfiglet import Figlet f = Figlet(font='slant') fancy = '
' + f.renderText(text).replace('\n','
').replace(' ', ' ') + '
' @@ -301,8 +301,8 @@ New Code - Complete inputs: - text - action: - python_script: | + python_action: + script: | from pyfiglet import Figlet f = Figlet(font='slant') fancy = '
' + f.renderText(text).replace('\n','
').replace(' ', ' ') + '
' diff --git a/yaml_overview.rst b/yaml_overview.rst index 026336a..91c1db5 100644 --- a/yaml_overview.rst +++ b/yaml_overview.rst @@ -187,8 +187,8 @@ Python script** .. code:: yaml - action: - python_script: | + python_action: + script: | if divisor == '0': quotient = 'division by zero error' else: