Behaviour contract for stem engines.
Engines must be deterministic under sync: true execution, enabling
reliable unit tests and debugging.
Summary
Callbacks
@callback checkpoint(WorkflowStem.Types.runtime()) :: map()
@callback get_state(WorkflowStem.Types.runtime()) :: WorkflowStem.Projection.t() | map()
@callback handle_event( WorkflowStem.Types.runtime(), WorkflowStem.Types.event(), WorkflowStem.Types.payload() ) :: {:ok, WorkflowStem.Types.runtime()} | {:wait, WorkflowStem.Types.runtime(), WorkflowStem.Types.wait_cfg()} | {:error, WorkflowStem.Types.reason(), WorkflowStem.Types.runtime()}
@callback init(WorkflowStem.Types.spec(), WorkflowStem.Types.runtime_context()) :: {:ok, WorkflowStem.Types.runtime()} | {:wait, WorkflowStem.Types.runtime(), WorkflowStem.Types.wait_cfg()} | {:error, WorkflowStem.Types.reason()} | {:error, {:initial_entry_action_failed, WorkflowStem.Types.reason(), WorkflowStem.Types.runtime()}}
@callback restore(WorkflowStem.Types.spec(), map(), WorkflowStem.Types.runtime_context()) :: {:ok, WorkflowStem.Types.runtime()} | {:error, WorkflowStem.Types.reason()}