Closed richhl closed 9 years ago
Since a state can have many transitions ("forward" or "backward") I think no. If you follow a linear pattern (so A -> B -> C and C -> B -> A, but no C -> A), then you might be able find some way. Hence the unlimited number of transitions between any states there is no such previous state, and IMO there won't be any.
just implement the inverse transition. For example:
draft -> publish -> published published -> unpublish -> draft
It's up to you implementing the logic (for example managing the events) of the reverse transition.
It's up to you to define reverse transitions. Transitions should be associated to a "verb" like "publish", "propose", "accept", if needed, you can define reverse side, like "unpublish", "reject".
in case of a mistake this is important....for example one has approve an article by error and wants to return to previous state....