ExecuteWorkflowEvent

You can use the function for Optiva Workflows.

Purpose

Processes an event for a workflow-in-progress.

Syntax


Dim variable As Object = ExecuteWorkflowEvent(WIP_ID, WIPLine_ID, Event)

Arguments

Part Description
WIP_ID Numeric. WIP ID of the started workflow from the Pending Tasks form.
WIPLine_ID Numeric. Line ID for the action step in the Workflow-in-Progress form that has the Queue Status of 1=In Process Queue.
Event Name of the event to execute. Some examples of events are Approve, Reject, and Complete. Events should not require user input.

Description

This script is the equivalent of manually processing an event for an action step.

Examples

This workflow exercises the CANCEL event for line 2 of WIP ID 3327. The WIP ID can be displayed in the Workflow in Progress form.

The user running the workflow enters the WIP_ID and WIPLINE_ID values as input parameters to the workflow.


Function wf_start() As Long 
Workflow.ExecuteWorkflowEvent(3327, 2, "CANCEL") 
RETURN 111 
End Function 

The WIP_ID and WIPLINE_ID values can be retrieved by ObjProperty on a pending workflow. The status of the workflow is in process.


Function wf_start() As Long 
Dim sWipId As String = CStr(Workflow.Context._WIPID)
Dim sLineId As String = CStr(Workflow.Context._WIPLINEID)
Workflow.ExecuteWorkflowEvent(sWipId, sLineId, "CANCEL") 
RETURN 111 
End Function