Transformation Options 2022.1.x
  • 14 May 2024
  • Dark
    Light
  • PDF

Transformation Options 2022.1.x

  • Dark
    Light
  • PDF

Article summary

This article covers the options available when working with JSON Schema Transformations (JSTs) in the Gen 1 and Gen 2 workflow canvases of Itential Automation Platform (IAP). The steps involved in selecting JST options for the Gen 1 canvas are discussed first, followed by the options that are available in the Gen 2 canvas.

Create Workflow

From the IAP home page:

  1. Select Automation Studio from the left navbar. The application screen displays.

  2. Click + Create a Workflow from the Quick Start card. The Create dialog opens.

    Figure 1: Automation Studio

    01-21.2-jst-options

  3. Workflow is pre-selected from the dropdown list. Enter a name (required) for the workflow.

  4. Select the appropriate IAP canvas (Gen 1 or Gen 2) and then click Create. The workflow canvas displays.

    Figure 2: Create Workflow

    02-21.2-create-workflow


GEN 1 Workflow

To add a JST in the Gen 1 Workflow canvas:

  1. In the Search bar (top-right corner), type JST to locate the transformation task.

  2. Click the plus (+) sign to the left of the task. This will add a new JST task labeled JSON Transformation to the Gen 1 canvas.

    Figure 3: Add JST Task (Gen 1)

    03-21.2-add-jst-Gen1

  3. Connect the JST task to the Start and End tasks. Transformation tasks can be connected to any two tasks that require you to transform data due to different data formatting requirements​. You can also hover over the JST task to display the tooltip.

    Figure 4: Connect JST Task (Gen 1)

    04-21.2-jst-tooltip-Gen1

  4. Double-click the JSON Transformation task, and then edit the incoming variables.

  5. Select the appropriate options (see table below) you would like to use prior to running your transformation.

    Option (Gen 1) Description
    Mask Incoming Schema This option is available on all tasks. It encrypts incoming variables and displays them as asterisks in Jobs (formerly Job Manager).
    Mask Outgoing Schema This option is available on all tasks. It encrypts outgoing variables and displays them as asterisks in Job Manager.
    Extract Output This option only applies if you have a single outgoing schema. It removes the wrapper object from the output and returns only the value of that property.
    Validate Incoming Validates your input. Checks if the input is the correct type and compatible with any keywords set in that incoming schema (i.e., enum or const).
    Revert To Default Value Enables use of a default keyword.
    • Default values from the incoming schemas will be used whenever a key/incoming data value is not provided.
    • If an outgoing schema has a default value, an incoming schema is assigned to it.
    • If the incoming schema does not have a default defined, then the default for the outgoing schema will be used.
    • If an outgoing schema has a default value defined, and nothing is assigned to it, then the default values will be in the transformation output.
  6. Click Save and you will return to the Gen 1 Workflow canvas.

  7. Click the Start button (top-right) to run the transformation.

    Figure 5: Run JST (Gen 1)

06-21.2-start-jst-Gen1

 

GEN 2 Workflow

Gen 2 workflows provide two methods for working with JSTs:

  • The Transformation workflow task, which is used in the same manner as other workflow tasks.
  • The JST on Transition feature, which attaches a JST directly to a transition between two tasks in a workflow.

Both methods for working with JSTs are described in this section.

Using the Transformation Task

To add a JST in the Gen 2 Workflow canvas by using the transformation task:

  1. Select Gen 2 in the dialog and click Create. A relatively blank Gen 2 canvas then displays that contains a Start and End task.

    Figure 6: Create Workflow (Gen 2)

    07-21.2-Gen2-workflow

  2. When a Gen 2 workflow is first created, a New Node box is already provided. This is an empty node and needs to be populated with an actual task item.

  3. Click the New Node box on the Gen 2 canvas.

  4. Go to the Task Menu Sidebar on the right side of the screen. This area contains a list of nodes and tasks that can be used in the Gen 2 workflow.

  5. In the Search bar at the top, type JST to locate the transformation task.

  6. Click the transformation task and observe that the "New Node" on the canvas has been replaced with the transformation task. Also notice that the Task Menu Sidebar is now replaced with details and configuration options for the transformation task.

  7. Click Save to retain changes to the Gen 2 Workflow.

    Figure 7: Save Workflow (Gen 2)

    08-21.2-Gen2-save-workflow

  8. Click the transformation node to set your input and select options.

  9. On the Details tab, you can select the Mask Incoming Schema or Mask Outgoing Schema option.

  10. Click the Options Tab to select Validate Incoming or revertToDefaultValue or Extract Output, as required. Details for all JST options in Gen 2 workflows are referenced in the table below.

Options (Gen 2) Description
Mask Incoming Schema This option is available on all tasks. It encrypts incoming variables and displays them as asterisks in Jobs (formerly Job Manager).
Mask Outgoing Schema This option is available on all tasks. It encrypts outgoing variables and displays them as asterisks in Jobs.
Extract Output This option only applies if you have a single outgoing schema. It removes the wrapper object from the output and returns only the value of that property.
Validate Incoming Validates your input. Checks if the input is the correct type and compatible with any keywords set in that incoming schema (i.e., enum or const).
Revert To Default Value Enables use of a default keyword.
  • Default values from the incoming schemas will be used whenever a key/incoming data value is not provided.
  • If an outgoing schema has a default value, an incoming schema is assigned to it.
  • If the incoming schema does not have a default defined, then the default for the outgoing schema will be used.
  • If an outgoing schema has a default value defined, and nothing is assigned to it, then the default values will be in the transformation output.
  1. Click the Save icon (floppy disk) to retain your JST options.

  2. Click the Start button to run the workflow.

    Figure 8: Icons to Save and Run (Gen 2)

11-21.2-Gen2-save-run

 

Using the JST on Transition Feature

Using the JST on Transition feature allows you to utilize a JST in your Gen 2 workflow without having to use a separate task. Instead, a JST is attached to a transition between two tasks, allowing data to be seamlessly transformed as it flows between them.

To add a JST to a transition from the Gen 2 workflow builder:

  1. Hover your cursor above the desired transition to reveal a circular menu button (three stacked dots). Click the menu button.

  2. Select Add JST from the transition context menu that appears (Figure 9) to open the JSON Schema Transformation window.

    Figure 9: Add JST to a Transition

    gen2Canvas_addJst_22.1

  3. Use the JSON Schema Transformation window to construct a JST in the same manner that you would when using JST Designer.

  4. Click the Save button located at the bottom-left corner of the JSON Schema Transformation window (Figure 10) to apply your JST to the transition.

    Figure 10: JSON Schema Transformation Window

    gen2Canvas_editJst_22.1

When creating a new JST via the Add JST button, the Incoming Schemas and Outgoing Schemas of the JST will be automatically populated based on the workflow tasks connected to the transition. For more information on authoring JSTs, refer to the JST Designer documentation page.

Once a JST has been added to a transition, the button to access the context menu of that transition changes to a diamond shape. The context menu itself contains several new options when a JST is present (Figure 11):

  • Edit JST and Delete JST are used to edit or delete the JST attached to the transition, respectively.
  • Insert Node Before JST and Insert Node After JST insert a new node into the workflow before or after the JST-enabled transition, respectively.

Figure 11: JST Transition Context Menu

gen2Canvas_jstTransitionContext_22.1


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.