Workflow Activity
- Last UpdatedDec 18, 2023
- 7 minute read
Activity Description:
In AVEVA Work Tasks, a workflow can be called from another workflow provided both workflows belong to the same repository. In this case, the calling workflow is termed as Parent Workflow and the workflow to be called is termed as Child Workflow.
The Workflow activity enables the execution of a second (child) workflow from a (parent) workflow. The Workflow activity can be used to call a child workflow from a parent workflow. The Variables for the child workflow property and XMLVariables for the child workflow property enable parent workflow to pass variable and XML variable information to the child workflow respectively.
Activity Properties:
You can configure the Workflow 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 Workflow 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
The properties in the Name & Description group have been described below. 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
The properties in the Configuration group have been described below. You can use these properties to configure the functionality of the activity.
Repository - This property specifies the application or repository name that has the workflow to be run. The child workflow should belong to the same repository of the parent workflow. The repository property of a child workflow is exposed for backward compatibility.
Property Type: Mandatory (This property must be set if the activity is to be executed.)
Workflow - This property specifies the workflow to execute. This is an editable combo, which drops down a list with the names of all available workflows for the specified application. You can select one of the workflows as the child workflow. Alternatively, you can enter a name in the field to create a new child workflow. Now when, you right-click the workflow activity icon and select the "Open Sub Process" option, a new Process Designer window will be opened with the Application name and Workflow name specified here. You can create the new sub-process in this window.
Property Type: Mandatory (This property must be set if the activity is to be executed.)
Version - This property specifies the version only if any specific version of the (child) workflow to be executed. Leave this as blank, if the latest published version of (child) workflow has to be executed.
Property Type: Optional (This property needs to be set only if required.)
Variables for ChildWorkflow - This property specifies the variables to be passed on to the workflow. This window shows the list of variables defined for the current (parent) workflow. Select the variables that need to be passed to the child workflow.
Property Type: Optional (This property needs to be set only if required.)
Steps to set the Variables for ChildWorkflow property
-
To specify the variables to be passed to the child workflow, click the button for the Variables for ChildWorkflow property to open the property window.
-
In the Variables for ChildWorkflow window, select the required variables to be passed to the child workflow.

-
After specifying the data click the Update button.
Note: These variables are expected to exist in the child workflow. Make sure to define variables with same name and type as defined in parent workflow.
See Workflow - Variables for ChildWorkflow for a detailed description of the Variables for ChildWorkflow property window.
XMLVariables for ChildWorkflow - This property specifies the XML variables to be passed on to the child workflow. This window shows the list of XML variables defined for the current (parent) workflow. Select the XML variables that need to be passed to the child workflow.
Property Type: Optional (This property needs to be set only if required.)
Steps to set the XMLVariables for ChildWorkflow property:
-
To specify the XML variables to be passed to the child workflow, click the button for the 'XMLVariables for ChildWorkflow' property to open the property window.
-
In the XMLVariables for ChildWorkflow window, choose the required variables to be passed to the child workflow.
-
Click the Update button.
Note:
- These XML variables are expected to exist in the child workflow. Make sure to define
XML variables with same name and type as defined in parent workflow.
- To work with any XML variables or resource activities, SKEventData XML variables
must be passed in the child workflow, where SKEventData contains some events information
related to parent workflow which needs to be passed to child workflow. If SKEventData
variable is not created, user can create XML variable of type XMLDocument with the
same name 'SKEventData' by locating the 'SKEventData.xml' from the following path:[AVEVA Work Tasks Installed Path]\AVEVA\Work Tasks\Web\BPMUITemplates\Default\XMLSchemas
Example:
The following image shows that XMLVariables named SPEventData and LeaveApplication need to be passed to the child workflow. In this case, the child workflow is expected to have SPEventData and LeaveApplication XML variables defined.

See Workflow - Workflow - XmlVariables for ChildWorkflow for a detailed description of the XMLVariables for ChildWorkflow property window.
Output Values
The property in the Output Values has been described below. You can use this property to specify the output values of the activity.
Return Values - This property can be used to add all the possible output values from the child workflow, for conditional routing. The child workflow should set a value to the 'ParentWorkflowOutput' variable. This variable will hold the output value from the child workflow. The value of the 'Wait for the child workflow?' property should be set to 'Yes'.
Property Type: Mandatory (This property must be set if the activity is to be executed.)
Steps to set the Return Values property
-
To specify the Return Values, click the button for the 'Return Values' property to open the property window.
-
In this window, enter the return value in the Return Values field.
-
After entering the return value details, click Add Row to add this return value and display a new row for entering another return value.
-
Remove rows if necessary by selecting them and clicking Remove Selected.
-
After specifying all the return values, click Update.
See Workflow - Return Values for a detailed description of the Return Values property window.
Activity outputs:
The Workflow Activity does not have any standard return value. It will output the value specified by the user in the Return Values property.
Example for a Workflow Activity:
Configuring Parent Workflow to wait till Child Workflow Completes Execution
Steps to be followed for Parent Workflow configuration:
-
Set Wait for the child workflow property as Yes to wait for the child workflow to complete the execution.
-
Use Return Value property to set the routing condition after completion of child workflow. Example: ChildWfCompleted.

This will dynamically create a link output named 'ChildWfCompleted' for the activity. Once the child workflow complete its execution, it returns back to the parent workflow with the return value specified in the child workflow (In this case, child workflow should return 'ChildWfCompleted' value) and then it will continue with further execution.
Steps to be followed for Child Workflow configuration:
-
Right-click the workflow activity to open child workflow using the context menu item Open Sub Process.

-
Declare a variable named 'ParentWorkflowOutput' of type string in the child workflow Start action.
-
Use Update Variable action to set the variable 'ParentWorkflowOutput' value as 'ChildWfCompleted' (This value should be same as the value for the Return Values property in parent workflow action properties).
-
The Update variable action to update the parent workflow output should be placed after the logical conclusion of child workflow.

After configuring child workflow, follow the steps given below:
-
Go back to the parent and set routing condition based on the output 'ChildWfCompleted'
-
Parent workflow goes to sleep mode after the child is executed.
-
Child completes execution with Update Variable as the last action.
-
Once the child completes execution, the value set in Update variable is given as output for the workflow action in parent.
-
Note: If the child workflow needs to update any of the parent workflow variables, it is a must for Parent workflow to wait for the child workflow to complete.