ActivityHistoryRecord - Global
-
- UpdatedJan 30, 2025
- 16 minutes to read
- Yokohama
- API reference
The ActivityHistoryRecord API provides methods that facilitate interacting with a WorkflowModelManager object. It is a data object that is a member of the WorkflowModelManager class.
This API is basically a copy of the data from a glide record on the table Activity History [wf_history]. There are some helper methods defined for this class as well. There are no accessors or mutator to the simple data elements of this class.
ActivityHistoryRecord - addArrivedActivityToJoin(String Array activityIds)
Changes the arrivedState of already known ids to true.
As soon as this method changes the arrivedState of known ids to true, it tests to see if the join is satisfied. if it is, the model walk can continue; if not, it should continue to next appropriate transition. This is called during playback, as expected wf_activities flow to the join.
Name | Type | Description |
---|---|---|
activityIds | String Array | Array of wf_activity.sys_ids that are headed towards join. |
Type | Description |
---|---|
void |
ActivityHistoryRecord - addJoinFromActivityIds(String Array activityIds)
Seeds all the expected wf_activity sys_ids that are expected to pass through this join and sets their arriveState = false.
This state is flipped to true as each expected activity transitions to this instance of the Join. This method is called as part of building the cached model in memory, and is not called during playback.
Name | Type | Description |
---|---|---|
activityIds | String Array | Array of wf_activity.sys_ids that are headed towards join. |
Type | Description |
---|---|
void |
ActivityHistoryRecord - addTransition(Object InTransition)
As model is cached by _getExecutedTransitions(), this method adds transitions that have gone FROM this activity towards the .to activity.
Name | Type | Description |
---|---|---|
InTransition | Object | ExecutedTransition Javascript object to add to this activity. |
Type | Description |
---|---|
void |
ActivityHistoryRecord - debugDump( )
Prints debug information.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
void |
Example
The following code example shows how to use this method. It uses the oldest workflow history records of a base instance.
Output:
ActivityHistoryRecord - doesJoinContainActivity( )
Tests the incoming wf_activity sys_id, presumed to be seeded in this history record. If it is, it is tested to see if it is an activity that would come through this join.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Boolean | True, if it is an activity that would come through this join. |
ActivityHistoryRecord - getLogString( )
Returns the log string from the history record.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | The log string. |
Example
The following code example shows how to use this method. It uses the oldest workflow history records of a base instance.
Output:
ActivityHistoryRecord - getSatisfiedJoinActivities( )
Returns the sys_ids of the history records that transition to this Join activity that have already come through.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String Array | Array of sys_ids of the history records that transition to this Join activity. |
ActivityHistoryRecord - getTransitionCount( )
Returns the transition count for this activity.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Number | Number of transitions from this activity. |
Example
The following code example shows how to use this method. It uses the oldest workflow history records of a base instance.
Output:
ActivityHistoryRecord - getUnSatisfiedJoinActivities( )
Returns the sys_ids of the history records that transition to this Join activity that the join is still waiting for.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String Array | Array of sys_ids of the history records that transition to this Join activity. |
ActivityHistoryRecord - isARollback( )
Determines if this activity is one of the rollback activities.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Boolean | Flag that indicates whether the activity is one of the rollback activities. Valid values:
|
ActivityHistoryRecord - isIdADestination(String ahrSys_id)
Determines if the sys_id passed in is a destination of any of the transitions associated with this instance of an ActivityHistoryRecord.
Name | Type | Description |
---|---|---|
ahrSys_id | String | Activity history sys_id from table wf_history. |
Type | Description |
---|---|
Boolean | True, if the sys_id passed in is a destination of any of the transitions. |
ActivityHistoryRecord - isJoin( )
Determines if this activity is a join.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Boolean | True, if the activity is "Join". |
ActivityHistoryRecord - isJoinSatisfied( )
Examines the value of the arriveState.
Called during playback when the transition to sys_id of a transition points to an activity that is a join.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Boolean | True, if the join is satisfied. |
ActivityHistoryRecord - isJoinWaitingForActivity(String Array activityIds)
Tests the incoming wf_activity sys_id, presumed to be seeded in this history record.
If it is, it is tested to see if it has already been through; if it has, then this join is not waiting on this activity and it should look further downstream for the one that is waiting. This test is called in sequence as the model is walked, so it does presume in the instances of rollbacks and loops. If the sys_id is in here and the flag is true, this waiting Join is further up the sequence. This sort of check is required as the history records of Joins are removed from the history table, and so it is possible for a record to be in the transition table with no match in the corresponding history table, but is still an appropriate match for an earlier executed instance of the same Join.
Name | Type | Description |
---|---|---|
activityIds | String Array | Array of wf_activity.sys_ids that are headed towards join. |
Type | Description |
---|---|
Boolean | True, if the activity has already been through. |
ActivityHistoryRecord - isRolledBack( )
Determines if this workflow was rolled back.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Boolean | True, if this workflow was rolled back. |
ActivityHistoryRecord - isTurnstile( )
Determines if the current activity is a turnstile.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Boolean | Flag that indicates whether the activity is a turnstile. Valid values:
|
Example
The following code example shows how to use this method to detect a turnstile. It is based on the workflow found in Rollback To workflow activity. You can confirm the output of this script by examining the Workflow Activity History tab when you Show Workflow on the requested items (RITM) form.
Output:
On this page
- ActivityHistoryRecord - addArrivedActivityToJoin(String Array activityIds)
- ActivityHistoryRecord - addJoinFromActivityIds(String Array activityIds)
- ActivityHistoryRecord - addTransition(Object InTransition)
- ActivityHistoryRecord - debugDump( )
- ActivityHistoryRecord - doesJoinContainActivity( )
- ActivityHistoryRecord - getLogString( )
- ActivityHistoryRecord - getSatisfiedJoinActivities( )
- ActivityHistoryRecord - getTransitionCount( )
- ActivityHistoryRecord - getUnSatisfiedJoinActivities( )
- ActivityHistoryRecord - isARollback( )
- ActivityHistoryRecord - isIdADestination(String ahrSys_id)
- ActivityHistoryRecord - isJoin( )
- ActivityHistoryRecord - isJoinSatisfied( )
- ActivityHistoryRecord - isJoinWaitingForActivity(String Array activityIds)
- ActivityHistoryRecord - isRolledBack( )
- ActivityHistoryRecord - isTurnstile( )