Package org.flowable.cmmn.api

# Interface CmmnHistoryService

public interface CmmnHistoryService

Author:
  Joram Barrez

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `bulkDeleteHistoricCaseInstances(Collection<String> caseInstanceIds)`
  `CaseReactivationBuilder`
  `createCaseReactivationBuilder(String caseInstanceId)`
  Creates a new case reactivation builder used to reactivate an archived / finished case with various options.
  `HistoricCaseInstanceQuery`
  `createHistoricCaseInstanceQuery()`
  `HistoricMilestoneInstanceQuery`
  `createHistoricMilestoneInstanceQuery()`
  `HistoricPlanItemInstanceQuery`
  `createHistoricPlanItemInstanceQuery()`
  `HistoricTaskInstanceQuery`
  `createHistoricTaskInstanceQuery()`
  `HistoricTaskLogEntryBuilder`
  `createHistoricTaskLogEntryBuilder()`
  Create new task log entry builder to the log task event without predefined values from the task
  `HistoricTaskLogEntryBuilder`
  `createHistoricTaskLogEntryBuilder(TaskInfo task)`
  Create new task log entry builder to the log task event
  `HistoricTaskLogEntryQuery`
  `createHistoricTaskLogEntryQuery()`
  Returns a new `HistoricTaskLogEntryQuery` that can be used to dynamically query task log entries.
  `HistoricVariableInstanceQuery`
  `createHistoricVariableInstanceQuery()`
  `NativeHistoricTaskLogEntryQuery`
  `createNativeHistoricTaskLogEntryQuery()`
  Returns a new `NativeHistoricTaskLogEntryQuery` for `HistoricTaskLogEntry`s.
  `void`
  `deleteHistoricCaseInstance(String caseInstanceId)`
  `void`
  `deleteHistoricTaskInstance(String taskId)`
  Deletes historic task instance.
  `void`
  `deleteHistoricTaskLogEntry(long logNumber)`
  Deletes user task log entry by its log number
  `List<org.flowable.entitylink.api.history.HistoricEntityLink>`
  `getHistoricEntityLinkChildrenForCaseInstance(String caseInstanceId)`
  Retrieves the `HistoricEntityLink`s associated with the given case instance.
  `List<org.flowable.entitylink.api.history.HistoricEntityLink>`
  `getHistoricEntityLinkChildrenForTask(String taskId)`
  Retrieves the `HistoricEntityLink`s associated with the given task.
  `List<org.flowable.entitylink.api.history.HistoricEntityLink>`
  `getHistoricEntityLinkChildrenWithSameRootAsCaseInstance(String caseInstanceId)`
  Retrieves all the `HistoricEntityLink`s associated with same root as the given case instance.
  `List<org.flowable.entitylink.api.history.HistoricEntityLink>`
  `getHistoricEntityLinkParentsForCaseInstance(String caseInstanceId)`
  Retrieves the `HistoricEntityLink`s where the given case instance is referenced.
  `List<org.flowable.entitylink.api.history.HistoricEntityLink>`
  `getHistoricEntityLinkParentsForTask(String taskId)`
  Retrieves the `HistoricEntityLink`s where the given task is referenced.
  `List<HistoricIdentityLink>`
  `getHistoricIdentityLinksForCaseInstance(String caseInstanceId)`
  Retrieves the `HistoricIdentityLink`s associated with the given case instance.
  `List<HistoricIdentityLink>`
  `getHistoricIdentityLinksForPlanItemInstance(String planItemInstanceId)`
  Retrieves the `HistoricIdentityLink`s associated with the given plan item instance.
  `List<HistoricIdentityLink>`
  `getHistoricIdentityLinksForTask(String taskId)`
  Retrieves the `HistoricIdentityLink`s associated with the given task.
  `List<StageResponse>`
  `getStageOverview(String caseInstanceId)`
  Gives back a stage overview of the historic case instance which includes the stage information of the case model.

- ## Method Details

  - ### createHistoricCaseInstanceQuery

    HistoricCaseInstanceQuery createHistoricCaseInstanceQuery()

  - ### createHistoricMilestoneInstanceQuery

    HistoricMilestoneInstanceQuery createHistoricMilestoneInstanceQuery()

  - ### createHistoricVariableInstanceQuery

    HistoricVariableInstanceQuery createHistoricVariableInstanceQuery()

  - ### createHistoricTaskInstanceQuery

    HistoricTaskInstanceQuery createHistoricTaskInstanceQuery()

  - ### createHistoricPlanItemInstanceQuery

    HistoricPlanItemInstanceQuery createHistoricPlanItemInstanceQuery()

  - ### getStageOverview

    List<StageResponse> getStageOverview(String caseInstanceId)
    Gives back a stage overview of the historic case instance which includes the stage information of the case model.
    Parameters:
      `caseInstanceId` - id of the case instance, cannot be null.
    Returns:
      list of stage info objects
    Throws:
      `FlowableObjectNotFoundException` - when the case instance doesn't exist.

  - ### deleteHistoricCaseInstance

    void deleteHistoricCaseInstance(String caseInstanceId)

  - ### bulkDeleteHistoricCaseInstances

    void bulkDeleteHistoricCaseInstances(Collection<String> caseInstanceIds)

  - ### deleteHistoricTaskInstance

    void deleteHistoricTaskInstance(String taskId)
    Deletes historic task instance. This might be useful for tasks that are `dynamically created` and then `completed`. If the historic task instance doesn't exist, no exception is thrown and the method returns normal.

  - ### createCaseReactivationBuilder

    CaseReactivationBuilder createCaseReactivationBuilder(String caseInstanceId)
    Creates a new case reactivation builder used to reactivate an archived / finished case with various options.
    Parameters:
      `caseInstanceId` - the id of the historical case to be reactivated
    Returns:
      the case reactivation builder

  - ### getHistoricIdentityLinksForTask

    List<HistoricIdentityLink> getHistoricIdentityLinksForTask(String taskId)
    Retrieves the `HistoricIdentityLink`s associated with the given task. Such an `IdentityLink` informs how a certain identity (eg. group or user) is associated with a certain task (eg. as candidate, assignee, etc.), even if the task is completed as opposed to `IdentityLink`s which only exist for active tasks.

  - ### getHistoricIdentityLinksForCaseInstance

    List<HistoricIdentityLink> getHistoricIdentityLinksForCaseInstance(String caseInstanceId)
    Retrieves the `HistoricIdentityLink`s associated with the given case instance. Such an `IdentityLink` informs how a certain identity (eg. group or user) is associated with a certain case instance, even if the instance is completed as opposed to `IdentityLink`s which only exist for active instances.

  - ### getHistoricIdentityLinksForPlanItemInstance

    List<HistoricIdentityLink> getHistoricIdentityLinksForPlanItemInstance(String planItemInstanceId)
    Retrieves the `HistoricIdentityLink`s associated with the given plan item instance. Such an `IdentityLink` informs how a certain identity (eg. group or user) is associated with a certain case instance, even if the instance is completed as opposed to `IdentityLink`s which only exist for active instances.

  - ### getHistoricEntityLinkChildrenForCaseInstance

    List<org.flowable.entitylink.api.history.HistoricEntityLink> getHistoricEntityLinkChildrenForCaseInstance(String caseInstanceId)
    Retrieves the `HistoricEntityLink`s associated with the given case instance.

  - ### getHistoricEntityLinkChildrenWithSameRootAsCaseInstance

    List<org.flowable.entitylink.api.history.HistoricEntityLink> getHistoricEntityLinkChildrenWithSameRootAsCaseInstance(String caseInstanceId)
    Retrieves all the `HistoricEntityLink`s associated with same root as the given case instance.

  - ### getHistoricEntityLinkParentsForCaseInstance

    List<org.flowable.entitylink.api.history.HistoricEntityLink> getHistoricEntityLinkParentsForCaseInstance(String caseInstanceId)
    Retrieves the `HistoricEntityLink`s where the given case instance is referenced.

  - ### getHistoricEntityLinkChildrenForTask

    List<org.flowable.entitylink.api.history.HistoricEntityLink> getHistoricEntityLinkChildrenForTask(String taskId)
    Retrieves the `HistoricEntityLink`s associated with the given task.

  - ### getHistoricEntityLinkParentsForTask

    List<org.flowable.entitylink.api.history.HistoricEntityLink> getHistoricEntityLinkParentsForTask(String taskId)
    Retrieves the `HistoricEntityLink`s where the given task is referenced.

  - ### deleteHistoricTaskLogEntry

    void deleteHistoricTaskLogEntry(long logNumber)
    Deletes user task log entry by its log number
    Parameters:
      `logNumber` - user task log entry identifier

  - ### createHistoricTaskLogEntryBuilder

    HistoricTaskLogEntryBuilder createHistoricTaskLogEntryBuilder(TaskInfo task)
    Create new task log entry builder to the log task event
    Parameters:
      `task` - to which is log related to

  - ### createHistoricTaskLogEntryBuilder

    HistoricTaskLogEntryBuilder createHistoricTaskLogEntryBuilder()
    Create new task log entry builder to the log task event without predefined values from the task

  - ### createHistoricTaskLogEntryQuery

    HistoricTaskLogEntryQuery createHistoricTaskLogEntryQuery()
    Returns a new `HistoricTaskLogEntryQuery` that can be used to dynamically query task log entries.

  - ### createNativeHistoricTaskLogEntryQuery

    NativeHistoricTaskLogEntryQuery createNativeHistoricTaskLogEntryQuery()
    Returns a new `NativeHistoricTaskLogEntryQuery` for `HistoricTaskLogEntry`s.