Page MenuHomePhabricator

Move handing of conditions to StateMachineTransition
Closed, WontfixPublic

Description

This request has come up during the review of T15697 but has not been adressed yet.

Basically, conditions are currently checked in mitkEventStateMachine::CanHandleEvent(), GetExecutableTransition() respectively.
It would be more logical to move the checking of the conditions into the StateMachineTransition.

Original text by Sascha:
I know that this was originally not in the scope of the planned changes, but if you like the following idea, I think it leads to a cleaner and simpler design: The EventStateMachine::AddConditionFunction(...) (and similarly the AddActionFunction method) could call a new StateMachineTransition::AddConditionFunction(...) method, such that each transition contains its own "m_conditionDelegatesMap" map - which would just be a vector then - (the EventStateMachine::AddConditionFunction() could easily look up the transition instance by name), instead of storing all delegates in EventStateMachine. This would allow to move the "condition checking" code also into the mitk::StateMachineTransition class and lead to a better "separation of concerns" and less EventStateMachine code (in my opinion). Also, the StateMachineTransition::GetConditions() method wouldn't be needed any more.

Event Timeline

kislinsk claimed this task.
kislinsk added a project: Auto-closed.
kislinsk added a subscriber: kislinsk.

Hi there! 🙂

This task was auto-closed according to our Task Lifecycle Management.
Please follow this link for more information and don't forget that you are encouraged to reasonable re-open tasks to revive them. 🚑

Best wishes,
The MITK devs

kislinsk removed kislinsk as the assignee of this task.May 26 2020, 12:05 PM
kislinsk removed a subscriber: kislinsk.