Creating your First CLI Action

This use case will help you learn how to create an Action which executes a command that outputs text on a Windows shell. You can use this tutorial also for creating an Action executed on Unix.

Watch the video:

Before you Start...

Make sure that the following conditions are met before you start creating your CLI Action:

   
One online Windows agent is available.
The PCK.ITPA_SHARED pack is installed.

To Create the Echo Hello World Action

  1. Navigate to the Process Assembly perspective.
  2. Select the Action Packs tab.
  3. Create a new Action Pack by clicking the Create Action Pack button in the sidebar.
  4. Name it Hello World.
  5. Click Create Action Pack to finish the creation process.
  6. Click the Add Action button in the toolbar to add an Action to the Action Pack. The Add Action dialog is displayed.
  7. The CLI type is selected by default. Leave it as is.
  8. Fill in the other fields as shown above.

    Note: Categories are listed in the Explorer when editing workflows. They are represented as folders within the AE and can be changed later on.

  9. Click Next to confirm the creation of the Action.
  10. Re-validate you input and click Add.
  11. Either right-click the Action and select Edit or double-click it to switch to the object edit mode. A workflow containing two JOBS objects is displayed. Depending on the OS of the executing Agent (Windows or LINUX) one of them will be executed.

    Note: The actual executed JOBS object (Windows/UNIX) is chosen by the OS of the executing agent during runtime. When you are creating this Action exclusively for one OS, simply leave the other part unchanged. For the purpose of this use case, we will create an Action to be executed on Windows.

  12. Double-click the JOBS@WINDOWS Action (the upper one).
  13. Click the Process tab in the sidebar to add the script for execution: echo "Hello World".
  14. Now you can execute the Action for the first time. To do so, go back to the JOBP and click the Execute button.
  15. An input request is triggered, which is indicated in the upper right corner of your screen (yellow number). Click it to open the request and provide an agent and a login object for the execution.
  16. Click Submit to confirm your input.
  17. Let's now inspect the result of the last execution. To do so, click the Last Monitor button in the toolbar and right-click the JOBS object that was executed.
  18. Select Open Report from the context menu. The Reports window is displayed.
  19. Now it is time to add some input data to this Action. To do so, switch back to the Process Assembly and navigate to Variables & Prompts > Prompt Sets.
  20. Here we can define some input variables (prompts). Right-click the Input prompt set and select Edit. Alternatively, select Edit in new window to edit the script and variables side-by-side.
  21. Add a new prompt by dragging and dropping it to the canvas.
  22. Enter VAR1 as a variable name using the following format &VAR1#.
  23. Click Save to confirm your changes. We will use this variable in our script.
  24. To add it to the script, go back to the script within the JOBS@WINDOWS Action.
  25. Add a script line which references the &VAR1# variable as follows:

    Image displaying script line

  26. Click Save to confirm your changes.
  27. To trigger the final test, go back to the JOBP (workflow) and click the Execute button.
  28. Another input request is triggered. Click on the yellow button to open it and provide an agent and a login object for the execution.
  29. Click Submit.
  30. Validate the result just as before. Open the Last Monitor and check the report.

Congratulations! You have just created your first CLI Action.

Additional Notes

See also: