public final class WorkflowManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
applyActivity(RecordItem recordItem,
GUID workflowID,
int activityID,
int destinationStateID,
java.util.Set<java.lang.String> dynamicAssignments,
int languageID)
Applies the given activity on the given record.
|
void |
applyActivity(RecordItem recordItem,
GUID workflowID,
int activityID,
int destinationStateID,
java.util.Set<java.lang.String> dynamicAssignments,
java.lang.String initiatingUserUID,
int languageID)
Applies the given activity on the given record.
|
java.util.Map<Workflow,java.util.List<WorkflowActivity>> |
getAvailableActivities(MultiRecordItemCollection multiRecordItemCollection,
java.util.List<ItemIdentifier> itemIDs,
GUID workflowID,
boolean onlyInitialActivities)
Return a list of workflow activities that can be applied to the given records.
|
static WorkflowManager |
getInstance()
Returns the WorkflowManager to work with.
|
java.lang.String |
getMatchingRecordsQuery(CumulusSession cumulusSession,
Workflow workflow,
int activityID)
Returns a query string which finds all records where the given activity can be applied on.
|
java.util.Map<GUID,java.lang.String> |
getUserTODOQuery(MultiRecordItemCollection multiRecordItemCollection)
Returns queries which finds the records in a workflow the current user is assigned to.
|
java.lang.String |
getUserTODOQuery(MultiRecordItemCollection multiRecordItemCollection,
GUID workflowID)
Returns a query which finds the records in the given workflow the current user is assigned to.
|
java.util.Map<GUID,java.lang.String> |
getUserTODOQuery(RecordItemCollection recordItemCollection)
Returns queries which finds the records in a workflow the current user is assigned to.
|
java.lang.String |
getUserTODOQuery(RecordItemCollection recordItemCollection,
GUID workflowID)
Returns a query which finds the records in the given workflow the current user is assigned to.
|
boolean |
isCompliantWithActivityRestrictions(RecordItem recordItem,
WorkflowActivity workflowActivity)
Returns whether the user and record restrictions of the given activity are matched by the given record.
|
boolean |
isCompliantWithRecordRestrictions(RecordItem recordItem,
WorkflowActivity workflowActivity)
Returns whether the record restrictions of the given activity are matched by the given record.
|
boolean |
isCompliantWithUserRestrictions(RecordItem recordItem,
WorkflowActivity workflowActivity)
Returns whether the user restrictions of the given activity are matched by the given record.
|
boolean |
isCompliantWithUserRestrictions(UserContext userContext,
WorkflowActivity workflowActivity)
Returns whether the user restrictions of the given activity are matched by the given record.
|
boolean |
isWorkflowStarted(RecordItem recordItem,
GUID workflowID)
Returns whether the workflow has been started on the given record.
|
java.lang.String |
mergeQueries(java.util.Map<GUID,java.lang.String> queries)
Merges the given queries per workflow into a single query to find all records the current user is assigned to with a single search.
|
void |
resetWorkflow(RecordItem recordItem,
GUID workflowID,
int languageID)
Resets a workflow on the given record.
|
public static WorkflowManager getInstance()
public java.util.Map<Workflow,java.util.List<WorkflowActivity>> getAvailableActivities(MultiRecordItemCollection multiRecordItemCollection, java.util.List<ItemIdentifier> itemIDs, GUID workflowID, boolean onlyInitialActivities)
multiRecordItemCollection
- The collection containing all catalogs to work with. If the itemIDs
is null
then it checks all records
of the collection.itemIDs
- The ids of the records to check. If this is null
then the above collection contents is checked.workflowID
- The ID of the workflow to check. If this is null
then all workflows defined for the catalogs are processed.public java.lang.String getMatchingRecordsQuery(CumulusSession cumulusSession, Workflow workflow, int activityID)
cumulusSession
- session to work withworkflow
- workflow instance to work withactivityID
- ID of activity you are interested inpublic java.util.Map<GUID,java.lang.String> getUserTODOQuery(MultiRecordItemCollection multiRecordItemCollection)
multiRecordItemCollection
- collection to work withmergeQueries(java.util.Map)
public java.util.Map<GUID,java.lang.String> getUserTODOQuery(RecordItemCollection recordItemCollection)
recordItemCollection
- collection to work withmergeQueries(java.util.Map)
public java.lang.String getUserTODOQuery(RecordItemCollection recordItemCollection, GUID workflowID)
recordItemCollection
- collection to work withworkflowID
- the workflow to return the query fornull
if the given workflow cannot be foundpublic java.lang.String getUserTODOQuery(MultiRecordItemCollection multiRecordItemCollection, GUID workflowID)
multiRecordItemCollection
- collection to work withworkflowID
- the workflow to return the query fornull
if the given workflow cannot be foundpublic java.lang.String mergeQueries(java.util.Map<GUID,java.lang.String> queries)
queries
- workflow queries to mergegetUserTODOQuery(com.canto.cumulus.RecordItemCollection)
,
getUserTODOQuery(com.canto.cumulus.MultiRecordItemCollection)
public boolean isCompliantWithActivityRestrictions(RecordItem recordItem, WorkflowActivity workflowActivity)
isCompliantWithUserRestrictions(com.canto.cumulus.UserContext, com.canto.cumulus.prefs.WorkflowActivity)
and isCompliantWithRecordRestrictions(com.canto.cumulus.RecordItem, com.canto.cumulus.prefs.WorkflowActivity)
.recordItem
- item to checkworkflowActivity
- activity to checktrue
if the given activity can be applied on the given record, false
otherwisepublic boolean isCompliantWithUserRestrictions(UserContext userContext, WorkflowActivity workflowActivity)
userContext
- user to checkworkflowActivity
- activity to checktrue
if the user restrictions of the given activity are matched by the given record, false
otherwiseisCompliantWithActivityRestrictions(com.canto.cumulus.RecordItem, com.canto.cumulus.prefs.WorkflowActivity)
public boolean isCompliantWithUserRestrictions(RecordItem recordItem, WorkflowActivity workflowActivity)
recordItem
- item to checkworkflowActivity
- activity to checktrue
if the user restrictions of the given activity are matched by the given record, false
otherwiseisCompliantWithActivityRestrictions(com.canto.cumulus.RecordItem, com.canto.cumulus.prefs.WorkflowActivity)
public boolean isCompliantWithRecordRestrictions(RecordItem recordItem, WorkflowActivity workflowActivity)
recordItem
- item to checkworkflowActivity
- activity to checktrue
if the record restrictions of the given activity are matched by the given record, false
otherwiseisCompliantWithActivityRestrictions(com.canto.cumulus.RecordItem, com.canto.cumulus.prefs.WorkflowActivity)
public void applyActivity(RecordItem recordItem, GUID workflowID, int activityID, int destinationStateID, java.util.Set<java.lang.String> dynamicAssignments, int languageID)
dynamic assignment
. The given language specifies the language to use when creating the log entry in the workflow activity history table.recordItem
- item to processworkflowID
- workflow to useactivityID
- activity to apply on the given recorddestinationStateID
- destination state to use if the given activity supports multiple destination states, otherwise the value is ignoreddynamicAssignments
- list of resulting assignments if the given activity uses dynamic assignments
, can be null
otherwiselanguageID
- specifies the language to use when creating the log entry in the workflow activity history tablepublic void applyActivity(RecordItem recordItem, GUID workflowID, int activityID, int destinationStateID, java.util.Set<java.lang.String> dynamicAssignments, java.lang.String initiatingUserUID, int languageID)
dynamic assignment
. The given language specifies the language to use when creating the log entry in the workflow activity history table.recordItem
- item to processworkflowID
- workflow to useactivityID
- activity to apply on the given recorddestinationStateID
- destination state to use if the given activity supports multiple destination states, otherwise the value is ignoreddynamicAssignments
- list of resulting assignments if the given activity uses dynamic assignments
, can be null
otherwiseinitiatingUserUID
- Optional: the user UID of the initiating user to be assigned in case the workflow activity is configured to assign it to the initiating user.
If the is null
then the user context of the recordItem parameter is used.languageID
- specifies the language to use when creating the log entry in the workflow activity history tablepublic void resetWorkflow(RecordItem recordItem, GUID workflowID, int languageID)
PredefinedPermissions.SERVER_PERMISSION_WORKFLOW_ADMIN
permission.recordItem
- item to processworkflowID
- workflow to uselanguageID
- specifies the language to use when creating the log entry in the workflow activity history tablepublic boolean isWorkflowStarted(RecordItem recordItem, GUID workflowID)
recordItem
- item to processworkflowID
- workflow to usewww.canto.com
Canto, the Canto logo, the Cumulus logo, and Cumulus are registered trademarks of Canto GmbH, registered in the U.S. and other countries.