Start

Starts a process unit

To attach documents when starting, use Start2. To start multiple process units, use StartEx or Start2.

Syntax

<HsvProcessFlow>.Start lScenario, lYear, lPeriod, lEntity, lParent, lValue, vbUseAllValueMembers, bstrAnnotation, psNewProcessState

Argument

Description

lScenario

Long (ByVal). The member ID of the process unit's Scenario dimension member.

lYear

Long (ByVal). The member ID of the process unit's Year dimension member.

lPeriod

Long (ByVal). The member ID of the process unit's Period dimension member.

lEntity

Long (ByVal). The member ID of the process unit's child Entity dimension member.

lParent

Long (ByVal). The member ID of the process unit's parent Entity dimension member.

lValue

Long (ByVal). The member ID of the process unit's Value dimension member.

vbUseAllValueMembers

Boolean (ByVal). Determines whether process units for Value dimension members related to the lValue member are to be started. Pass TRUE to start related process units, FALSE to start only the process unit for the lValue member.

bstrAnnotation

String (ByVal). The comment for the process unit.

psNewProcessState

Integer. Returns PROCESS_FLOW_STATE_FIRST_PASS, which is the level constant for the First Pass level.

Example

This example creates a function that takes a process unit’s member IDs and comment string, and calls Start if certain conditions are met. The function tests for the following conditions:

If all of these conditions are met, Start is called and the function — named StartWorkflow — returns a blank String. If a condition is not met, StartWorkflow returns a String describing the unmet condition.

Function StartWorkflow(lScen As Long, lYear As Long, _ 
lPer As Long, lEnt As Long, lPar As Long, lVal As Long, _ 
sNote As String) As String
Dim cProcessFlow As HsvProcessFlow, lRights As Long
Dim iState As Integer, iNewState As Integer, bEnabled As Boolean
Dim cDataSec As IHsvDataSecurity, cScenario As HsvScenarios
Set cDataSec = m_cSession.Security
Set cProcessFlow = m_cSession.ProcessFlow
Set cScenario = m_cMetadata.Scenarios
cScenario.SupportsProcessFlow lScen, bEnabled
If bEnabled = True Then
  cDataSec.GetProcessUnitAccessRightsAndState lScen, _ 
  lYear, lPer, lEnt, lPar, lVal, lRights, iState
  If lRights = HFM_ACCESS_RIGHTS_ALL Then
    If iState = 1 Then
      cProcessFlow.Start lScen, lYear, lPer, lEnt, lPar, _ 
      lVal, False, sNote, iNewState
      StartWorkflow = ""
    Else
      StartWorkflow = "Invalid state; state must be Not Started"
    End If
  Else
    StartWorkflow = "User does not have All access rights"
  End If
Else
  StartWorkflow = "Scenario not enabled for process management"
End If
End Function