@jinzhu Is there a reason why setting
OrderStateMachine.Initial("draft")
is not reflected in the initial state of the object?
Currently it looks like the initial state is only applied when an Event happens. For example trying to transition to an invalid state.
Steps to reproduce:
order := &Order;
var OrderStateMachine = transition.New(order)
OrderStateMachine.Initial("draft")
OrderStateMachine.State("checkout")
order.GetState() // returns ""
OrderStatemachine.Trigger("cancel", &order, nil)
order.GetState() // returns "draft"
@jinzhu Is there a reason why setting
OrderStateMachine.Initial("draft")is not reflected in the initial state of the object?
Currently it looks like the initial state is only applied when an Event happens. For example trying to transition to an invalid state.
Steps to reproduce: