Class WorkflowReplayDriftException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.axoniq.framework.workflow.runtime.api.execution.context.WorkflowReplayDriftException
All Implemented Interfaces:
Serializable

public class WorkflowReplayDriftException extends RuntimeException
Thrown when a workflow's replay reaches an event-emitting primitive that would corrupt an in-flight workflow — specifically, when state contains terminal steps the current invocation has not yet referenced. That signal means the old code ran past this point with steps the new code skips; the new primitive's events would diverge from history.

Caught and handled non-terminally by SimpleWorkflowExecution.handleWorkflowException: a warning is logged and no terminal workflow event is published, so the workflow stays at its current state and the developer can recover by reverting the code change or wrapping the new code in ctx.migrateVersion(changeId, n) to fork the workflow.

Since:
5.4.0
Author:
Stefan Dragisic
See Also:
  • Constructor Details

    • WorkflowReplayDriftException

      public WorkflowReplayDriftException(String workflowId, String aboutToExecute, List<String> orphans)
      Constructs a drift exception.
      Parameters:
      workflowId - id of the workflow that detected drift.
      aboutToExecute - step name about to be executed, or "<terminate>" for workflow-level termination.
      orphans - terminal step names present in history but not referenced by the current invocation — the corruption signal.
  • Method Details

    • workflowId

      public String workflowId()
      The id of the workflow that could not proceed because of replay drift.
      Returns:
      the workflow id.
    • aboutToExecute

      public String aboutToExecute()
      The step the current code was about to execute when the drift was detected.
      Returns:
      the name of the step about to execute.
    • orphans

      public List<String> orphans()
      The terminal steps present in history that the current code does not reference — evidence that older code ran past this point.
      Returns:
      the unreferenced (orphan) terminal step names.