Skip to content

v0.3.0: terminate and fault end a scope at once

Choose a tag to compare

@sfmskywalker sfmskywalker released this 14 Oct 18:18
bcf722e

A terminated or faulted scope now ends at once. Before this release, a terminate end event or a behavior fault reached in the same evaluation that had already started work could leave the process running forever.

Fixed

  • #26: a terminate or a behavior fault in an evaluation that had already issued StartWork answered Defer and parked the verdict on the state until the next work completion. If the work started in that evaluation waited on something that never came, such as a message, the process never ended. If it did complete, the parked path threw Unable to resolve the BPMN token for hosts that don't hand correlation back.
    • The interpreter now withdraws that evaluation's StartWork commands, along with their work records, and answers Complete or Fault straight away. Work activated and ended in the same instant is never started, and every other command keeps its order.
    • A terminate now also issues CancelWorkSubtree for every unit the host still reports live. Before, it stopped work only logically, and a host that doesn't cancel a completed scope's children itself left that work running. A unit already torn down in the same evaluation for a more specific reason keeps that reason; the rest get the new BpmnInterpreter.TerminateStopReason, bpmn.terminate.stopped-live-work.
    • A scope that has ended ignores later completions, faults and signals. It forwards no escalation to its parent and starts nothing.

Breaking changes

A terminate end event now requires the SubtreeCancellation host capability. A definition containing one is refused when the graph is built if the host doesn't declare it, the same rule 0.2.0 introduced for cancel end events.

Hosts should treat CancelWorkSubtree as idempotent. After a terminate, every later callback answers Complete again and repeats the teardowns still outstanding. A handle that is unknown or already torn down should be a no-op.

Behavior changes worth knowing

  • A fault still carries no teardown, because a fault is a verdict, not a command (ADR 0003). A Fault continuation may carry a SignalEnclosingScope raised earlier in the same evaluation, and nothing else.
  • A caught error whose own path then faults now reports Propagated together with the Fault. Before, it reported Caught with a Defer.
  • States persisted by 0.2.0 with a parked terminate or fault still resolve on the next completion. The payload format is unchanged at 1.0.0.

Install

dotnet add package Bpmn.Semantics --version 0.3.0
dotnet add package Bpmn.Runtime.InMemory --version 0.3.0

Deterministic builds with SourceLink and .snupkg symbols. No dependencies beyond the base class library and each other.