Step 1: Defining a Transition

In this step, you will define a transition from the OnHold state to the ReadyForAssignment state in the workflow. Do the following:

  1. In the RSSVWorkOrderWorkflow class, in the Configure method, locate the AddDefaultFlow method, which you have added in Step 3: Overriding the Configure Method.
  2. Call the WithTransitions method in the lambda expression for the AddDefaultFlow method, as the following code shows.
                        .WithTransitions(transitions =>
                        {                    }))
  3. Inside the lambda expression of the WithTransitions method, add the transition by calling the Add method, as the following code shows.
                            transitions.Add(t => t.From<States.onHold>()
                                  .To<States.readyForAssignment>()
                                  .IsTriggeredOn(g => g.ReleaseFromHold));

    In the code above, you have specified the following:

    • The source state of the transition (which is OnHold) as a type parameter of the From method
    • The target state of the transition (which is ReadyForAssignment) as a type parameter of the To method
    • The entity that triggers the transition (which is the ReleaseFromHold action) in the IsTriggeredOn method
  4. Save your changes.