Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

Set Workflow Output Variable

  • Last UpdatedJun 26, 2024
  • 4 minute read

Activity Description

The Set Workflow output variable activity can be used to set the output of the parent workflow from the child workflow. You can use Set Workflow output variable of Quickflow to update a Workflow only when both the parent and child are of the same type (either Workflow or Quickflow).

Activity Properties

You can configure the Set Workflow output variable activity by specifying appropriate values in the Activity Properties area. To access the Activity Properties, click the Activity Properties menu in the Tool Bar. Or, right-click the Set Workflow output variable activity and select the Activity Properties option. The Activity properties are organized under groups of related properties. The properties under each group are described in this topic.

Name & Description

You can use these properties to specify the name and description for the activity.

Name - This property can be used to specify a name for the activity.

Property Type: Optional (This property needs to be set only if necessary.)

Description - This property specifies a brief description to be displayed for the activity.

Property Type: Optional (This property needs to be set only if necessary.)

Configuration

You can use this property to configure the functionality of the activity.

Set Workflow Output - This property specifies the output of the workflow. You can specify the output value directly here or click the icon to open the Expression Builder and build an expression for the output.

Property Type: Mandatory (This property must be set if the activity is to be executed.)

Example for setting Workflow Output Variable

  1. Design a Quickflow as shown in the below figure and name it as ChildQF.

  2. Perform the following actions:

    1. In the Start Activity, declare two variables Value and ParentWorkflowOutput as String.

    Note: The user must declare a same variable name in the child workflow which was declared for the Parent workflow. In the above example, user must declare by the name "ParentWorkflowOutput" of type "String" in the child workflow.

    1. In the Set Variable property of Update Variable set the value of variable Value as 1 as shown in the figure.

    2. On the link connecting Update Variable and Rule activity set the output as Updated.

    3. In the Configuration property of Rule, set the condition [Variable.Value]>["5"] as shown in the below figure.

    4. On the link connecting Rule and Set Workflow output variable2 Activity set TRUE.

    5. In the Set Workflow Output property of Set Workflow output variable2 Activity set it as Greater.

    6. On the link connecting Rule and Set Workflow output variable1 Activity set FALSE.

    7. In the Set Workflow Output property of Set Workflow output variable1 Activity set it as Lesser.

  3. Design a Quickflow as shown in the below figure and name it as ParentQuickflow.

  4. Perform the following actions:

    1. In the Repository property of Workflow Activity, enter Repository Name. For Example: SamRep.

    2. In the Workflow property of Workflow Activity, select Previously created Workflow Name. For Example: ChildQuickflow.

    3. In the Wait for the Child Workflow property, select "YES".

    4. In the Execution Mode property, select "Asynchronous".

    5. In the Return Values property of Workflow Activity:

      • Click Add Row and enter as "Greater"

      • Click Add Row and enter as "Lesser"

      • Click Update to save and click Close to close the window.

    6. In the property LogType of Logger1, select Information.

    7. In the Log Message of Logger1, enter as the following:

      '################ Lesser'

    8. In the link connecting Logger1 and Workflow Activity1 set Lesser as output.

    9. In the property LogType of Logger2, select Information.

    10. In the Log Message of Logger2, enter as the following:

      '################ Greater'

    11. In the link connecting Logger2 and Workflow Activity1, set Greater as output.

Summary: When you publish the parent workflow, the child workflow is also triggered and the path selected after the Rule activity is stored in the variable "ParentWorklfowOutput". The output of child workflow can be traced in the parent workflow.

Output: The ParentQF is published, and the workflow1 Activity invokes the ChildQF. Value of the variable Value is set to 1 in Update Variable Activity.

Since the value of Variable value is less then five, the rule activity output is False. So the Set Workflow Output Variable2 is executed and the control is passed to the ParentQF. The value updated in Parent Workflow variable is Lesser and hence the output of the Workflow Activity is Lesser and the Logger1 is executed.

Start Activity in BAM

Parent Quickflow in BAM:

Child Quickflow in BAM

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in