コード例 #1
0
 /// <summary>
 /// Change state of the workflow.
 /// </summary>
 /// <param name="trigger"></param>
 public virtual void ChangeState(WorkflowTrigger <string> trigger)
 {
     workflowEngine.ChangeState(trigger);
 }
コード例 #2
0
 /// <summary>
 /// Can change the workflow state
 /// </summary>
 /// <param name="trigger"></param>
 /// <returns></returns>
 public virtual bool CanChangeState(WorkflowTrigger <string> trigger)
 {
     return(workflowEngine.CanChangeState(trigger));
 }
コード例 #3
0
 /// <summary>
 /// Provides entry point to the transitions, can be used for logging
 /// </summary>
 /// <param name="source"></param>
 /// <param name="destination"></param>
 /// <param name="trigger"></param>
 /// <param name="reentery"></param>
 public virtual void WorkflowEngine_OnStateTransition(WorkflowState <string, T> source,
                                                      WorkflowState <string, T> destination,
                                                      WorkflowTrigger <string> trigger, bool reentery)
 {
 }
コード例 #4
0
 /// <summary>
 ///  Adds a new trigger the collection.
 /// </summary>
 /// <param name="trigger">Trigger.</param>
 /// <remarks>
 /// To be added.
 /// </remarks>
 /// <exception cref="System.NotSupportedException">The current collection is read-only.</exception>
 public void Add(WorkflowTrigger <T> trigger)
 {
     Add(trigger.Id, trigger);
 }
コード例 #5
0
ファイル: WorkflowEngine.cs プロジェクト: kdcllc/Bet.Autoflow
 /// <summary>
 /// Determines whether this workflow can change its state based on the trigger.
 /// /// </summary>
 /// <param name="trigger"></param>
 /// <returns></returns>
 public virtual bool CanChangeState(WorkflowTrigger <T> trigger)
 {
     Guard.ArgumentIsNotNull(trigger, nameof(trigger));
     return(_stateMachine.CanFire(trigger));
 }
コード例 #6
0
ファイル: WorkflowEngine.cs プロジェクト: kdcllc/Bet.Autoflow
 /// <summary>
 /// Changes the current state to a new state.
 /// </summary>
 /// <param name="trigger"></param>
 public virtual void ChangeState(WorkflowTrigger <T> trigger)
 {
     Guard.ArgumentIsNotNull(trigger, nameof(trigger));
     _stateMachine.Fire(trigger);
 }
コード例 #7
0
ファイル: WorkflowEngine.cs プロジェクト: kdcllc/Bet.Autoflow
 /// <summary>
 /// Allows for the un-handled triggers to be tracked
 /// </summary>
 /// <param name="state"></param>
 /// <param name="trigger"></param>
 protected virtual void OnUnhandledTrigger(WorkflowState <T, TContext> state, WorkflowTrigger <T> trigger)
 {
     OnTriggerUnhandled?.Invoke(state, trigger);
 }