pub struct Process { /* private fields */ }Expand description
A business process of a domain, made with crate::Domain::process: its start and steps,
added in the order written (see the module for an example). Cloning gives another
handle to the same process. Process::model builds the model the kernel registers.
Implementations§
Source§impl Process
impl Process
Sourcepub fn start<E: EventType>(&self, start: Start) -> Process
pub fn start<E: EventType>(&self, start: Start) -> Process
Starts a case when an E event commits; see Start.
Sourcepub fn start_named(&self, event_type: &str, start: Start) -> Process
pub fn start_named(&self, event_type: &str, start: Start) -> Process
Process::start with the event type by name: shop.OrderSubmitted, or OrderSubmitted
of the process’s domain.
Sourcepub fn command<C: CommandType>(&self, name: &str, send: Send) -> Process
pub fn command<C: CommandType>(&self, name: &str, send: Send) -> Process
A step name that sends a C command as the process; see Send.
Sourcepub fn command_named(
&self,
name: &str,
command_type: &str,
send: Send,
) -> Process
pub fn command_named( &self, name: &str, command_type: &str, send: Send, ) -> Process
Process::command with the command type by name: shop.order.Confirm, or
order.Confirm of the process’s domain.
Sourcepub fn wait<E: EventType>(&self, name: &str, wait: Wait) -> Process
pub fn wait<E: EventType>(&self, name: &str, wait: Wait) -> Process
A step name that waits for an E event of this case; see Wait.
Sourcepub fn wait_named(&self, name: &str, event_type: &str, wait: Wait) -> Process
pub fn wait_named(&self, name: &str, event_type: &str, wait: Wait) -> Process
Process::wait with the event type by name: payments.PaymentReceived, or a type of
the process’s domain.
Sourcepub fn timer(&self, name: &str, timer: Timer) -> Process
pub fn timer(&self, name: &str, timer: Timer) -> Process
A step name that waits for a time; see Timer.
Sourcepub fn decide(&self, name: &str, decide: Decide) -> Process
pub fn decide(&self, name: &str, decide: Decide) -> Process
A step name that picks a path by the case’s data; see Decide.
Sourcepub fn query<Q: QueryType>(&self, name: &str, ask: Ask) -> Process
pub fn query<Q: QueryType>(&self, name: &str, ask: Ask) -> Process
A step name that asks a Q query; its answer picks the path; see Ask.
Sourcepub fn query_named(&self, name: &str, query_type: &str, ask: Ask) -> Process
pub fn query_named(&self, name: &str, query_type: &str, ask: Ask) -> Process
Process::query with the query type by name: shop.NeedsApproval, or a type of the
process’s domain.
Sourcepub fn cancel_on<E: EventType>(&self, key: &str, end: &str) -> Process
pub fn cancel_on<E: EventType>(&self, key: &str, end: &str) -> Process
Ends a running case at once when an E event of its key commits, whatever step it is
at: key is where the case’s key is in the event (aggregate_id or data.<field>),
end an end step. Its timer is withdrawn, an outcome it still awaits is ignored, an
incident ends with it. Events the case’s own commands cause do not count.
Sourcepub fn cancel_on_named(&self, event_type: &str, key: &str, end: &str) -> Process
pub fn cancel_on_named(&self, event_type: &str, key: &str, end: &str) -> Process
Process::cancel_on with the event type by name: accounts.AccountClosed, or a type
of the process’s domain.
Sourcepub fn model(&self) -> Result<Value, Error>
pub fn model(&self) -> Result<Value, Error>
The model the kernel registers (design/processes.md “The model format”): steps in the
order written, each but end with its explicit successors, field names as on the wire.
Error::Config naming the process and the step if it has no start, a step name is
invalid or taken, a target names no step, a step other than end has no successor, a
reference or duration is malformed, or a decision or query has no paths. The kernel
checks the rest when it registers the model (conditions, types, grants).
Trait Implementations§
Auto Trait Implementations§
impl Forget for Process
impl Freeze for Process
impl Move for Process
impl RefUnwindSafe for Process
impl Send for Process
impl Sync for Process
impl Unpin for Process
impl UnsafeUnpin for Processwhere
*const ArcInner<Mutex<Def>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Def>>>: UnsafeUnpin,
impl UnwindSafe for Process
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request