GetHistory

Returns arrays containing the history of a process unit; the process unit’s dates and times, users, actions, levels, and comments are returned. The arrays have a one-to-one correspondence.

To get a process unit history that includes the names and paths of document attachments, use GetHistory2.

Syntax

<HsvProcessFlow>.GetHistory lScenario, lYear, lPeriod, lEntity, lParent, lValue, pvaradTime, pvarabstrUser, pvarasAction, pvarasNewState, pvarabstrAnnotation

Argument

Description

lScenario

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

If the scenario does not support process management, the 0x4D2 error occurs. This error has a Success severity level, meaning that it is not returned in Visual Basic’s Err object; however, the error is returned in Visual C++.

Tip:

HsvScenarios.SupportsProcessFlow tests whether a scenario supports process management; for details, see SupportsProcessFlow.

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.

pvaradTime

Variant. Returns an array of the process unit’s times and dates. The array is returned as a Double subtype.

The numbers returned in this array are in a standard date format; for example, in Visual Basic you can convert a returned array element by passing it to CDate.

pvarabstrUser

Variant. Returns an array of the usernames that have performed actions for the process unit. The full usernames — the domains and the usernames — are returned.

The array is returned as a String subtype.

pvarasAction

Variant. Returns an array of the process unit’s actions. The valid return values are listed in Process Management Action Constants.

The array is returned as an Integer subtype.

pvarasNewState

Variant. Returns an array of the process unit’s levels. The valid return values are listed in Table 136, CEnumProcessFlowStates Enumeration.

The array is returned as an Integer subtype.

pvarabstrAnnotation

Variant. Returns an array of the process unit’s comments. The array is returned as a String subtype.

Example

The following subroutine tests whether a process unit has been rejected. If it has been rejected, the subroutine then displays the username of the rejector and the comment entered for the rejection. The subroutine takes the member IDs of the process unit’s dimension members. These IDs are passed to GetHistory. The For...Next loop tests the array returned by the pvarasAction argument; if an array element equals PROCESS_FLOW_ACTION_REJECT, then a rejection has occurred, and the corresponding elements of the arrays returned in the pvarabstrUser and pvarabstrAnnotation arguments are displayed.

Sub IsUnitRejected(lScen as Long, lYear as Long, lPer as Long, _ 
lEnt as Long, lPar as Long, lVal as Long)
Dim cHsvProcessFlow As HsvProcessFlow, vaTime, vaUser
Dim vaAction, vaState, vaNote, iSize As Integer
Set cHsvProcessFlow = m_cHsvSession.ProcessFlow
cHsvProcessFlow.GetHistory lScen, lYear, lPer, lEnt, lPar, _ 
  lVal, vaTime, vaUser, vaAction, vaState, vaNote
iSize = UBound(vaAction)
For i = 0 To iSize
  If vaAction(i) = PROCESS_FLOW_ACTION_REJECT Then
    MsgBox "Rejected by: " & vaUser(i) & vbCrLf & _ 
    "Reason: " & vaNote(i)
  End If
Next i
End Sub