Skip to main content

Template Migration

The hash of a process template is persisted as soon as a process instance is created. If a template is changed afterwards, the existing process instances are migrated.

Context​

The PCS records messages and assigns them to a process context, making the state of a process transparent. Conditions can be formulated for when milestones are reached and when tasks are considered completed, which in turn influences when the process itself is considered completed.

Processes are instantiated by the process origin, usually the service representing the starting point of the process. The actual process logic lies in the services consuming and producing the messages assigned to the process. Processes can be open for a long time until they are completed — usually days or weeks, i.e. across deployments and releases of new features and process logic in those services.

Pure recording can happen relatively independently of the evolution of the process over time. Logic for reaching milestones and completing tasks, and therefore the process, is more tightly coupled to the occurrence of expected messages and thus to the flow of the process as defined in the template.

Process templates describe observed message streams; business services own the process logic while instances may span template versions

Constraints​

#ConstraintDescription
R1RecordingThe PCS records. It cannot intervene in or control the actual process flow, it only represents it. The process flow is determined solely by the current logic of the services participating in the process. Planning dynamic tasks is likewise the responsibility of those services.
R2"There is no process"It follows that there is always exactly one productive version of a process — unless the participating services implement some kind of migration logic themselves. One could also argue that there is no process at all, only instances of connected message streams.
R3Changes in business logic and message flow are a factThat process flows change over time while processes are still open is a fact determined by the participating services and their business logic. The genuinely difficult part of migration therefore lies in those services: they have to make sure the changed message flow still works with already instantiated flows. The PCS perceives the symptom — the observed process no longer matches the template that was active when the process was instantiated — and has to cope with the template changing.
R4Done means doneCompleted processes stay completed; template migration does not reopen them. Completed tasks retain their final state. The scheduled migration selects non-completed instances; message-triggered updates can still apply template changes to an already completed instance.

Automated migration rules​

These rules are applied automatically by the PCS after a template has been changed — time based in batch mode, or as soon as a message is received for a process instance. See Template migration scheduler for the configuration.

In general: for process instances in a non-final state, a re-evaluation of the state is always triggered when the template has changed, so that new definitions (new process data etc.) are applied.

Tasks​

Change in the process templateTask instance stateMigration rule
New task type with lifecycle=static–Create a missing task instance initially in UNKNOWN; evaluate completion against existing messages.
New task type with lifecycle=dynamic or observed–No placeholder task is created by template migration; instances follow their message-driven lifecycle.
Task type deletedNon-final stateChange the task instance state to DELETED
Task type deletedFinal stateNo action

The diagram separates automatic evaluation from project-specific migration. It does not imply that adding a template task starts new work in the business services.

Messages​

Change in the process templateMigration rule
New message referenceNo action — the message is consumed from now on
Message reference deletedNo action — the message is no longer consumed, already existing messages remain

Message data​

Change in the process templateMigration rule
New message data definitionNo action — the data is generated from now on
Message data definition deletedNo action — existing message data remains

Process data​

Change in the process templateMigration rule
New process data definitionNo action — the process data is generated from now on
Process data definition deletedNo action — existing process data remains

Relations​

Change in the process templateMigration rule
New relation patternNo action — the relation is created from now on
Relation pattern deletedNo action — existing relations remain

Specific migration rules​

For tasks that remain in UNKNOWN after automated migration and completion evaluation, the project must determine the correct state from the business context. If a database migration script is needed, it is application-specific. The PCS cannot infer business work that was never represented by the recorded messages.