Adding a New Action and Code - Kaholo

Adding a New Action and Code

Overview

This tutorial will introduce you to Kaholo’s Code Environment. The code layer enables developers to add dynamic capabilities to the pipeline/workflows.

 

Kaholo features a full SDK that can retrieve all execution context and use it to manage and add conditions to the workflow.

 

This tutorial provides a basic introduction to enable you to start using the CODE. For additional information, please read the SDK page.

This tutorial is also a continuation of the Adding a New Process to the Hello World Pipeline tutorial. You will learn how to add a new action using the execute command and implementing the function in the code environment.

1. Ensure that the Hello Code plugin is selected and click on the Actions drop-down menu to add an action. Click the Add action button to open the Actions section.

2. In the Name field, enter the action name and in the Method field, click the drop-down arrow and select execute command. This will enable more options below the selected action.
Then select the command checkbox and specify the desired function. In this example, enter helloCode() in the text field.

        1. Important Note: Always check the checkbox first. It clears the field next to it!

3. Navigate to the Code tab.

4. Implement the javascript function in the code environment. To do this, follow the steps below:

        1. In the first line, enter function HelloCode (){
        2. In the second line, enter return ”echo Hello Code”;
        3. In the third line, enter }

The return value from the code will be executed by the command line. It is very important to note that when using the code environment, always be mindful of how the function/action is written. It is case and spelling sensitive, any deviation of what was added in the Action field will result in an error.

Close Menu