Interface IProcessCaseDao
- All Known Implementing Classes:
NullProcessCaseDao
public interface IProcessCaseDao
This interface can be implemented by projects to provide a custom data-layer implementation for the process engine
case data. The implementation, and configuration thereof, of this interface is application specific, and thus the
implementation will be provided by the application data source.
- Since:
- 7.1
- Author:
- O. Kerpershoek
-
Method Summary
Modifier and TypeMethodDescriptionacquireLock
(long caseId, String lockedBy) Method for locking a Case.void
clearDelayedEvent
(long caseId, long eventId) Notifies the persistence layer that an event is no longer delayed.createCase
(String name, String appId, CaseStatusType status, String lockedBy, IMultilingualText displayName) This method creates a case.createEvent
(ApplicationID appId, String name, Long caseId, Long taskId, CaseEventType type, CaseEventStatusType status, Date timestamp, String user, Map<String, IValue> content) This method creates a case event.createInstance
(long caseId, String entityName, GUID instanceId, String instanceName) This method creates an instance for a certain case.createTask
(long caseId, Long parentId, String name, TaskType type, TaskStatusType status, IAssigneeInfo assignee, GUID nodeId, DateTimeValue startDate, DateTimeValue timeoutDate, DateTimeValue dueDate, String exitState, String eventName, boolean isConditional, boolean isRequired, boolean isUserSet, Integer priority, DateTimeValue lastPriorityCheck, Map<String, String> properties, String[] unauthorizedUserIds, IMultilingualText displayName) This method creates a task.createValue
(long instanceId, String attributeName, IValue attrValue) This method creates a value for an instance.void
delayEvent
(long caseId, ICaseEventModel caseEventModel) Delays the event with the given id for the case with the given id.void
Deletes all broadcast events.void
deleteCase
(long id) This method deletes a case.void
deleteInstance
(long instanceId) This method deletes an instancevoid
deleteValue
(long instanceId, String attributeName) This method deletes a value of an instance.This method finds the list all case events.findByCriteria
(CaseViewCriteria criteria) Finds case views based on the specified criteria.findByCriteria
(TaskViewCriteria criteria) Finds task views based on the specified criteria.findCaseEventById
(Long eventId) This method finds a case event by id.findCaseEventsByCriteria
(CaseEventCriteria criteria) This method finds a list of case events by criteria.long[]
findCaseIds
(CaseCriteria caseFilter, TaskCriteria taskFilter) Searches for cases matching the specified case and task filters and returns their IDs.findCases
(CaseCriteria caseFilter, TaskCriteria taskFilter) This method searches for cases containing tasks matching the filter.findDelayedEvents
(long caseId) Returns events whose processing has been delayed due to the case being locked.findExtendedCases
(CaseCriteria caseFilter) This method searches for cases matching the task filter.findExtendedTasks
(TaskCriteria taskFilter) This method searches for tasks matching the task filter.findTasks
(TaskCriteria taskFilter) This method searches for tasks matching the task filter.findTimerEvent
(Long caseId, Long taskId) Returns the timer event associated with the given case and timer task, or null if it does not exist.getCase
(long caseId) This method returns the case for the specified id.getCaseState
(long caseId) This method returns the CaseState for the specific case including all tasks that belong to it.getChildTasks
(long parentTaskId) This method returns the child tasks of a certain task.getInstancesForCase
(long caseId) This method returns the instances of a certain case.getInstancesForCases
(long[] caseIds) Returns the instances of the specified cases.getTask
(long id) This method returns the task of a certain id.getTasksForCase
(long caseId) This method returns the tasks of a certain case.getValuesForCase
(long caseId) This method returns all the values belonging to a case.getValuesForInstances
(long[] instanceIds) Returns all the values for the specified instances.boolean
isCaseLocked
(long caseId) Checks is a case is locked in the databasereplayEvent
(ICaseEventModel original, Long caseId, String user) Creates a copy of a case event.void
setCaseEventStatus
(ICaseEventModel caseEvent, CaseEventStatusType status) This method updates the status of a case event.unlockCase
(long id) Method for unlocking a case.updateCase
(long id, CaseStatusType status, String lockedBy) Deprecated.updateCaseApplicationId
(long id, String applicationId) Updates the application id of a case.updateCaseDisplayName
(long id, IMultilingualText displayName) This method will remove the current display names and will add the new new display names provided as parameter In case of null, the case name will be setupdateDueDate
(long taskId, DateTimeValue dueDate) This methods updates the due date of the task.updateLastPriorityCheck
(long taskId, DateTimeValue lastPriorityCheck) This method updates the last priority check of the task with the specified id.updatePriority
(long taskId, Integer priority, DateTimeValue lastPriorityCheck) This methods updates the priority and the last priority check of the task with the specified id.updateStartDate
(long taskId, DateTimeValue startDate) This methods updates the start date of the task.updateTask
(long taskId, TaskStatusType status, IAssigneeInfo assigneeInfo, DateTimeValue timeoutDate, String exitState, String executedBy, boolean isRequired, boolean isUserSet, Integer priority, DateTimeValue lastPriorityCheck, IMultilingualText displayName) This method updates a task with the specified id.updateTaskDisplayName
(long taskId, IMultilingualText displayName) Updates the display name of the task with the specified id.updateTaskExitState
(long taskId, String newExitState) Method for updating the taskExitStateupdateTaskUnauthorizedUsers
(long taskId, String[] unauthorizedUsers) This method updates the unauthorizedUsers property of a task.updateTimeoutDate
(long taskId, DateTimeValue timeoutDate) This methods updates the timeout date of the task.updateValue
(long instanceId, String attributeName, IValue attrValue) This method updates a value of an instance.
-
Method Details
-
getCase
This method returns the case for the specified id.- Parameters:
caseId
- The id of the case.- Returns:
- The model of the case for the specified id, or null if the case could not be found.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
findCases
This method searches for cases containing tasks matching the filter.- Parameters:
caseFilter
- The case filter.taskFilter
- The task filter.- Returns:
- The matching cases.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
findCaseIds
Searches for cases matching the specified case and task filters and returns their IDs.- Parameters:
caseFilter
- the filter cases should matchtaskFilter
- the filter tasks should match- Returns:
- the IDs of the matching cases.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
getCaseState
This method returns the CaseState for the specific case including all tasks that belong to it.- Parameters:
caseId
- the id of the case.- Returns:
- the caseState model of the specified case or null
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
createCase
ICaseModel createCase(String name, String appId, CaseStatusType status, String lockedBy, IMultilingualText displayName) This method creates a case.- Parameters:
name
- The name of the case.appId
- The application id.status
- The status of the case.lockedBy
- The user locking the case.displayName
- the display name- Returns:
- The model for the case.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
updateCase
Deprecated.this method was used for locking/unlocking a case, useacquireLock(long, String)
andunlockCase(long)
insteadThis method updates a case.- Parameters:
id
- The id of the case.status
- The new status of the case.lockedBy
- The user locking the case.- Returns:
- The model for the case.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
updateCaseDisplayName
This method will remove the current display names and will add the new new display names provided as parameter In case of null, the case name will be set- Parameters:
id
- The id of the case.displayName
- the display name to set- Returns:
- The model for the case.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
updateTaskDisplayName
Updates the display name of the task with the specified id.- Parameters:
taskId
- the id of the taskdisplayName
- the display name- Returns:
- the updated task model
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
deleteCase
void deleteCase(long id) This method deletes a case.- Parameters:
id
- The id of the case.- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
getTask
This method returns the task of a certain id.- Parameters:
id
- The id of the task.- Returns:
- The model for the task, or null if a task model with the given id is not found.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
findTasks
This method searches for tasks matching the task filter.- Parameters:
taskFilter
- The filter tasks should match.- Returns:
- The models of tasks matching the filter.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
findExtendedTasks
This method searches for tasks matching the task filter.- Parameters:
taskFilter
- The filter tasks should match.- Returns:
- The result of the tasks, case and values.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
findExtendedCases
This method searches for cases matching the task filter.- Parameters:
caseFilter
- The filter cases should match.- Returns:
- The result of the case and values.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
getTasksForCase
This method returns the tasks of a certain case.- Parameters:
caseId
- The id of the case.- Returns:
- The models of the tasks belonging to the case.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
getChildTasks
This method returns the child tasks of a certain task.- Parameters:
parentTaskId
- The id of the parent task.- Returns:
- The models of the tasks being a child of the parent.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
createTask
ITaskModel createTask(long caseId, Long parentId, String name, TaskType type, TaskStatusType status, IAssigneeInfo assignee, GUID nodeId, DateTimeValue startDate, DateTimeValue timeoutDate, DateTimeValue dueDate, String exitState, String eventName, boolean isConditional, boolean isRequired, boolean isUserSet, Integer priority, DateTimeValue lastPriorityCheck, Map<String, String> properties, String[] unauthorizedUserIds, IMultilingualText displayName) This method creates a task.- Parameters:
caseId
- The id of the case.parentId
- The id of the parent task.name
- The name of the case.type
- The type of the task.status
- The status of the task.assignee
- The assignee of the task.nodeId
- The definition node id of the task.startDate
- The startData of the task.timeoutDate
- The timeoutDate of the task.dueDate
- The dueDate of the taskexitState
- The exitState of the task.eventName
- The eventName this task is waiting for.isConditional
- Indicator whether the task is conditional.isRequired
- Indicator whether the task is required.isUserSet
- Indicator whether the task was assigned by an user manually or by a routing algorithmpriority
- The priority of the task.lastPriorityCheck
- The last date priority was checked.properties
- propertiesunauthorizedUserIds
- ids of users that are unauthorizeddisplayName
- the display name- Returns:
- The model of the task.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
updateTask
ITaskModel updateTask(long taskId, TaskStatusType status, IAssigneeInfo assigneeInfo, DateTimeValue timeoutDate, String exitState, String executedBy, boolean isRequired, boolean isUserSet, Integer priority, DateTimeValue lastPriorityCheck, IMultilingualText displayName) This method updates a task with the specified id.- Parameters:
taskId
- The id of the task.status
- The status of the task.assigneeInfo
- The assignee of the task.timeoutDate
- The duedate of the task.exitState
- The exitstate of the task.executedBy
- The user who executed the update.isRequired
- The required flag of the task.isUserSet
- Indicator whether the task was assigned by an user manually or by a routing algorithm.priority
- The priority of the task.lastPriorityCheck
- The last time priority was checked.displayName
- The display name of the task.- Returns:
- The updated model of the task.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
updateStartDate
This methods updates the start date of the task.- Parameters:
taskId
- The id of the task.startDate
- The start date of the task.- Returns:
- the updated model of the task.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
updateDueDate
This methods updates the due date of the task.- Parameters:
taskId
- The id of the task.dueDate
- The due date of the task.- Returns:
- the updated model of the task.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
updateTimeoutDate
This methods updates the timeout date of the task.- Parameters:
taskId
- The id of the task.timeoutDate
- The timeout date of the task.- Returns:
- the updated model of the task.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
updatePriority
This methods updates the priority and the last priority check of the task with the specified id. This method should be used when the priority of a task changes to a new value.- Parameters:
taskId
- The id of the task.priority
- the priority of the tasklastPriorityCheck
- The last time priority was checked.- Returns:
- the updated model of the task.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
updateLastPriorityCheck
This method updates the last priority check of the task with the specified id. This method should be used when the priority of a task was checked and it did not change to a new value.- Parameters:
taskId
- The id of the task.lastPriorityCheck
- the last time priority was checked.- Returns:
- the updated model of the task.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
updateTaskUnauthorizedUsers
This method updates the unauthorizedUsers property of a task.- Parameters:
taskId
- the id of the taskunauthorizedUsers
- the unauthorized users- Returns:
- The model of the task.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
getInstancesForCase
This method returns the instances of a certain case.- Parameters:
caseId
- The id of the case.- Returns:
- The instances for the specified case.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
getInstancesForCases
Returns the instances of the specified cases.- Parameters:
caseIds
- case IDs, must not be null- Returns:
- instances for the specified cases (never null)
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
createInstance
ICaseDataInstance createInstance(long caseId, String entityName, GUID instanceId, String instanceName) This method creates an instance for a certain case.- Parameters:
caseId
- the id of the case.entityName
- The name of the entity.instanceId
- The id of the instance.instanceName
- The name of the instance.- Returns:
- The newly created instance.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
deleteInstance
void deleteInstance(long instanceId) This method deletes an instance- Parameters:
instanceId
- The id of the instance to delete.- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
getValuesForCase
This method returns all the values belonging to a case.- Parameters:
caseId
- The case id for the values.- Returns:
- All values of the specified case.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
getValuesForInstances
Returns all the values for the specified instances.- Parameters:
instanceIds
- the (persistence) IDs of the instances, must not be null.- Returns:
- the values for the specified instances, never null.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
createValue
This method creates a value for an instance.- Parameters:
instanceId
- The id of the instance.attributeName
- The value attribute.attrValue
- The value of the attribute.- Returns:
- The value model.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
updateValue
This method updates a value of an instance.- Parameters:
instanceId
- The id of the instance.attributeName
- The value attribute.attrValue
- The value of the attribute.- Returns:
- The updated value model.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
deleteValue
This method deletes a value of an instance.- Parameters:
instanceId
- The id of the instance.attributeName
- The name of the attribute.- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
createEvent
ICaseEventModel createEvent(ApplicationID appId, String name, Long caseId, Long taskId, CaseEventType type, CaseEventStatusType status, Date timestamp, String user, Map<String, IValue> content) This method creates a case event.- Parameters:
appId
- The application ID where the event occurred.name
- The name of the event.caseId
- The case id of the case this message is intended for.taskId
- The task id of the task associated with this event (may be null).type
- The type of the event (message or timer).status
- The status of the event (waiting or processed).timestamp
- The timestamp of the event;user
- The user name of the event creator.content
- A Map of custom data to be persisted.- Returns:
- The case event model object.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
replayEvent
Creates a copy of a case event.The following properties are different in the copy compared to the original:
- caseId - is set to the specified caseId
- status - is set to WAITING
- timestamp - is set to current datetime
- user - is set to the specified user
- replayEventId - is set to the id of the original case event
- Parameters:
original
- the original case event.caseId
- optional caseId, may be null.user
- the user that is replaying the event.- Returns:
- the copied event.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
deleteBroadcastEvents
void deleteBroadcastEvents()Deletes all broadcast events. -
findTimerEvent
Returns the timer event associated with the given case and timer task, or null if it does not exist.- Parameters:
caseId
- the case id, must not be null.taskId
- the task id, must not be null.- Returns:
- the timer event or null.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
setCaseEventStatus
This method updates the status of a case event.- Parameters:
caseEvent
- The case event to be updated.status
- The new status.- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
findCaseEventById
This method finds a case event by id.- Parameters:
eventId
- The id of the case event.- Returns:
- The case event.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
findAllCaseEvents
ICaseEventModel[] findAllCaseEvents()This method finds the list all case events.- Returns:
- The list with all case events.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
findCaseEventsByCriteria
This method finds a list of case events by criteria.- Parameters:
criteria
- The case events criteria used for finding case events.- Returns:
- A list of case events.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
findDelayedEvents
Returns events whose processing has been delayed due to the case being locked. The returned events are ordered by timestamp ascending.- Parameters:
caseId
- the ID of the case for which delayed events are retrieved.- Returns:
- the delayed events for the given case, never null.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.- Since:
- 9.6
-
delayEvent
Delays the event with the given id for the case with the given id. If the event with the given id is already delayed for the given case, this method has no effect.- Parameters:
caseId
- the ID of the case.caseEventModel
- the event.- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.- Since:
- 9.6
-
clearDelayedEvent
void clearDelayedEvent(long caseId, long eventId) Notifies the persistence layer that an event is no longer delayed.- Parameters:
caseId
- the ID of the case.eventId
- the ID of the event.- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.- Since:
- 9.6
-
findByCriteria
Finds task views based on the specified criteria.Unlike
IProcessData.findByCriteria(TaskViewCriteria)
, this method does not alter the criteria.- Parameters:
criteria
- the criteria- Returns:
- The task view result object.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
findByCriteria
Finds case views based on the specified criteria.Unlike
IProcessData.findByCriteria(CaseViewCriteria)
, this method does not alter the criteria.- Parameters:
criteria
- the criteria- Returns:
- The case view result object.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.
-
updateCaseApplicationId
Updates the application id of a case.- Parameters:
id
- the id of the case which has to be updatedapplicationId
- the new application id- Returns:
- The model of the case for the specified id, or null if the case could not be found.
-
acquireLock
Method for locking a Case. This method can only lock a case if it not already locked. this is needed in order not override a lock of another user.- Parameters:
caseId
- the id of the case which has to be updatedlockedBy
- The user locking the case.- Returns:
- The updated model of the case for the specified id
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.- Since:
- 11.6.0
-
unlockCase
Method for unlocking a case. This method only unlocks a case if it was locked.- Parameters:
id
- The id of the case to unlock- Returns:
- The updated model for the case.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.- Since:
- 13.13.17
-
updateTaskExitState
Method for updating the taskExitState- Parameters:
taskId
- The id of the task.newExitState
- The new Task Exit State to set- Returns:
- The updated model of the task.
- Throws:
ProcessDataAccessException
- if something goes wrong during the data access operation.- Since:
- 11.11.6
-
isCaseLocked
boolean isCaseLocked(long caseId) Checks is a case is locked in the database- Parameters:
caseId
- the id of the case to check- Returns:
- true if the case is locked, false otherwise
- Since:
- 13.13.17
-
acquireLock(long, String)
andunlockCase(long)
instead