Step 5: Add the Postponed State to the Composite State
To add the Postponed
state to the composite state, do the following:
- In the
SOInvoiceOrder_Workflow
class, locate the WithFlowStates method call or add it if it is not yet present in your code. - Add the
Postponed
state in the WithFlowStates method, as shown in the following code.flowStates.UpdateSequence<ARDocStatus.HoldToBalance>(seq => { return seq.WithStates(states => { states.Add<ARDocStatus_Postponed.postponed>(flowState => { return flowState .PlaceAfter<ARDocStatus.creditHold>() .IsSkippedWhen(conditions.DiscountEmpty) .WithActions(actions => { actions.Add(approveDiscount, a => a .IsDuplicatedInToolbar() .WithConnotation(ActionConnotation.Success)); }); }); }); });
In the code above, you have added the
Postponed
state after theCreditHold
state, specified that thePostponed
state should be skipped if theDiscountEmpty
condition is true, and added theapproveDiscount
action to thePostponed
state.