Page MenuHomePhabricator

Global Interaction extention towards external state machines.
Closed, InvalidPublic

Description

Dear All,

Here is a request regarding statemachine management within MITK and more precisely GlobalInteraction.

In the current MITK implementation, the GlobalInteraction singleton as a statemachinefactory as static data member. All statemachines are parsed from this statemachine factory and stored in an associated map.

We want to use the MITK statemachine for procedure workflow navigation/control. Each procedure will have an associated XML file based on an XML schema. From the parsing of this procedure XML file, a statemachine for navigation/control of the procedure execution will be built.

  • This statemachine will be associated to navigation event (in our case voice commands).
  • Each step of this procedure will also be linked with other infos such as an associated perspective and some associated views ...
  • This procedure is not associated to a DataNode.
  • We have our own software infrastructure (e.g. svn, CMake macros ...) and we used MITK as a library.

Our primary considered approach:

  • procedures are statemachines
  • procedure steps are extended statemachine states
  • procedures are described as individual XML files
  • we have our own statemachine factory with our own parsing

However, with the current implementation, we have to parse the procedure XML twice:

  • with our parser to get access to the extended state (procedure step description)
  • with the standard statemachine factory from global interaction so that our statemachine (procedure) is registered (i.e. added in the statemachine map).

In order to avoid this double parsing, maybe it would help to:

  • either handle statemachine factories as a vector in the GlobalInteraction: that way, externaly derived statemachine factory can be pushed in the GlobalInteraction.
  • or provide some API to push externally parsed statemachines in the statemachine map in the statemachine factory from global interaction.

Moreover, we have to ensure coherency between the mitk statemachine and our procedure. This can be realized through overloading of the ExecuteAction and ExecuteOperation but it might make sense to extend it with some associated pre and pos processing functions to increase the versatility.

Do these features make sense?

Best regards,

Tangi

Event Timeline

taking this interaction feature request.

Tangi,
do you have a schedule when do you will need the feature? Best Regards!

(In reply to comment #1)

taking this interaction feature request.

Tangi,
do you have a schedule when do you will need the feature? Best Regards!

Hello Ingmar,

As usual, we need it for yesterday ... ;)
More practically, if it is possible to get it before end of September (even as a separated patch or branch we would install), that would be nice.

I do not know what is the timeframe for you and if you have to go through specific processes when you are working on feature request.

If you think anything is possible, let me know.
I'm not in next week on the 21st, 22nd and 23rd but we can have a short teleconf for discussing the matter.

Best regards,

Tangi

Hi Tangi,

I have commited changes to support the addition of differently created state machine patterns to StateMachineFactory. (StateMachineFactory::AddStateMachinePattern(...))
See T2820 for futher documentation.
For usage see mitkStateMachineFactoryTest.

Is that what you need?

After my last update, I get a lot of warnings on the console window that could have something to do with your changes:

80.95 core.ia.eventMap WARNING: Event description left MouseBN already present! Skipping event description
80.97 core.ia.eventMap WARNING: Event description right MouseBN already present! Skipping event description
80.98 core.ia.eventMap WARNING: Event description left MouseBN + Shift already present! Skipping event description
[... ~3 screen pages full of these messages]

Maybe that happens if you instantiate a new GlobalInteraction?

Could you look into it?

In which application do you get the warnings?

I added the warnings to StateMachineFactory and EventMapper to display if events are repeatedly declared. This will happen, if method LoadBehavior(...) of StateMachineFactory (for patterns) and EventMapper (for events) is called several times with the same parameter (file). Also instanciating GlobalInteraction several times will end up in these warnings.

I have added the warnings and disabled the multiple addition of events or state machine patterns to the internal map / vector.
Before, double entries were a waste of memory, the first suitable event was returned anyway.

GlobalInteraction was designed as singleton but due to a bug (constructor public) it was used differently. Markus E. discovered this during the last 3M3 phase (#4351).
Are the warnings (symptoms) or is the multiple loading (cause) the problem?

(In reply to comment #3)

Hi Tangi,

I have commited changes to support the addition of differently created state
machine patterns to StateMachineFactory.
(StateMachineFactory::AddStateMachinePattern(...))
See T2820 for futher documentation.
For usage see mitkStateMachineFactoryTest.

Is that what you need?

Hi Ingmar,

Thanks for letting me know.
I will have time to look at it on wednesday only.
So I will come back to you asap.

Thank you.

Tangi

For further discussion lets switch to #2820.
There the specification page can also be adjusted to include
these features. ;)

(In reply to comment #11)

For further discussion lets switch to #2820.
There the specification page can also be adjusted to include
these features. ;)

Hi Ingmar,
It seems I'm not able to login to T2820.
Can I be added to the reader list?
Thanks

Resetting all bugs without active assignee flag to "CONFIRMED". Change status to IN_PROGRESS if you are working on it.

Closing, since this is an abandoned feature request.

kislinsk changed the task status from Invalid to Spite.Jun 27 2018, 1:33 PM
kislinsk added a project: Bulk Edit.
kislinsk changed the task status from Spite to Invalid.Jun 27 2018, 1:37 PM
kislinsk removed a project: Bulk Edit.