Yes, it is possible in EA.
I would change the constructions like one of these:
- Model
---Package
-------Class1
---------StateMachine1
-------Class2
---------StateMachine2
This means each of the contexts(Class1, Class2) have a statemachine, so you can add a variable (e.g. m_currentState) to each of the contexts. They communicate by send/broadcast event to context.
Note:
In EA 11, you can create an executable statemachine Artifact, then drag Class1 and Class2 and drop in to the artifact as properties. Then generate code on the artifact, the environment of interaction between instance of Class1 and instance of Class2 are automatically setup for you. You can generate, build and run. Then you can see the simulation running on the diagram as a "graphic representation of the debug process".
EA 11 currently support C/C++/Java/JavaScript/C# for executable statemachine simulation.
- Model
---Package
-------Class1
---------StateMachine1
---------StateMachine2
You can imagine there is a function:
Class1::RunAllStatemachines()
Then the two statemachines will run separately, but the attributes defined in Class1 can be accessed/modified by transition's effect and state's behaviors from both statemachines.
- Model
---Package
-------Class1
---------StateMachine
-------------submachineState : StateMachine_sub1
---------StateMachine_sub1
This is the common way of using submachine state, you can think this as a "function call"(submachine state) to a "function definition"(statemachine).
Note:
If entryPoint/exitPoint are used in the submachine, you need to create connectionPointReference on the submachine state to map to the submachine's entryPoint/exitPoint.
Hope this helps
