StartWorkflow

You can use this function for Optiva Workflows.

Purpose

Launch a workflow from within another workflow. The StartWorkflow function saves all data from the first action set before launching a new action set.

StartWorkflow does not allow input parameters to be changed by the user. This function creates a pending task for a wizard, but does not launch the wizard for the user to see.

To launch a wizard workflow from another script, use LaunchWorkflow. See LaunchWorkflow.

Syntax


StartWorkflow(ActionSetCode [,Symbol, Object] [,StartDate] [,InputParameter1, InputParameter2,...])

Arguments

Part Description
ActionSetCode Code for the workflow action set.
Symbol Optional. The workflow runs automatically on the current symbol.

You can also use empty quotation marks to indicate the current symbol or enter the symbol name.

Object Optional. The workflow runs automatically on the current object.

You can also use empty quotation marks to indicate the current object or enter the object code.

StartDate Optional. The start date for the workflow. Must be a Date/Time type. If you pass in a start date, then the workflow starts; the durations for the action set step are used to calculate the due dates of the steps in the Pending Tasks form. The due dates include durations of both the current step and any associated prior steps.
Input Parameters Optional. List the input parameter arguments in the same sequence as they are in the Input tab of the Action Set form. Input Array variables can be used.

Use the WipParamGet function in the Workflow Action Event of the StartWorkflow to retrieve the values.

StartWorkflow is a silent launch.

See LaunchWorkflow for prompted inputs.

Examples

This example launches the ITEM_APPROVAL workflow from within the FORMULA_APPROVAL workflow. The input parameter is the user who started the workflow.


'Iterate on items.
'Check status of each item. If status values is below a specified value, 
'start workflow to approve the item.
startWorkflow("ITEM_APPROVAL", "ITEM", "00031", Context._STARTUSER)

The next example retrieves the start date of the current project and turns it into a Date/Time type. The due date is calculated for each step of the SHIP_APPROVAL in the Pending Tasks form. To do this, it adds the step duration values from the Action Set form, plus the start date value from this workflow.


Dim startDate as DateTime
startDate = Ctype (ObjProperty("EFF_START_DATE"), DateTime)
startWorkflow("SHIP_APPROVAL", "PROJECT", "00031", startDate)

This example launches an Action Set.


Dim Startdate As Date = Now()
startWorkflow("INPUT PARAM SEQUENCE", "FORMULA", _OBJECTKEY, StartDate, "abc1", "abc2", "abc3")

The name of the workflow is INPUT PARAM SEQUENCE. The action set is comprised of three input codes: PARAM1, PARAM2, PARAM3. The parameter values are abc1, abc2, and abc3. These values are displayed in the Input tab of the Workflows in Progress form. The parameter values can also be defined as variables and inserted in place of abc1, abc2, and abc3.)

Use WipParamGet to retrieve the values for use in the Input Param Sequence workflow.