GetHistory

Returns arrays that represent the timestamps, usernames, action types, review levels, and comments for the process management actions of the specified process unit.

To get a process unit history that includes document attachments, use GetHistory2.

Syntax

<HFMwManageProcess>.GetHistory bstrScenario, bstrYear, bstrPeriod, bstrEntity, bstrParent, bstrValue, pvaradTime, pvarabstrUser, pvarasAction, pvarasNewState, pvarabstrComment

Argument

Description

bstrScenario

The label of the process unit's Scenario dimension member.

Input argument. String subtype.

bstrYear

The label of the process unit's Year dimension member.

Input argument. String subtype.

bstrPeriod

The label of the process unit's Period dimension member.

Input argument. String subtype.

bstrEntity

The label of the process unit's Entity dimension member.

Input argument. String subtype.

bstrParent

The label of the parent of the entity specified in the bstrEntity argument.

Input argument. String subtype.

bstrValue

The label of the process unit's Value dimension member.

Input argument. String subtype.

pvaradTime

Returns an array of the timestamps for the process management actions.

Note:

Array items are in a Double format. To render user-readable dates and times, you must perform conversions. For example, in VBScript, passing an array item to CDate returns a user-readable date and time.

The input value of the argument is ignored.

Input/output argument.

pvarabstrUser

Returns an array containing the usernames for the process management actions.

The input value of the argument is ignored.

Input/output argument.

pvarasAction

Returns an array of the action types of the process management actions. The return values are represented by the HFMConstants type library constants listed in Process Management Action Constants.

The input value of the argument is ignored.

Input/output argument.

pvarasNewState

Returns an array of the review levels resulting from the process management actions. The return values are represented by the HFMConstants type library constants listed in Process Management Review Level Constants.

Tip:

To return the string equivalent of an array item, pass the item to MapReviewLevelToString.

The input value of the argument is ignored.

Input/output argument.

pvarabstrComment

Returns an array of the comments specified for the process management actions.

The input value of the argument is ignored.

Input/output argument.

Example

The following example prints the specified process unit’s process management history to the browser as an HTML table. Note that if GetReviewLevel indicates that the process unit has not been started, a message is printed to the browser instead of a history.

Sub printUnitHistory(sScen, sYr, sPer, sEnt, sPar, sVal)
Dim cHFMProcMan, vaTime, vaUser, vaAction, vaLevel, vaComment
Set cHFMProcMan = Server.CreateObject("Hyperion.HFMwManageProcess")
'g_cHFMSession is an HFMwSession object reference
cHFMProcMan.SetWebSession g_cHFMSession
If cHFMProcMan.GetReviewLevel(sScen, sYr, sPer, sEnt, sPar, _ 
    sVal) <> PROCESS_FLOW_STATE_NOT_STARTED Then
  cHFMProcMan.GetHistory sScen, sYr, sPer, sEnt, sPar, sVal, _ 
    vaTime, vaUser, vaAction, vaLevel, vaComment
  Response.Write "<table cellpadding=" & chr(34) & "7em" & _ 
    chr(34) & ">"
  Response.Write "<tr>" & "<td><b>Date/Time</b></td>"
  Response.Write "<td><b>User</b></td>" & "<td><b>Action</b></td>"
  Response.Write "<td><b>Review Level</b></td>"
  Response.Write "<td><b>Comment</b></td>" & "</tr>"
  For i = lBound(vaTime) to uBound(vaTime)
    Response.Write "<tr>"
    Response.Write "<td>" & CDate(vaTime(i)) & "</td>"
    Response.Write "<td>" & vaUser(i) & "</td>"
    'getActionString() is not part of the API, is described below
    Response.Write "<td>" & getActionString(vaAction(i)) & "</td>"
    Response.Write "<td>" & _ 
    cHFMProcMan.MapReviewLevelToString(vaLevel(i)) & "</td>"
    Response.Write "<td>" & vaComment(i) & "</td>"
    Response.Write "</tr>"
  Next
  Response.Write "</table>"
Else
  Response.Write "<p>No actions taken for the process unit"
End If
End Sub

Note:

In the example, the action descriptions printed to the browser are obtained by passing the action array items returned by GetHistory to the following custom function (getActionString).

Function getActionString(lLevelId)
Select Case lLevelId
  Case PROCESS_FLOW_ACTION_APPROVE
    getActionString = "Approve"
  Case PROCESS_FLOW_ACTION_PROMOTE
    getActionString = "Promote"
  Case PROCESS_FLOW_ACTION_PUBLISH
    getActionString = "Publish"
  Case PROCESS_FLOW_ACTION_REJECT
    getActionString = "Reject"
  Case PROCESS_FLOW_ACTION_SIGN_OFF
    getActionString = "Sign off"
  Case PROCESS_FLOW_ACTION_START
    getActionString = "Start"
  Case PROCESS_FLOW_ACTION_SUBMIT
    getActionString = "Submit"
End Select
End Function