Action Best Practices
This page includes the following:
When creating a new custom Pack, the following naming convention should be followed:
- PCK.CUSTOM_<TECHNOLOGY>
To create a new Action within this Pack , the following naming convention should be used:
- PCK.CUSTOM_<TECHNOLOGY>.PUB.<ACTION_NAME>
Custom Packs should be stored in the Packs folder, at the same level as the out-of-the-box Packs.
Structurally, a Pack consists of all of the following:
- An Action workflow
- A set of sub-tasks for the actual execution
- Optional: at least one prompt set for input parameters
Actions are parameterized input/output variables in prompts within the action workflows. This means that they can be created to be used in any environment and for any deployment that may use this action.
All custom Actions should be created under the same Pack which will hold the specific technology defined. If another set of actions belongs to a new technology, a new Pack must be created to store these new Actions.
Documentation for the custom action must be provided at the time of creation. This must include as much information as possible to better explain how to use the Action.
The documentation provided for the action should include short description to make clear what the Action is meant to be used for.
Shared Objects, Actions and Components
Often several Actions within an Action Pack use the same objects. Similarly, several Component Workflows may use the same Actions.
To speed up development, improve consistency and implement deployment best practices, you can create "shared" objects and composite Actions to be used across different Applications. See: Working with Actions.
These are likely to be:
- Include objects for common code such as command preparation, execution and result evaluation.
- PromptSet objects for common input parameters.
- Variable objects for lookup values, often referenced by PromptSet objects.
- Actions performing common tasks that may be used in several Component Workflows.
Tip: Save these objects/Actions in a common folder:
- A SHARED folder for any objects that are used by multiple Actions and a sub-folder for each object type (typically Includes and PromptSets).
- A PCK.CUSTOM_SHARED_TECHNOLOGY folder under PACKAGES for composite Actions used by multiple Component Workflows with their related objects.
Watch the video to learn how to share the deployment logic between Applications by using a composite Action:
After each critical UNIX/Linux command, use the following include statement to retrieve the return code and exit/block accordingly:
-
UNIX
:INCLUDE PCK.ITPA_SHARED.PRV.INCLUDE.CHECK_SHELL_CMD@UNIX
-
Windows
:INCLUDE PCK.ITPA_SHARED.PRV.INCLUDE.CHECK_POWERSHELL_CMD@WINDOWS
or
:INCLUDE PCK.ITPA_SHARED.PRV.INCLUDE.CHECK_CMDLINE_CMD@WINDOWS