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 Details

    • getCase

      ICaseModel getCase(long caseId)
      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

      ICaseModel[] findCases(CaseCriteria caseFilter, TaskCriteria taskFilter)
      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

      long[] findCaseIds(CaseCriteria caseFilter, TaskCriteria taskFilter)
      Searches for cases matching the specified case and task filters and returns their IDs.
      Parameters:
      caseFilter - the filter cases should match
      taskFilter - the filter tasks should match
      Returns:
      the IDs of the matching cases.
      Throws:
      ProcessDataAccessException - if something goes wrong during the data access operation.
    • getCaseState

      ICaseStateModel getCaseState(long caseId)
      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 ICaseModel updateCase(long id, CaseStatusType status, String lockedBy)
      Deprecated.
      this method was used for locking/unlocking a case, use acquireLock(long, String) and unlockCase(long) instead
      This 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

      ICaseModel 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 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

      ITaskModel updateTaskDisplayName(long taskId, IMultilingualText displayName)
      Updates the display name of the task with the specified id.
      Parameters:
      taskId - the id of the task
      displayName - 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

      ITaskModel getTask(long id)
      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

      ITaskModel[] findTasks(TaskCriteria taskFilter)
      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

      ITaskQueryResult[] findExtendedTasks(TaskCriteria taskFilter)
      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

      ICaseQueryResult[] findExtendedCases(CaseCriteria caseFilter)
      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

      ITaskModel[] getTasksForCase(long caseId)
      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

      ITaskModel[] getChildTasks(long parentTaskId)
      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 task
      exitState - 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 algorithm
      priority - The priority of the task.
      lastPriorityCheck - The last date priority was checked.
      properties - properties
      unauthorizedUserIds - ids of users that are unauthorized
      displayName - 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

      ITaskModel updateStartDate(long taskId, DateTimeValue startDate)
      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

      ITaskModel updateDueDate(long taskId, DateTimeValue dueDate)
      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

      ITaskModel updateTimeoutDate(long taskId, DateTimeValue timeoutDate)
      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

      ITaskModel updatePriority(long taskId, Integer priority, DateTimeValue lastPriorityCheck)
      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 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.
    • updateLastPriorityCheck

      ITaskModel updateLastPriorityCheck(long taskId, DateTimeValue lastPriorityCheck)
      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

      ITaskModel updateTaskUnauthorizedUsers(long taskId, String[] unauthorizedUsers)
      This method updates the unauthorizedUsers property of a task.
      Parameters:
      taskId - the id of the task
      unauthorizedUsers - the unauthorized users
      Returns:
      The model of the task.
      Throws:
      ProcessDataAccessException - if something goes wrong during the data access operation.
    • getInstancesForCase

      ICaseDataInstance[] getInstancesForCase(long caseId)
      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

      ICaseDataInstance[] getInstancesForCases(long[] caseIds)
      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

      ICaseDataValue[] getValuesForCase(long caseId)
      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

      ICaseDataValue[] getValuesForInstances(long[] instanceIds)
      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

      ICaseDataValue createValue(long instanceId, String attributeName, IValue attrValue)
      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

      ICaseDataValue updateValue(long instanceId, String attributeName, IValue attrValue)
      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

      void deleteValue(long instanceId, String attributeName)
      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

      ICaseEventModel replayEvent(ICaseEventModel original, Long caseId, String user)
      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

      ICaseEventModel findTimerEvent(Long caseId, Long taskId)
      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

      void setCaseEventStatus(ICaseEventModel caseEvent, CaseEventStatusType status)
      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

      ICaseEventModel findCaseEventById(Long eventId)
      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

      ICaseEventModel[] findCaseEventsByCriteria(CaseEventCriteria criteria)
      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

      ICaseEventModel[] findDelayedEvents(long caseId)
      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

      void delayEvent(long caseId, ICaseEventModel caseEventModel)
      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

      TaskViewResult findByCriteria(TaskViewCriteria criteria)
      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

      CaseViewResult findByCriteria(CaseViewCriteria criteria)
      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

      ICaseModel updateCaseApplicationId(long id, String applicationId)
      Updates the application id of a case.
      Parameters:
      id - the id of the case which has to be updated
      applicationId - the new application id
      Returns:
      The model of the case for the specified id, or null if the case could not be found.
    • acquireLock

      ICaseModel acquireLock(long caseId, String lockedBy)
      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 updated
      lockedBy - 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

      ICaseModel unlockCase(long id)
      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

      ITaskModel updateTaskExitState(long taskId, String newExitState)
      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