WorkflowModelManager - Global
-
- UpdatedJan 30, 2025
- 8 minutes to read
- Yokohama
- API reference
The WorkflowModelManager script include provides methods to query the workflow model, to step backwards and forwards between specified workflow history items, and to query the history for activity and transition-specific information.
The interaction with the WorkflowModelManager script include is through the ActivityHistoryRecord data object. The ActivityHistoryRecord object is an inner class and is only used while interacting with WorkflowModelManager.
At this time, the playBack is required to load the executed transitions. This will also play a role in walking backwards on a model to rollback to a specific activity.
WorkflowModelManager - WorkflowModelManager(String contextId)
Creates a new WorkflowModelManager object (constructor) within the specified context.
Name | Type | Description |
---|---|---|
contextId | String | The ID for the context in which you want the WorkflowModelManager created. |
Type | Description |
---|---|
ActivityHistoryRecord | The ActivityHistoryRecord JavaScript object requested. |
Example
WorkflowModelManager - getActivityHistoryRecordById(String haRecordSysId)
Retrieves the history activity that is cached by the wf_history.sys_id provided in the argument.
Name | Type | Description |
---|---|---|
haRecordSysId | String | Sys_id of the desired Activity History [wf_history] record. |
Type | Description |
---|---|
ActivityHistoryRecord | Requested ActivityHistoryRecord JavaScript object. |
Example
This example shows how to use the method to obtain the specified history activity record.
Output:
WorkflowModelManager - getAllTransitionedIntoActivity(Object description)
Retrieves the history activities that executed and transitioned into the one represented by the sys_id in the argument.
The next status is based on the wf_activity.sys_id associated with the activity represented in the haRecord existing as a TO in a transition associated with any ActivityHistoryRecords that executed in the workflow's history. (This differs from getPreviousByTransition, which only returns TO transitions that come before the haRecord in the execution sequence (by time).) The return value is a collection of ActivityHistoryRecords that identify the argument haRecord.wfaId as their TO activity. The return values are based on all transitions in the executed history collection that transition To get the activity that executed prior to this activity in time use getPreviousByExecutedOrder.
Name | Type | Description |
---|---|---|
description | Object | ActivityHistoryRecord JavaScript object. |
Type | Description |
---|---|
Object Array | Array of ActivityHistoryRecord JavaScript objects. |
WorkflowModelManager - getAllTransitionedIntoActivityId(String haRecordSysId)
Retrieves the history activities that executed and transitioned into the one represented by the sys_id in the argument. The next status is based on the wf_activity.sys_id associated with the activity represented in the haRecord existing as a TO in a transition associated with any ActivityHistoryRecords that executed in the workflow's history. (This differs from getPreviousByTransition, which returns only TO transitions that come before the haRecord in the execution sequence (by time).) The return value is a collection of ActivityHistoryRecords that identify the argument haRecord.wfaId as their TO activity.
The next status is based on the wf_activity.sys_id associated with the activity represented in the haRecord existing as a TO in a transition associated with any ActivityHistoryRecords that executed in the workflow's history. (This differs from getPreviousByTransition, which returns only TO transitions that come before the haRecord in the execution sequence (by time).) The return value is a collection of ActivityHistoryRecords that identify the argument haRecord.wfaId as their TO activity.
Name | Type | Description |
---|---|---|
haRecordSysId | String | The sys_id of the activity history (table wf_history). |
Type | Description |
---|---|
Object Array | Array of ActivityHistoryRecord JavaScript objects requested. |
Example
WorkflowModelManager - getExecutedHistory( )
This is the worker method that must be called to initialize the WorkflowModelManager object. In the process of initializing the WorkflowModelManager object, getExecutedHistory() creates and populates the activityHistoryRecord data object array (which is a member of the WorkflowModelManager class). Most WorkflowModelManager methods return a subset of the activityHistoryRecord array. Your script can then call one or more of the activityHistoryRecord methods to accomplish further work.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String Array | An ordered array of sys_ids from table wf_history. It is unlikely client code would use the return value; it is kept internally to this object for use by subsequent method calls. |
Example
WorkflowModelManager - getFinalExecutedActivityList( )
Queries the wf_history table by context and retrieves all the activities executed in the workflow given by the context set in the construction of this object.
This function produces a list of executed activities in the exact order each activity passed through the server side ActivityManager.java using the new activity_index to force the order coming out of the database. On its this call will not give the full picture; it needs to load and map the transitions.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Object Array | Array of ActivityHistoryRecord javascript objects. |
WorkflowModelManager - getFinalExecutedActivityIdList( )
Gets the list of wf_history.sys_ids of all activities that successfully executed and were not rolled back or skipped up to the moment the function was called.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String Array | Array of wf_history.sys_id values for executed activities. |
Example
WorkflowModelManager - getNextByExecutedOrder(Object haRecord)
Retrieves the history activity that executed just after the one provided in the argument.
Name | Type | Description |
---|---|---|
haRecord | Object | ActivityHistoryRecord JavaScript object. |
Type | Description |
---|---|
Object | The requested ActivityHistoryRecord JavaScript object. |
Example
The following example shows how to use the getNextByExecutedOrder() method to retrieve the history activity that executed after the specified activity.
Output:
WorkflowModelManager - getNextByExecutedOrderId(String haRecordSysId)
Retrieves the history activity that is cached by the wf_history.sys_id provided in the argument and then calls into getNextByExecutedOrder() with the retrieved JavaScript object.
Name | Type | Description |
---|---|---|
haRecordSysId | String | The sys_id of the activity history (table wf_history). |
Type | Description |
---|---|
Object | The ActivityHistoryRecord JavaScript object requested. |
Example
WorkflowModelManager - getNextByTransitionId(String haRecordSysId)
Retrieves the history activity that executed just after the one identified by the sys_id provided in the argument.
This function retreives the cached history record associated with the provided wf_history.sys_id and then calls getNextByTransition. The return values are based on which transitions came before the haRecord submitted and not necessarily the activities that executed just prior to the haRecord in time. To get the activity that executed prior to this activity in time, use getNextByExecutedOrder.
Name | Type | Description |
---|---|---|
haRecordSysId | String | Sys_id of the desired Activity History [wf_history] record. |
Type | Description |
---|---|
Object Array | Array of ActivityHistoryRecord JavaScript objects. |
Example
WorkflowModelManager - getPreviousByExecutedOrder(Object haRecord)
Retrieves the history activity that executed just previous to the one provided in the argument.
Name | Type | Description |
---|---|---|
haRecord | Object | ActivityHistoryRecord JavaScript object |
Type | Description |
---|---|
Object | The ActivityHistoryRecord JavaScript object requested. |
WorkflowModelManager - getPreviousByExecutedOrderId(String haRecordSysId)
Retrieves the history activity cached by the wf_history.sys_id provided in the argument, then calls getPreviousByExecutedOrder() with the retrieved JavaScript object.
Name | Type | Description |
---|---|---|
haRecordSysId | String | Workflow history system ID (wf_history.sys_id) |
Type | Description |
---|---|
ActivityHistoryRecord | The ActivityHistoryRecord JavaScript object requested. |
Example
WorkflowModelManager - getPreviousByTransition(Object haRecord)
Retrieves the history activities that executed just prior to the one provided in the argument.
The next status is based on the wf_activity.sys_id associated with the activity represented in the haRecord existing as a TO in a transition associated with any ActivityHistoryRecords that come before the haRecord in the execution sequence. (This differs from getAllTransitionedIntoActivity, which returns all TO transitions up to the given haRecord in the execution sequence .) The return value is a collection of ActivityHistoryRecords that identify the argument haRecord.wfaId as their TO activity. The return values are based on which transitions came before the haRecord submitted and not necessarily the activities that executed just prior to the haRecord in time. To get the activity that executed prior to this activity in time, use getPreviousByExecutedOrder.
Name | Type | Description |
---|---|---|
haRecord | Object | ActivityHistoryRecord JavaScript object. |
Type | Description |
---|---|
Object Array | Array of ActivityHistoryRecord JavaScript objects requested. |
WorkflowModelManager - getPreviousByTransitionId(String haRecordSysId)
Retrieves the history activities that executed just prior to the one provided in the argument.
The next status is based on the wf_activity.sys_id associated with the activity represented in the haRecord existing as a TO in a transition associated with any ActivityHistoryRecords that come before the haRecord in the execution sequence. The return value is a collection of ActivityHistoryRecords that identify the argument haRecord.wfaId as their TO activity. The return values are based on which transitions came before the haRecord sumbitted and not necessarily the activities that executed just prior to the haRecord in time. To get the activity that executed prior to this activity in time use getPreviousByExecutedOrder().
Name | Type | Description |
---|---|---|
haRecordSysId | String | Sys_id of the activity history. Table: WorkFlow History [wf_history] |
Type | Description |
---|---|
Object | Array of ActivityHistoryRecord JavaScript objects requested. |
Example
The following example shows how to use the getPreviousByTransitionId() method to obtain ActivityHistoryRecord objects.
Output:
On this page
- WorkflowModelManager - WorkflowModelManager(String contextId)
- WorkflowModelManager - getActivityHistoryRecordById(String haRecordSysId)
- WorkflowModelManager - getAllTransitionedIntoActivity(Object description)
- WorkflowModelManager - getAllTransitionedIntoActivityId(String haRecordSysId)
- WorkflowModelManager - getExecutedHistory( )
- WorkflowModelManager - getFinalExecutedActivityList( )
- WorkflowModelManager - getFinalExecutedActivityIdList( )
- WorkflowModelManager - getNextByExecutedOrder(Object haRecord)
- WorkflowModelManager - getNextByExecutedOrderId(String haRecordSysId)
- WorkflowModelManager - getNextByTransitionId(String haRecordSysId)
- WorkflowModelManager - getPreviousByExecutedOrder(Object haRecord)
- WorkflowModelManager - getPreviousByExecutedOrderId(String haRecordSysId)
- WorkflowModelManager - getPreviousByTransition(Object haRecord)
- WorkflowModelManager - getPreviousByTransitionId(String haRecordSysId)
Related Content
- WFActivityHandler - Global
The WFActivityHandler script include is the base class for all workflow activities.