Repository navigation
Release v2.10.0
State machines and workflows now share pluggable actions, defined fluently, and the grains involved can say which grain they are.
Added
IActioninCratis.Choreography.Actions, withActionContextandActionResult, as the one thing a state machine or a workflow does.ActionsBuilder, a fluent way to define actions:Call<TService>(service => ...),Call(services => ...),Run(context => ...),RunProcess(...),TransitionTo<TState>(),StartWorkflow(...)andAdd(action). The plain actions behind them areCodeAction,ProcessAction,TransitionStateAction,StartWorkflowActionandCompositeAction, which runs several actions in order.Execute<TCommand>(command => ...)onActionsBuilderexecutes a Cratis Arc command throughICommandPipeline, andAppend<TEvent>(@event => ...)appends a Chronicle event. They come from the newCratis.Choreography.Arcpackage and fromCratis.Choreography.Chronicle, so the core package depends on neither.- State actions: a
State<TStoredState>defines actions withDefineActions(StateActionsBuilder)usingOnEntry,WhileRunningandOnExit, or by overridingEntryActions,RunningActionsandExitActions. Reactivating in a state it was already in runs only the running actions, and deactivation runs no exit actions. A failing action throwsStateActionFailed. ActionNodePerformer, a base for a workflow node performer that performs its node with actions defined inDefine(ActionsBuilder), so the same actions work in workflows.GrainIdentity,GrainKindandIIdentifiable:StateMachine<TStoredState>,WorkflowGrainandWorkflowRunGrainexpose theirIdentity, derived from the Orleans grain id, and every action sees it on itsActionContext. No grain interface changes.- The
Cratis.Choreography.Arcpackage. - An Actions documentation page, and the packages pages list the new package.