Class NullProcessCaseDao

java.lang.Object
com.aquima.interactions.process.dao.impl.NullProcessCaseDao
All Implemented Interfaces:
IProcessCaseDao

public class NullProcessCaseDao extends Object implements IProcessCaseDao
Empty implementation of IProcessCaseDao which will be used when no other implementation is found. Throws exception whenever it is used, as the process engine needs a proper implementation of the IProcessCaseDao, either the one instantiated by enabling the process-sql-store profile or a custom implementation.
Since:
10.0
Author:
Emoke Olti
  • Constructor Details

    • NullProcessCaseDao

      public NullProcessCaseDao()
  • Method Details

    • getCase

      public ICaseModel getCase(long caseId)
      Description copied from interface: IProcessCaseDao
      This method returns the case for the specified id.
      Specified by:
      getCase in interface IProcessCaseDao
      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.
    • findCases

      public ICaseModel[] findCases(CaseCriteria caseFilter, TaskCriteria taskFilter)
      Description copied from interface: IProcessCaseDao
      This method searches for cases containing tasks matching the filter.
      Specified by:
      findCases in interface IProcessCaseDao
      Parameters:
      caseFilter - The case filter.
      taskFilter - The task filter.
      Returns:
      The matching cases.
    • findCaseIds

      public long[] findCaseIds(CaseCriteria caseFilter, TaskCriteria taskFilter)
      Description copied from interface: IProcessCaseDao
      Searches for cases matching the specified case and task filters and returns their IDs.
      Specified by:
      findCaseIds in interface IProcessCaseDao
      Parameters:
      caseFilter - the filter cases should match
      taskFilter - the filter tasks should match
      Returns:
      the IDs of the matching cases.
    • getCaseState

      public ICaseStateModel getCaseState(long caseId)
      Description copied from interface: IProcessCaseDao
      This method returns the CaseState for the specific case including all tasks that belong to it.
      Specified by:
      getCaseState in interface IProcessCaseDao
      Parameters:
      caseId - the id of the case.
      Returns:
      the caseState model of the specified case or null
    • createCase

      public ICaseModel createCase(String name, String appId, CaseStatusType status, String lockedBy, IMultilingualText displayName)
      Description copied from interface: IProcessCaseDao
      This method creates a case.
      Specified by:
      createCase in interface IProcessCaseDao
      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.
    • updateCase

      public ICaseModel updateCase(long id, CaseStatusType status, String lockedBy)
      Description copied from interface: IProcessCaseDao
      This method updates a case.
      Specified by:
      updateCase in interface IProcessCaseDao
      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.
    • updateCaseDisplayName

      public ICaseModel updateCaseDisplayName(long id, IMultilingualText displayName)
      Description copied from interface: IProcessCaseDao
      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
      Specified by:
      updateCaseDisplayName in interface IProcessCaseDao
      Parameters:
      id - The id of the case.
      displayName - the display name to set
      Returns:
      The model for the case.
    • updateTaskDisplayName

      public ITaskModel updateTaskDisplayName(long taskId, IMultilingualText displayName)
      Description copied from interface: IProcessCaseDao
      Updates the display name of the task with the specified id.
      Specified by:
      updateTaskDisplayName in interface IProcessCaseDao
      Parameters:
      taskId - the id of the task
      displayName - the display name
      Returns:
      the updated task model
    • deleteCase

      public void deleteCase(long id)
      Description copied from interface: IProcessCaseDao
      This method deletes a case.
      Specified by:
      deleteCase in interface IProcessCaseDao
      Parameters:
      id - The id of the case.
    • getTask

      public ITaskModel getTask(long id)
      Description copied from interface: IProcessCaseDao
      This method returns the task of a certain id.
      Specified by:
      getTask in interface IProcessCaseDao
      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.
    • findTasks

      public ITaskModel[] findTasks(TaskCriteria taskFilter)
      Description copied from interface: IProcessCaseDao
      This method searches for tasks matching the task filter.
      Specified by:
      findTasks in interface IProcessCaseDao
      Parameters:
      taskFilter - The filter tasks should match.
      Returns:
      The models of tasks matching the filter.
    • findExtendedTasks

      public ITaskQueryResult[] findExtendedTasks(TaskCriteria taskFilter)
      Description copied from interface: IProcessCaseDao
      This method searches for tasks matching the task filter.
      Specified by:
      findExtendedTasks in interface IProcessCaseDao
      Parameters:
      taskFilter - The filter tasks should match.
      Returns:
      The result of the tasks, case and values.
    • findExtendedCases

      public ICaseQueryResult[] findExtendedCases(CaseCriteria caseFilter)
      Description copied from interface: IProcessCaseDao
      This method searches for cases matching the task filter.
      Specified by:
      findExtendedCases in interface IProcessCaseDao
      Parameters:
      caseFilter - The filter cases should match.
      Returns:
      The result of the case and values.
    • getTasksForCase

      public ITaskModel[] getTasksForCase(long caseId)
      Description copied from interface: IProcessCaseDao
      This method returns the tasks of a certain case.
      Specified by:
      getTasksForCase in interface IProcessCaseDao
      Parameters:
      caseId - The id of the case.
      Returns:
      The models of the tasks belonging to the case.
    • getChildTasks

      public ITaskModel[] getChildTasks(long parentTaskId)
      Description copied from interface: IProcessCaseDao
      This method returns the child tasks of a certain task.
      Specified by:
      getChildTasks in interface IProcessCaseDao
      Parameters:
      parentTaskId - The id of the parent task.
      Returns:
      The models of the tasks being a child of the parent.
    • createTask

      public 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)
      Description copied from interface: IProcessCaseDao
      This method creates a task.
      Specified by:
      createTask in interface IProcessCaseDao
      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.
    • updateTask

      public ITaskModel updateTask(long taskId, TaskStatusType status, IAssigneeInfo assigneeInfo, DateTimeValue timeoutDate, String exitState, String executedBy, boolean isRequired, boolean isUserSet, Integer priority, DateTimeValue lastPriorityCheck, IMultilingualText displayName)
      Description copied from interface: IProcessCaseDao
      This method updates a task with the specified id.
      Specified by:
      updateTask in interface IProcessCaseDao
      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.
    • updateStartDate

      public ITaskModel updateStartDate(long taskId, DateTimeValue startDate)
      Description copied from interface: IProcessCaseDao
      This methods updates the start date of the task.
      Specified by:
      updateStartDate in interface IProcessCaseDao
      Parameters:
      taskId - The id of the task.
      startDate - The start date of the task.
      Returns:
      the updated model of the task.
    • updateDueDate

      public ITaskModel updateDueDate(long taskId, DateTimeValue dueDate)
      Description copied from interface: IProcessCaseDao
      This methods updates the due date of the task.
      Specified by:
      updateDueDate in interface IProcessCaseDao
      Parameters:
      taskId - The id of the task.
      dueDate - The due date of the task.
      Returns:
      the updated model of the task.
    • updateTimeoutDate

      public ITaskModel updateTimeoutDate(long taskId, DateTimeValue timeoutDate)
      Description copied from interface: IProcessCaseDao
      This methods updates the timeout date of the task.
      Specified by:
      updateTimeoutDate in interface IProcessCaseDao
      Parameters:
      taskId - The id of the task.
      timeoutDate - The timeout date of the task.
      Returns:
      the updated model of the task.
    • updatePriority

      public ITaskModel updatePriority(long taskId, Integer priority, DateTimeValue lastPriorityCheck)
      Description copied from interface: IProcessCaseDao
      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.
      Specified by:
      updatePriority in interface IProcessCaseDao
      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.
    • updateLastPriorityCheck

      public ITaskModel updateLastPriorityCheck(long taskId, DateTimeValue lastPriorityCheck)
      Description copied from interface: IProcessCaseDao
      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.
      Specified by:
      updateLastPriorityCheck in interface IProcessCaseDao
      Parameters:
      taskId - The id of the task.
      lastPriorityCheck - the last time priority was checked.
      Returns:
      the updated model of the task.
    • updateTaskUnauthorizedUsers

      public ITaskModel updateTaskUnauthorizedUsers(long taskId, String[] unauthorizedUsers)
      Description copied from interface: IProcessCaseDao
      This method updates the unauthorizedUsers property of a task.
      Specified by:
      updateTaskUnauthorizedUsers in interface IProcessCaseDao
      Parameters:
      taskId - the id of the task
      unauthorizedUsers - the unauthorized users
      Returns:
      The model of the task.
    • getInstancesForCase

      public ICaseDataInstance[] getInstancesForCase(long caseId)
      Description copied from interface: IProcessCaseDao
      This method returns the instances of a certain case.
      Specified by:
      getInstancesForCase in interface IProcessCaseDao
      Parameters:
      caseId - The id of the case.
      Returns:
      The instances for the specified case.
    • getInstancesForCases

      public ICaseDataInstance[] getInstancesForCases(long[] caseIds)
      Description copied from interface: IProcessCaseDao
      Returns the instances of the specified cases.
      Specified by:
      getInstancesForCases in interface IProcessCaseDao
      Parameters:
      caseIds - case IDs, must not be null
      Returns:
      instances for the specified cases (never null)
    • createInstance

      public ICaseDataInstance createInstance(long caseId, String entityName, GUID instanceId, String instanceName)
      Description copied from interface: IProcessCaseDao
      This method creates an instance for a certain case.
      Specified by:
      createInstance in interface IProcessCaseDao
      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.
    • deleteInstance

      public void deleteInstance(long instanceId)
      Description copied from interface: IProcessCaseDao
      This method deletes an instance
      Specified by:
      deleteInstance in interface IProcessCaseDao
      Parameters:
      instanceId - The id of the instance to delete.
    • getValuesForCase

      public ICaseDataValue[] getValuesForCase(long caseId)
      Description copied from interface: IProcessCaseDao
      This method returns all the values belonging to a case.
      Specified by:
      getValuesForCase in interface IProcessCaseDao
      Parameters:
      caseId - The case id for the values.
      Returns:
      All values of the specified case.
    • getValuesForInstances

      public ICaseDataValue[] getValuesForInstances(long[] instanceIds)
      Description copied from interface: IProcessCaseDao
      Returns all the values for the specified instances.
      Specified by:
      getValuesForInstances in interface IProcessCaseDao
      Parameters:
      instanceIds - the (persistence) IDs of the instances, must not be null.
      Returns:
      the values for the specified instances, never null.
    • createValue

      public ICaseDataValue createValue(long instanceId, String attributeName, IValue attrValue)
      Description copied from interface: IProcessCaseDao
      This method creates a value for an instance.
      Specified by:
      createValue in interface IProcessCaseDao
      Parameters:
      instanceId - The id of the instance.
      attributeName - The value attribute.
      attrValue - The value of the attribute.
      Returns:
      The value model.
    • updateValue

      public ICaseDataValue updateValue(long instanceId, String attributeName, IValue attrValue)
      Description copied from interface: IProcessCaseDao
      This method updates a value of an instance.
      Specified by:
      updateValue in interface IProcessCaseDao
      Parameters:
      instanceId - The id of the instance.
      attributeName - The value attribute.
      attrValue - The value of the attribute.
      Returns:
      The updated value model.
    • deleteValue

      public void deleteValue(long instanceId, String attributeName)
      Description copied from interface: IProcessCaseDao
      This method deletes a value of an instance.
      Specified by:
      deleteValue in interface IProcessCaseDao
      Parameters:
      instanceId - The id of the instance.
      attributeName - The name of the attribute.
    • createEvent

      public ICaseEventModel createEvent(ApplicationID appId, String name, Long caseId, Long taskId, CaseEventType type, CaseEventStatusType status, Date timestamp, String user, Map<String,IValue> content)
      Description copied from interface: IProcessCaseDao
      This method creates a case event.
      Specified by:
      createEvent in interface IProcessCaseDao
      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.
    • replayEvent

      public ICaseEventModel replayEvent(ICaseEventModel original, Long caseId, String user)
      Description copied from interface: IProcessCaseDao
      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
      Specified by:
      replayEvent in interface IProcessCaseDao
      Parameters:
      original - the original case event.
      caseId - optional caseId, may be null.
      user - the user that is replaying the event.
      Returns:
      the copied event.
    • deleteBroadcastEvents

      public void deleteBroadcastEvents()
      Description copied from interface: IProcessCaseDao
      Deletes all broadcast events.
      Specified by:
      deleteBroadcastEvents in interface IProcessCaseDao
    • findTimerEvent

      public ICaseEventModel findTimerEvent(Long caseId, Long taskId)
      Description copied from interface: IProcessCaseDao
      Returns the timer event associated with the given case and timer task, or null if it does not exist.
      Specified by:
      findTimerEvent in interface IProcessCaseDao
      Parameters:
      caseId - the case id, must not be null.
      taskId - the task id, must not be null.
      Returns:
      the timer event or null.
    • setCaseEventStatus

      public void setCaseEventStatus(ICaseEventModel caseEvent, CaseEventStatusType status)
      Description copied from interface: IProcessCaseDao
      This method updates the status of a case event.
      Specified by:
      setCaseEventStatus in interface IProcessCaseDao
      Parameters:
      caseEvent - The case event to be updated.
      status - The new status.
    • findCaseEventById

      public ICaseEventModel findCaseEventById(Long eventId)
      Description copied from interface: IProcessCaseDao
      This method finds a case event by id.
      Specified by:
      findCaseEventById in interface IProcessCaseDao
      Parameters:
      eventId - The id of the case event.
      Returns:
      The case event.
    • findAllCaseEvents

      public ICaseEventModel[] findAllCaseEvents()
      Description copied from interface: IProcessCaseDao
      This method finds the list all case events.
      Specified by:
      findAllCaseEvents in interface IProcessCaseDao
      Returns:
      The list with all case events.
    • findCaseEventsByCriteria

      public ICaseEventModel[] findCaseEventsByCriteria(CaseEventCriteria criteria)
      Description copied from interface: IProcessCaseDao
      This method finds a list of case events by criteria.
      Specified by:
      findCaseEventsByCriteria in interface IProcessCaseDao
      Parameters:
      criteria - The case events criteria used for finding case events.
      Returns:
      A list of case events.
    • findDelayedEvents

      public ICaseEventModel[] findDelayedEvents(long caseId)
      Description copied from interface: IProcessCaseDao
      Returns events whose processing has been delayed due to the case being locked. The returned events are ordered by timestamp ascending.
      Specified by:
      findDelayedEvents in interface IProcessCaseDao
      Parameters:
      caseId - the ID of the case for which delayed events are retrieved.
      Returns:
      the delayed events for the given case, never null.
    • delayEvent

      public void delayEvent(long caseId, ICaseEventModel caseEventModel)
      Description copied from interface: IProcessCaseDao
      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.
      Specified by:
      delayEvent in interface IProcessCaseDao
      Parameters:
      caseId - the ID of the case.
      caseEventModel - the event.
    • clearDelayedEvent

      public void clearDelayedEvent(long caseId, long eventId)
      Description copied from interface: IProcessCaseDao
      Notifies the persistence layer that an event is no longer delayed.
      Specified by:
      clearDelayedEvent in interface IProcessCaseDao
      Parameters:
      caseId - the ID of the case.
      eventId - the ID of the event.
    • findByCriteria

      public TaskViewResult findByCriteria(TaskViewCriteria criteria)
      Description copied from interface: IProcessCaseDao
      Finds task views based on the specified criteria.

      Unlike IProcessData.findByCriteria(TaskViewCriteria), this method does not alter the criteria.

      Specified by:
      findByCriteria in interface IProcessCaseDao
      Parameters:
      criteria - the criteria
      Returns:
      The task view result object.
    • findByCriteria

      public CaseViewResult findByCriteria(CaseViewCriteria criteria)
      Description copied from interface: IProcessCaseDao
      Finds case views based on the specified criteria.

      Unlike IProcessData.findByCriteria(CaseViewCriteria), this method does not alter the criteria.

      Specified by:
      findByCriteria in interface IProcessCaseDao
      Parameters:
      criteria - the criteria
      Returns:
      The case view result object.
    • updateCaseApplicationId

      public ICaseModel updateCaseApplicationId(long id, String applicationId)
      Description copied from interface: IProcessCaseDao
      Updates the application id of a case.
      Specified by:
      updateCaseApplicationId in interface IProcessCaseDao
      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

      public ICaseModel acquireLock(long id, String lockedBy)
      Description copied from interface: IProcessCaseDao
      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.
      Specified by:
      acquireLock in interface IProcessCaseDao
      Parameters:
      id - 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
    • unlockCase

      public ICaseModel unlockCase(long id)
      Description copied from interface: IProcessCaseDao
      Method for unlocking a case. This method only unlocks a case if it was locked.
      Specified by:
      unlockCase in interface IProcessCaseDao
      Parameters:
      id - The id of the case to unlock
      Returns:
      The updated model for the case.
    • updateTaskExitState

      public ITaskModel updateTaskExitState(long taskId, String newExitState)
      Description copied from interface: IProcessCaseDao
      Method for updating the taskExitState
      Specified by:
      updateTaskExitState in interface IProcessCaseDao
      Parameters:
      taskId - The id of the task.
      newExitState - The new Task Exit State to set
      Returns:
      The updated model of the task.
    • isCaseLocked

      public boolean isCaseLocked(long caseId)
      Description copied from interface: IProcessCaseDao
      Checks is a case is locked in the database
      Specified by:
      isCaseLocked in interface IProcessCaseDao
      Parameters:
      caseId - the id of the case to check
      Returns:
      true if the case is locked, false otherwise