Workflow Control – Trigger Workflow


Caution
Test the script(s), processes and/or data file(s) thoroughly in a test environment, and customize them to meet the requirements of your organization before attempting to use it in a production capacity.  (See the legal notice here)

 

Note: The workflow sample mentioned in this article can be downloaded from the Opalis project on CodePlex:  http://opalis.codeplex.com

 

Overview

The Trigger Workflow Activity is used to start other Workflows. This allows for creating chained Workflow sequences. It also enables nesting of Workflows (see the Nested Workflows examples).

1. Parent Workflow

image

This Workflow uses the Trigger Workflow Activity to start the Workflow named ‘2. Child Workflow: Create File’. Once triggered, the Workflow continues to the next Workflow Activity as the ‘Wait for completion’ option is not set:

image

The next Trigger Workflow Activity starts the Workflow named ‘3. Child Workflow: Run Program’ and waits for it to complete until the Workflow continues. This is because the ‘Wait for completion’ option is set:

image

The Delete File Activity deletes the file that is created by the Workflow named ‘2. Child Workflow: Create File’:

image

2. Child Workflow: Create File

image

This Workflow uses an Append Line Activity to create a sample text file:

image

The sample text file is deleted in the last step of the Workflow named ‘1. Parent Workflow’.

3. Child Workflow: Run Program

image

This Workflow uses a Run Program Activity to launch ‘Notepad’:

image

The program is launched as a background process which is the default behavior:

image

This Workflow will not complete until the ‘notepad.exe’ process ends. In this example the Windows Task Manager will be used to end the ‘notepad.exe’ process.

Running the example Workflows

  • Launch the Workflow named ‘1. Parent Workflow’ by using Start or by running it using the Operator Console.
  • The Workflow named ‘2. Child Workflow: Create File’ will start and end.
  • Next, the Workflow named ‘3. Child Workflow: Run Program’ will start:

image

  • 1. Parent Workflow’ will stay running until ‘3. Child Workflow: Run Program’ completes.
  • Use the Windows Task Manager to end the ‘notepad.exe’ process:

image

  • 3. Child Workflow: Run Program’ completes.
  • 1. Parent Workflow’ will continue and delete the sample text file before it ends.

Check the Opalis Designer log history or Testing Console log as well as the C: drive to see the results of this Workflow.

Launch the Workflow named ‘3. Rest Demo’ to perform cleanup.

 

More Information

Refer to the Trigger Policy Activity Online Help.

 


Share this post :

Comments (0)

Skip to main content