Changing elements in a workflow

In this recipe, we will have a closer look at the challenges that change the workflow elements in a schema pose. Changing the in- and out-parameters, as well as moving or renaming actions will be discussed. You will learn how to make these changes as well as what to avoid.

Getting ready

We need a workflow that has an additional workflow as well as an action in its schema.

You can use the 04.01.02 MainWorkFlow and 04.01.01 SubWorkflow example workflows as well as the reNameMe action, which is part of the example package.

How to do it...

There are only two major tasks: changing the parameters and renaming/moving the actions.

Changing the parameters of workflows and actions

If you change a subworkflow's in/out-parameters, you will need to synchronize its parameters by following these steps:

  1. Make sure that you have a workflow that has a workflow as an element in its schema. You can use the 04.01.02 MainWorkFlow and 04.01.01 SubWorkflow example workflows.
  2. In the subworkflow, change the name of an out-parameter and add another in-parameter. Then save and exit the subworkflow as a new version (making it easier to repeat the lesson).
  3. In the main workflow, go to the schema and edit the subworkflow element.
  4. Click on Info and then on Synchronize parameters.
  5. Now, check the in- and out-parameters of the element. You will find a second in-parameter and that the out-parameter isn't bound anymore:

    Changing the parameters of workflows and actions

The same method also works for actions. Try the following:

  • Renaming the subworkflow
  • Moving the subworkflow to another folder

Renaming and moving actions

Actions are tied into a workflow using their module name and the action name. So, if an action is moved to a different module or renamed, you will have to do the following:

  1. Make sure that you have a workflow that calls an action either as a scripting task or schema element. You can use the 04.01.02 MainWorkFlow example workflow and the reNameMe action.
  2. Change the name of the action or move it to another module.
  3. In the main workflow, go to the schema and edit the action element.
  4. You will see that you can't change the scripting that points to the action, so the only thing you can do is delete the action element and insert it again:

    Renaming and moving actions

  5. If you called the action in a Scriptable task, you can change the name or module.

Therefore it's important to know which element is used where. See the next section on how to do that.

Finding related elements

We will now see how we can find out what action is used by what other elements:

  1. Go to the actions and into the com.packtpub.Orchestartor-cookbook2ndEdition.helpers module.
  2. Now right-click on the getNow action and select Find elements that use this element from the menu.
  3. A new window will pop up displaying all the Orchestrator elements that use this action.

    Finding related elements

This also works for Resource and Configuration elements.

How it works...

Workflows are tied in with each other via their ID (which can't be changed and is unique) and not their name. So, renaming or moving a workflow has no impact.

If you add or remove an in/out-parameter from a workflow or action, you can simply synchronize the parameter. When you change the name of an in/out-parameter in a workflow or action and then synchronize, you will have to redefine the binding of that parameter.

An action is always called in the following way:

System.getModule([module name]).[action name]([in-parameter],) 

When you move or rename an action, you will need to adjust this call by either changing the module name (move) or the action name (rename).

If you rename a configuration element or parameter, you will have to bind it again in the workflow. The setting will point to the old configuration element that doesn't exist anymore.

See also

The example workflows 04.01.02 MainWorkFlow and 04.01.01 SubWorkflow as well as the reNameMe action.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset