org.jbpm.runtime.manager.impl.migration

## Class MigrationManager

- java.lang.Object
- - org.jbpm.runtime.manager.impl.migration.MigrationManager

-     public class MigrationManager
      extends Object

  MigrationManager is responsible for updating all required components during process instance migration. Each process instance should be have dedicated instance of the manager to allow simple execution model. Each manager maintains MigrationReport that is constantly updated when migration is running. It comes with following migration entries (as part of the report)
  - INFO - written mostly for information about given migration step and its result
  - WARN - not recommended operation performed though did not stop the migration
  - ERROR - terminates the migration and restores to last state - before migration
  There could be at most single ERROR type of entry as first one that occurred terminates the migration. Migration is composed of two steps
  - validation - various checks to ensure migration can be performed to limit number of failed migrations
  - migration - actual migration that changes state of the process instance and its index data - history logs
  Migration can either be performed with or without node instance mapping. Node instance mapping allows to map nodes only of the same type as it simply changes node reference of the node and does not replace the node instance (by canceling current node and triggering new one).

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MigrationManager(MigrationSpec migrationSpec)` Creates new instance of MigrationManager with given migration specification.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Map<Long,List<TimerInstance>>` | `cancelActiveTimersBeforeMigration(org.kie.api.runtime.manager.RuntimeManager manager)`
    `protected TimerManager` | `getTimerManager(org.kie.api.runtime.KieSession ksession)`
    `MigrationReport` | `migrate()` Performs migration without node instance mapping
    `MigrationReport` | `migrate(Map<String,String> nodeMapping)` Performs migration with node mapping (if non null).
    `protected void` | `rescheduleTimersAfterMigration(org.kie.api.runtime.manager.RuntimeManager manager, Map<Long,List<TimerInstance>> timerMigrated)`
    `protected void` | `updateBasedOnTrigger(TimerInstance timerInstance)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MigrationManager

          public MigrationManager(MigrationSpec migrationSpec)

      Creates new instance of MigrationManager with given migration specification. Migration specification will be validated upon call to `migrate()` method
      Parameters:
        `migrationSpec` - definition of what needs to be migrated

  - ### Method Detail

    - #### migrate

          public MigrationReport migrate()

      Performs migration without node instance mapping
      Returns:
        returns migration report describing complete migration process.

    - #### migrate

          public MigrationReport migrate(Map<String,String> nodeMapping)

      Performs migration with node mapping (if non null).
      Parameters:
        `nodeMapping` - node instance mapping that is composed of unique ids of source node mapped to target node
      Returns:
        returns migration report describing complete migration process.

    - #### getTimerManager

          protected TimerManager getTimerManager(org.kie.api.runtime.KieSession ksession)

    - #### cancelActiveTimersBeforeMigration

          protected Map<Long,List<TimerInstance>> cancelActiveTimersBeforeMigration(org.kie.api.runtime.manager.RuntimeManager manager)

    - #### rescheduleTimersAfterMigration

          protected void rescheduleTimersAfterMigration(org.kie.api.runtime.manager.RuntimeManager manager,
                                                        Map<Long,List<TimerInstance>> timerMigrated)

    - #### updateBasedOnTrigger

          protected void updateBasedOnTrigger(TimerInstance timerInstance)

Copyright © 2001–2018 JBoss by Red Hat. All rights reserved.