Package org.flowable.cmmn.api.migration

# Interface CaseInstanceMigrationBuilder

public interface CaseInstanceMigrationBuilder

Author:
  Valentin Zickner

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CaseInstanceMigrationBuilder`
  `addActivatePlanItemDefinitionMapping(ActivatePlanItemDefinitionMapping mapping)`
  Adds an activate plan item definition mapping to the case instance migration plan.
  `CaseInstanceMigrationBuilder`
  `addChangePlanItemDefinitionWithNewTargetIdsMapping(ChangePlanItemDefinitionWithNewTargetIdsMapping mapping)`
  Adds a mapping for a plan item definition id to a new plan item id and definition id to change the plan item id.
  `CaseInstanceMigrationBuilder`
  `addChangePlanItemIdMapping(ChangePlanItemIdMapping mapping)`
  Adds a mapping for a plan item id to new plan item id.
  `CaseInstanceMigrationBuilder`
  `addChangePlanItemIdWithDefinitionIdMapping(ChangePlanItemIdWithDefinitionIdMapping mapping)`
  Adds a mapping for a plan item definition id to a new plan item definition id to change the plan item id.
  `CaseInstanceMigrationBuilder`
  `addMoveToAvailablePlanItemDefinitionMapping(MoveToAvailablePlanItemDefinitionMapping mapping)`
  Adds a move to available plan item definition mapping to the case instance migration plan.
  `CaseInstanceMigrationBuilder`
  `addTerminatePlanItemDefinitionMapping(TerminatePlanItemDefinitionMapping mapping)`
  Adds a terminate plan item definition mapping to the case instance migration plan.
  `CaseInstanceMigrationBuilder`
  `addWaitingForRepetitionPlanItemDefinitionMapping(WaitingForRepetitionPlanItemDefinitionMapping mapping)`
  Adds a waiting for repetition plan item definition mapping to the case instance migration plan.
  `Batch`
  `batchMigrateCaseInstances(String caseDefinitionId)`
  Starts the case instance migration for all case instances of a given case definition identified by the case definition id.
  `Batch`
  `batchMigrateCaseInstances(String caseDefinitionKey, int caseDefinitionVersion, String caseDefinitionTenantId)`
  Asynchronously starts the case instance migration for each case instances of a given case definition identified by the case definition key and version (optional tenantId).
  `CaseInstanceMigrationBuilder`
  `fromCaseInstanceMigrationDocument(CaseInstanceMigrationDocument caseInstanceMigrationDocument)`
  Creates a CaseInstanceMigrationBuilder using the values of a CaseInstanceMigrationDocument
  `CaseInstanceMigrationDocument`
  `getCaseInstanceMigrationDocument()`
  Builds a CaseInstanceMigrationDocument
  `void`
  `migrate(String caseInstanceId)`
  Starts the case instance migration for a case identified with the submitted caseInstanceId
  `void`
  `migrateCaseInstances(String caseDefinitionId)`
  Asynchronously starts the case instance migration for each case instances of a given case definition identified by the case definition id.
  `void`
  `migrateCaseInstances(String caseDefinitionKey, int caseDefinitionVersion, String caseDefinitionTenantId)`
  Starts the case instance migration for all case instances of a given case definition identified by the case definition key and version (optional tenantId).
  `CaseInstanceMigrationBuilder`
  `migrateToCaseDefinition(String caseDefinitionId)`
  Specifies the case definition to migrate to, using the case definition id
  `CaseInstanceMigrationBuilder`
  `migrateToCaseDefinition(String caseDefinitionKey, int caseDefinitionVersion)`
  Specifies the case definition to migrate to, identified by its key and version
  `CaseInstanceMigrationBuilder`
  `migrateToCaseDefinition(String caseDefinitionKey, int caseDefinitionVersion, String caseDefinitionTenantId)`
  Specifies the case definition to migrate to, identified by its key and version and tenantId
  `CaseInstanceMigrationBuilder`
  `removeWaitingForRepetitionPlanItemDefinitionMapping(RemoveWaitingForRepetitionPlanItemDefinitionMapping mapping)`
  Removes a waiting for repetition plan item definition mapping to the case instance migration plan.
  `CaseInstanceMigrationValidationResult`
  `validateMigration(String caseInstanceId)`
  Validates this case instance migration instructions for a given case instance identified by its caseInstanceId
  `CaseInstanceMigrationValidationResult`
  `validateMigrationOfCaseInstances(String caseDefinitionId)`
  Validates this case instance migration instruction for each case instance of a given case definition identified by the case definition id.
  `CaseInstanceMigrationValidationResult`
  `validateMigrationOfCaseInstances(String caseDefinitionKey, int caseDefinitionVersion, String caseDefinitionTenantId)`
  Validates this case instance migration instruction for each case instance of a given case definition identified by the case definition key and version (optional tenantId).
  `CaseInstanceMigrationBuilder`
  `withCaseInstanceVariable(String variableName, Object variableValue)`
  Specifies a case instance variable that will also be available during the case migration
  `CaseInstanceMigrationBuilder`
  `withCaseInstanceVariables(Map<String,Object> variables)`
  Specified case instances variables that will also be available during case migration
  `CaseInstanceMigrationBuilder`
  `withMigrateToCaseDefinitionTenantId(String caseDefinitionTenantId)`
  Specifies the tenantId of the case definition to migrate to
  `CaseInstanceMigrationBuilder`
  `withPostUpgradeExpression(String postUpgradeExpression)`
  Specifies an expression which is executed after the migration is finished.
  `CaseInstanceMigrationBuilder`
  `withPreUpgradeExpression(String preUpgradeExpression)`
  Specifies an expression which is executed before the migration starts.

- ## Method Details

  - ### fromCaseInstanceMigrationDocument

    CaseInstanceMigrationBuilder fromCaseInstanceMigrationDocument(CaseInstanceMigrationDocument caseInstanceMigrationDocument)
    Creates a CaseInstanceMigrationBuilder using the values of a CaseInstanceMigrationDocument
    Parameters:
      `caseInstanceMigrationDocument` - Migration document with pre-filled case information
    Returns:
      Returns the builder
    See Also:
      - `CaseInstanceMigrationDocument`

  - ### migrateToCaseDefinition

    CaseInstanceMigrationBuilder migrateToCaseDefinition(String caseDefinitionId)
    Specifies the case definition to migrate to, using the case definition id
    Parameters:
      `caseDefinitionId` - ID of the case definition to migrate to
    Returns:
      Returns the builder
    See Also:
      - `CaseDefinition`

  - ### migrateToCaseDefinition

    CaseInstanceMigrationBuilder migrateToCaseDefinition(String caseDefinitionKey, int caseDefinitionVersion)
    Specifies the case definition to migrate to, identified by its key and version
    Parameters:
      `caseDefinitionKey` - Key of the case definition to migrate to
      `caseDefinitionVersion` - Version of the case to migrate to
    Returns:
      Returns the builder
    See Also:
      - `CaseDefinition`

  - ### migrateToCaseDefinition

    CaseInstanceMigrationBuilder migrateToCaseDefinition(String caseDefinitionKey, int caseDefinitionVersion, String caseDefinitionTenantId)
    Specifies the case definition to migrate to, identified by its key and version and tenantId
    Parameters:
      `caseDefinitionKey` - Key of the case definition to migrate to
      `caseDefinitionVersion` - Version of the case to migrate to
      `caseDefinitionTenantId` - Tenant id of the case definition, must be part of the same tenant
    Returns:
      Returns the builder
    See Also:
      - `CaseDefinition`

  - ### withMigrateToCaseDefinitionTenantId

    CaseInstanceMigrationBuilder withMigrateToCaseDefinitionTenantId(String caseDefinitionTenantId)
    Specifies the tenantId of the case definition to migrate to
    Parameters:
      `caseDefinitionTenantId` - Tenant id of the case definition, must be part of the same tenant
    Returns:
      Returns the builder

  - ### addActivatePlanItemDefinitionMapping

    CaseInstanceMigrationBuilder addActivatePlanItemDefinitionMapping(ActivatePlanItemDefinitionMapping mapping)
    Adds an activate plan item definition mapping to the case instance migration plan.
    Parameters:
      `mapping` - Mapping for a specific plan item definition
    Returns:
      Returns the builder
    See Also:
      - `ActivatePlanItemDefinitionMapping`

  - ### addTerminatePlanItemDefinitionMapping

    CaseInstanceMigrationBuilder addTerminatePlanItemDefinitionMapping(TerminatePlanItemDefinitionMapping mapping)
    Adds a terminate plan item definition mapping to the case instance migration plan.
    Parameters:
      `mapping` - Mapping for a specific plan item definition
    Returns:
      Returns the builder
    See Also:
      - `TerminatePlanItemDefinitionMapping`

  - ### addMoveToAvailablePlanItemDefinitionMapping

    CaseInstanceMigrationBuilder addMoveToAvailablePlanItemDefinitionMapping(MoveToAvailablePlanItemDefinitionMapping mapping)
    Adds a move to available plan item definition mapping to the case instance migration plan.
    Parameters:
      `mapping` - Mapping for a specific plan item definition
    Returns:
      Returns the builder
    See Also:
      - `MoveToAvailablePlanItemDefinitionMapping`

  - ### addWaitingForRepetitionPlanItemDefinitionMapping

    CaseInstanceMigrationBuilder addWaitingForRepetitionPlanItemDefinitionMapping(WaitingForRepetitionPlanItemDefinitionMapping mapping)
    Adds a waiting for repetition plan item definition mapping to the case instance migration plan.
    Parameters:
      `mapping` - Mapping for a specific plan item definition
    Returns:
      Returns the builder
    See Also:
      - `WaitingForRepetitionPlanItemDefinitionMapping`

  - ### removeWaitingForRepetitionPlanItemDefinitionMapping

    CaseInstanceMigrationBuilder removeWaitingForRepetitionPlanItemDefinitionMapping(RemoveWaitingForRepetitionPlanItemDefinitionMapping mapping)
    Removes a waiting for repetition plan item definition mapping to the case instance migration plan.
    Parameters:
      `mapping` - Mapping for a specific plan item definition
    Returns:
      Returns the builder
    See Also:
      - `WaitingForRepetitionPlanItemDefinitionMapping`

  - ### addChangePlanItemIdMapping

    CaseInstanceMigrationBuilder addChangePlanItemIdMapping(ChangePlanItemIdMapping mapping)
    Adds a mapping for a plan item id to new plan item id. This should not be needed in general, but there are cases where the plan item can have a new plan item id between different versions, and that's why this option is added.
    Parameters:
      `mapping` - Mapping from an existing plan item id to a new plan item id
    Returns:
      Returns the builder
    See Also:
      - `ChangePlanItemIdMapping`

  - ### addChangePlanItemIdWithDefinitionIdMapping

    CaseInstanceMigrationBuilder addChangePlanItemIdWithDefinitionIdMapping(ChangePlanItemIdWithDefinitionIdMapping mapping)
    Adds a mapping for a plan item definition id to a new plan item definition id to change the plan item id. This should not be needed in general, but there are cases where the plan item can have a new plan item id between different versions, and that's why this option is added.
    Parameters:
      `mapping` - Mapping from an existing plan item definition id to a new plan item definition id to change the plan item id
    Returns:
      Returns the builder
    See Also:
      - `ChangePlanItemIdWithDefinitionIdMapping`

  - ### addChangePlanItemDefinitionWithNewTargetIdsMapping

    CaseInstanceMigrationBuilder addChangePlanItemDefinitionWithNewTargetIdsMapping(ChangePlanItemDefinitionWithNewTargetIdsMapping mapping)
    Adds a mapping for a plan item definition id to a new plan item id and definition id to change the plan item id. This should not be needed in general, but there are cases where the plan item can have a new plan item id between different versions, and that's why this option is added.
    Parameters:
      `mapping` - Mapping from an existing plan item definition id to a new plan item id and definition id to change the plan item id
    Returns:
      Returns the builder
    See Also:
      - `ChangePlanItemDefinitionWithNewTargetIdsMapping`

  - ### withPreUpgradeExpression

    CaseInstanceMigrationBuilder withPreUpgradeExpression(String preUpgradeExpression)
    Specifies an expression which is executed before the migration starts.
    Parameters:
      `preUpgradeExpression` - the expression e.g. ${mySpringBean.doSomething()}
    Returns:
      Returns the builder

  - ### withPostUpgradeExpression

    CaseInstanceMigrationBuilder withPostUpgradeExpression(String postUpgradeExpression)
    Specifies an expression which is executed after the migration is finished.
    Parameters:
      `postUpgradeExpression` - the expression e.g. ${mySpringBean.doSomething()}
    Returns:
      Returns the builder

  - ### withCaseInstanceVariable

    CaseInstanceMigrationBuilder withCaseInstanceVariable(String variableName, Object variableValue)
    Specifies a case instance variable that will also be available during the case migration
    Parameters:
      `variableName` - Name of the variable
      `variableValue` - Value of the variable
    Returns:
      Returns the builder

  - ### withCaseInstanceVariables

    CaseInstanceMigrationBuilder withCaseInstanceVariables(Map<String,Object> variables)
    Specified case instances variables that will also be available during case migration
    Parameters:
      `variables` -
    Returns:
      Returns the builder

  - ### getCaseInstanceMigrationDocument

    CaseInstanceMigrationDocument getCaseInstanceMigrationDocument()
    Builds a CaseInstanceMigrationDocument
    Returns:
      Returns the builder
    See Also:
      - `CaseInstanceMigrationDocument`

  - ### migrate

    void migrate(String caseInstanceId)
    Starts the case instance migration for a case identified with the submitted caseInstanceId
    Parameters:
      `caseInstanceId` -

  - ### validateMigration

    CaseInstanceMigrationValidationResult validateMigration(String caseInstanceId)
    Validates this case instance migration instructions for a given case instance identified by its caseInstanceId
    Parameters:
      `caseInstanceId` -
    Returns:
      a CaseInstanceMigrationValidationResult that contains validation error messages - if any

  - ### migrateCaseInstances

    void migrateCaseInstances(String caseDefinitionId)
    Asynchronously starts the case instance migration for each case instances of a given case definition identified by the case definition id.
    Parameters:
      `caseDefinitionId` -

  - ### batchMigrateCaseInstances

    Batch batchMigrateCaseInstances(String caseDefinitionId)
    Starts the case instance migration for all case instances of a given case definition identified by the case definition id.
    Parameters:
      `caseDefinitionId` -

  - ### validateMigrationOfCaseInstances

    CaseInstanceMigrationValidationResult validateMigrationOfCaseInstances(String caseDefinitionId)
    Validates this case instance migration instruction for each case instance of a given case definition identified by the case definition id.
    Parameters:
      `caseDefinitionId` -
    Returns:
      a CaseInstanceMigrationValidationResult that contains validation error messages - if any
    See Also:
      - `CaseInstanceMigrationValidationResult`

  - ### migrateCaseInstances

    void migrateCaseInstances(String caseDefinitionKey, int caseDefinitionVersion, String caseDefinitionTenantId)
    Starts the case instance migration for all case instances of a given case definition identified by the case definition key and version (optional tenantId).
    Parameters:
      `caseDefinitionKey` -
      `caseDefinitionVersion` -
      `caseDefinitionTenantId` -

  - ### batchMigrateCaseInstances

    Batch batchMigrateCaseInstances(String caseDefinitionKey, int caseDefinitionVersion, String caseDefinitionTenantId)
    Asynchronously starts the case instance migration for each case instances of a given case definition identified by the case definition key and version (optional tenantId).
    Parameters:
      `caseDefinitionKey` -
      `caseDefinitionVersion` -
      `caseDefinitionTenantId` -
    Returns:
      an id of the created batch entity

  - ### validateMigrationOfCaseInstances

    CaseInstanceMigrationValidationResult validateMigrationOfCaseInstances(String caseDefinitionKey, int caseDefinitionVersion, String caseDefinitionTenantId)
    Validates this case instance migration instruction for each case instance of a given case definition identified by the case definition key and version (optional tenantId).
    Parameters:
      `caseDefinitionKey` -
      `caseDefinitionVersion` -
      `caseDefinitionTenantId` -
    Returns:
      a CaseInstanceMigrationValidationResult that contains validation error messages - if any
    See Also:
      - `CaseInstanceMigrationValidationResult`