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.
<HsvProcessFlow>.GetHistory lScenario, lYear, lPeriod, lEntity, lParent, lValue, pvaradTime, pvarabstrUser, pvarasAction, pvarasNewState, pvarabstrAnnotation
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++. HsvScenarios.SupportsProcessFlow tests whether a scenario supports process management; for details, see SupportsProcessFlow. | |
Long (ByVal). The member ID of the process unit's Year dimension member. | |
Long (ByVal). The member ID of the process unit's Period dimension member. | |
Long (ByVal). The member ID of the process unit's child Entity dimension member. | |
Long (ByVal). The member ID of the process unit's parent Entity dimension member. | |
Long (ByVal). The member ID of the process unit's Value dimension member. | |
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. | |
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. | |
Variant. Returns an array of the process unit’s actions. The valid return values are listed in Process Management Action Constants. | |
Variant. Returns an array of the process unit’s levels. The valid return values are listed in Table 136, CEnumProcessFlowStates Enumeration. | |
Variant. Returns an array of the process unit’s comments. The array is returned as a String subtype. |
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