Keeping An Entity In Its Last Successful State
By default, any error encountered while transitioning a business entity from one state to another rolls back all changes leaving the entity in its original state.
When applicable, the Maintenance Object can be configured to always keep an entity in its last successful state rather than rolling all the way back to the original state. This practice is often referred to as "taking save-points". In case of an error, the entity is rolled back to the last successfully entered state and the error is logged on the maintenance object's log. Notice that with this approach no error is returned to the calling process, the error is just logged.
The logic to properly log the error is in a Transition Error Maintenance Object plug-in. The system considers a maintenance object to practice "save-points" when such an algorithm is plugged into it.
Even if the maintenance object practices "save-points", in case of an error the system will not keep an entity in the last successfully entered state if that state is either marked as transitory or one of its Enter algorithms has determined that the entity should proceed to a next state. The system will roll back to the first previous state that does not match these conditions.