#[non_exhaustive]pub struct TripWorkflow { /* private fields */ }Expand description
The trip workflow: the disruption case of one booking.
Implementations§
Source§impl TripWorkflow
impl TripWorkflow
Sourcepub const fn with_cards(self) -> Self
pub const fn with_cards(self) -> Self
The same workflow with a click for withdrawing and a review card for changing the traveler, for exercising the card machinery; the sample itself asks for neither.
Trait Implementations§
Source§impl Clone for TripWorkflow
impl Clone for TripWorkflow
impl Copy for TripWorkflow
Source§impl Debug for TripWorkflow
impl Debug for TripWorkflow
Source§impl Default for TripWorkflow
impl Default for TripWorkflow
Source§impl PureWorkflow for TripWorkflow
impl PureWorkflow for TripWorkflow
Source§fn apply(
&self,
state: Option<&TripState>,
command: &TripCommand,
) -> Result<Applied<TripState, TripEvent>, DomainRejection>
fn apply( &self, state: Option<&TripState>, command: &TripCommand, ) -> Result<Applied<TripState, TripEvent>, DomainRejection>
state.Source§fn event_type(&self, event: &TripEvent) -> String
fn event_type(&self, event: &TripEvent) -> String
"trip.extra_added".Source§impl WorkflowDefinition for TripWorkflow
impl WorkflowDefinition for TripWorkflow
Source§fn obligation_act(
&self,
state: Option<&TripState>,
obligation: &TripObligation,
) -> Option<ObligationAct>
fn obligation_act( &self, state: Option<&TripState>, obligation: &TripObligation, ) -> Option<ObligationAct>
Each obligation as the question that closes it. An extra’s payer is asked of that extra: the answer gives only the payer.
Source§fn narratable_state(&self, state: Option<&TripState>) -> Vec<StateField>
fn narratable_state(&self, state: Option<&TripState>) -> Vec<StateField>
The values a person may be told back, which here is what they gave and the booking they gave it on; never the lifecycle or the ticket number.
Source§fn briefing(&self, view: &ViewOf<Self>) -> Option<String>
fn briefing(&self, view: &ViewOf<Self>) -> Option<String>
Guidance that changes with the phase: while a case is being filled in, what a kept leg means; once the rebooking card is up, to read the message as an answer to it.
Source§fn transition_briefing(&self, view: &ViewOf<Self>) -> Option<String>
fn transition_briefing(&self, view: &ViewOf<Self>) -> Option<String>
What the sample wants said while it acknowledges and asks.
Source§fn answer_briefing(&self, view: &ViewOf<Self>) -> Option<String>
fn answer_briefing(&self, view: &ViewOf<Self>) -> Option<String>
And something else for the stage that answers.
Source§fn artifacts(&self, view: &ViewOf<Self>) -> Vec<ArtifactRef>
fn artifacts(&self, view: &ViewOf<Self>) -> Vec<ArtifactRef>
The itinerary a quoted rebooking has, declared from the projection so it is there on a turn where the user asks instead of clicking.
Source§fn confirmation_subject(
&self,
state: Option<&TripState>,
_view: &ViewOf<Self>,
act: &ResolvedAct,
) -> Option<ConfirmationSubject>
fn confirmation_subject( &self, state: Option<&TripState>, _view: &ViewOf<Self>, act: &ResolvedAct, ) -> Option<ConfirmationSubject>
What the destructive confirmation is about, in words that name the thing.
Source§fn enumerations(&self, _view: &ViewOf<Self>) -> Vec<DomainEnumeration>
fn enumerations(&self, _view: &ViewOf<Self>) -> Vec<DomainEnumeration>
The payers this workflow accepts, and no others.
Source§fn next_steps(
&self,
state: Option<&TripState>,
view: &ViewOf<Self>,
) -> Vec<NextStep>
fn next_steps( &self, state: Option<&TripState>, view: &ViewOf<Self>, ) -> Vec<NextStep>
A complete trip can take another extra, and the rebooking of the quoted leg once a quote is in; one still owing something offers nothing, because what it owes is asked first. The runtime offers a step only when its dry run on the record passes.
Source§fn nothing_changed(
&self,
state: Option<&TripState>,
act: &ResolvedAct,
) -> Option<LocalizedText>
fn nothing_changed( &self, state: Option<&TripState>, act: &ResolvedAct, ) -> Option<LocalizedText>
Why nothing changed: the name already there.
Source§type Obligation = TripObligation
type Obligation = TripObligation
Source§type Command = TripCommand
type Command = TripCommand
Source§type Outcome = TripOutcome
type Outcome = TripOutcome
Source§fn key(&self) -> WorkflowKey
fn key(&self) -> WorkflowKey
Source§fn version(&self) -> WorkflowVersion
fn version(&self) -> WorkflowVersion
Source§fn phase_ownership(&self, phase: &TripPhase) -> PhaseOwnership
fn phase_ownership(&self, phase: &TripPhase) -> PhaseOwnership
Source§fn obligation_sentence(
&self,
obligation: &TripObligation,
) -> Option<LocalizedText>
fn obligation_sentence( &self, obligation: &TripObligation, ) -> Option<LocalizedText>
Source§fn project(&self, case_ref: CaseRef, state: Option<&TripState>) -> ViewOf<Self>
fn project(&self, case_ref: CaseRef, state: Option<&TripState>) -> ViewOf<Self>
Source§fn summary(&self) -> Option<String>
fn summary(&self) -> Option<String>
None, the default, shows the workflow’s key alone.Source§fn noun(&self) -> Option<LocalizedText>
fn noun(&self) -> Option<LocalizedText>
None,
the default, uses the workflow’s key.Source§fn glossary(&self) -> Vec<GlossaryTerm>
fn glossary(&self) -> Vec<GlossaryTerm>
Source§fn operations(&self, view: &ViewOf<Self>) -> Vec<OperationSpec>
fn operations(&self, view: &ViewOf<Self>) -> Vec<OperationSpec>
Source§fn record_operations(&self) -> Vec<OperationSpec>
fn record_operations(&self) -> Vec<OperationSpec>
Source§fn compile_act(
&self,
state: Option<&TripState>,
_view: &ViewOf<Self>,
act: &ResolvedAct,
) -> Result<Vec<TripCommand>, DomainRejection>
fn compile_act( &self, state: Option<&TripState>, _view: &ViewOf<Self>, act: &ResolvedAct, ) -> Result<Vec<TripCommand>, DomainRejection>
Source§fn command_policy(
&self,
state: Option<&TripState>,
command: &TripCommand,
) -> CommandPolicy
fn command_policy( &self, state: Option<&TripState>, command: &TripCommand, ) -> CommandPolicy
CommandPolicy::conservative.Source§fn validate_command(
&self,
state: Option<&TripState>,
command: &TripCommand,
) -> Result<(), DomainRejection>
fn validate_command( &self, state: Option<&TripState>, command: &TripCommand, ) -> Result<(), DomainRejection>
Source§fn state_after(
&self,
state: Option<&TripState>,
command: &TripCommand,
) -> Option<TripState>
fn state_after( &self, state: Option<&TripState>, command: &TripCommand, ) -> Option<TripState>
command leaves state in, when the workflow can tell without
executing it. An act on a record an earlier act of the same message opens is
compiled and validated against the state the opening leaves; with None, the
default, it is checked against no state, and a domain that needs the record refuses.Source§fn receipts(
&self,
events: &[ReceiptEvent<TripEvent>],
locale: &Locale,
) -> Vec<OperationalReceipt>
fn receipts( &self, events: &[ReceiptEvent<TripEvent>], locale: &Locale, ) -> Vec<OperationalReceipt>
Source§fn build_interaction(
&self,
state: Option<&TripState>,
view: &ViewOf<Self>,
requirement: &InteractionRequirement,
) -> Result<InteractionSpec, DomainRejection>
fn build_interaction( &self, state: Option<&TripState>, view: &ViewOf<Self>, requirement: &InteractionRequirement, ) -> Result<InteractionSpec, DomainRejection>
Source§fn start_preconditions(&self) -> Vec<StartPrecondition>
fn start_preconditions(&self) -> Vec<StartPrecondition>
Source§fn start_behaviour(&self) -> StartBehaviour
fn start_behaviour(&self) -> StartBehaviour
Source§fn may_open_beside(
&self,
open: &[WorkflowView<Self::Phase, Self::Obligation, Self::Outcome>],
) -> Result<(), DomainRejection>
fn may_open_beside( &self, open: &[WorkflowView<Self::Phase, Self::Obligation, Self::Outcome>], ) -> Result<(), DomainRejection>
open ones are: an operation aimed at a
new record, the door StartBehaviour does not govern. Read moreSource§impl WorkflowModel<TripWorkflow> for TripModel
impl WorkflowModel<TripWorkflow> for TripModel
Source§fn initial_states(&self) -> Vec<Option<TripState>>
fn initial_states(&self) -> Vec<Option<TripState>>
None means “the case does not
exist yet”, which is where most workflows begin — and it never means
“the case is over”, because a case’s identity outlives its content.