lib/statemachine/transition.rb in MINT-statemachine-1.2.2 vs lib/statemachine/transition.rb in MINT-statemachine-1.2.3
- old
+ new
@@ -21,21 +21,22 @@
message_queue = origin.statemachine.message_queue
if @action # changed this if statement to return if action fails
if not origin.statemachine.invoke_action(@action, args, "transition action from #{origin} invoked by '#{@event}' event", messenger, message_queue)
raise StatemachineException.new("Transition to state #{destination.id} failed because action for event #{@event} return false.")
- return
end
end
# origin.statemachine.invoke_action(@action, args, "transition action from #{origin} invoked by '#{@event}' event", messenger, message_queue) if @action
terminal_state = entries.last
- entries.each { |entered_state| entered_state.activate(terminal_state.id) if entered_state.is_parallel }
terminal_state.activate if terminal_state and not terminal_state.is_parallel
entries.each { |entered_state| entered_state.enter(args) }
+ entries.each { |entered_state| entered_state.activate(terminal_state.id) if entered_state.is_parallel }
+ statemachine.state = terminal_state if statemachine.has_state(terminal_state.id) and statemachine.is_parallel
+
end
def exits_and_entries(origin, destination)
# return [], [] if origin == destination
exits = []
\ No newline at end of file