Skip to content

Latest commit

 

History

History
91 lines (69 loc) · 6.3 KB

File metadata and controls

91 lines (69 loc) · 6.3 KB

Extension points — Workflows.Publishing domain

This is the authoritative catalog of supported Publishing-domain replacements. Contracts live in Elsa.Workflows.Publishing.Core; defaults and composition live in this API feature. The authority and failure invariants are owned by ADR 0043, and shared terms remain in the Elsa glossary and root glossary.

Every contract below is on the override axis: one implementation owns the responsibility. Publishing does not currently publish a contributor interface or domain event. Runtime's trigger validators and observers are separate add-don't-replace seams; see the Runtime catalog linked below.

Overridable contracts

Contract Built-in default Replace when
IWorkflowExecutableCompiler WorkflowExecutableCompiler (scoped) Compilation, artifact hashing, validation, or executable projection differs.
IWorkflowTestRunStore InMemoryWorkflowTestRunStore (singleton) Test-run results need shared/durable retention.
IPublicationSlotStore InMemoryPublicationSlotStore (singleton) Slot authority and revision CAS must survive restart.
IPublicationRecordStore InMemoryPublicationRecordStore (singleton) Publication lifecycle/audit history must survive restart.
IPublicationPolicyStore InMemoryPublicationPolicyStore (singleton) Host/workflow policy and revision CAS must survive restart.
IPublicationProjectionIntentStore InMemoryPublicationProjectionIntentStore (singleton) Projection delivery facts and retries must survive restart.
IPublicationPolicyResolver PublicationPolicyResolver (singleton) A host needs a different policy source while preserving explicit-request precedence and safe defaults.
IPublicationPreflightService PublicationPreflightService (singleton) A host adds claim constraints beyond provider cardinality.
IPublicationActivator PublicationActivator (singleton) Authority coordination uses another transactional boundary while preserving CAS and compensation invariants.
IPublicationProjectionPreparer PublicationProjectionReconciler (singleton) Serving projections use another durable reconciliation mechanism.

Register replacements before the feature's TryAdd defaults, or use services.Replace(...). Persistence packages that replace a related store family should remove and register the whole family explicitly so a host cannot accidentally split one authority model between process-local and durable state.

Contract obligations

Authority stores

  • IPublicationSlotStore owns the unique (WorkflowDefinitionId, SlotName) authority and revisioned TryActivateAsync / TryUnpublishAsync transitions. A failed expected revision must leave the slot unchanged.
  • IPublicationRecordStore retains publication lifecycle and failure facts and supports conditional status transitions.
  • IPublicationPolicyStore stores the host policy under a null workflow ID and optional workflow overrides; writes are revision-checked.
  • IPublicationProjectionIntentStore durably transitions idempotent prepare/activate/remove intents. Providers must preserve deterministic intent IDs, attempt state, retry timing, and failure details across restart.

The supplied Groundwork provider implements these four contracts. Compose services.AddGroundworkPublishingStores() from Elsa.Workflows.Publishing.Persistence.Groundwork; its document kinds, indexes, CAS behavior, and serializers are provider-neutral with respect to the API feature.

Policy and preflight

IPublicationPolicyResolver must preserve the precedence and explicit coexistence rules in ADR 0043. It returns the resolved action, slot, policy source, and revision used by management clients.

IPublicationPreflightService compares candidate claims with authoritative claim sets. Replacements may add host constraints, but must not weaken provider-declared Exclusive cardinality or treat shared definition or artifact identity as an authority exemption. Trigger extraction/cardinality belongs to Runtime's contracts.

Activation and projection reconciliation

IPublicationActivator coordinates prepared candidates, slot CAS, record lifecycle, old-authority preservation, and compensation. A losing or failed candidate cannot make the old publication invisible.

IPublicationProjectionPreparer prepares inactive projections and supports activate, compensate, remove, and restore. Implementations must be idempotent and publication-scoped. Derived projection notifications occur only after the durable serving set reaches its final state; Runtime HTTP consumes the neutral IWorkflowTriggerIndexObserver seam and performs a full refresh when authority changes.

Persistence-provider checklist

A new Publishing persistence package should:

  1. Implement all four authority stores above and register them as one composition unit.
  2. Enforce unique slot identity and compare-and-swap revisions in storage, not only in process memory.
  3. Index publication records by slot and projection intents by publication.
  4. Version wire documents and provide upcasters/fixtures for every prior version.
  5. Prove restart behavior, stale-revision rejection, idempotent intent replay, and compensation with provider tests.
  6. Keep Runtime executable/reference/trigger/schedule stores in their owning Runtime persistence module; do not move those contracts into Publishing merely because the publish flow consumes them.

Cross-domain seams consumed by Publishing

References