I have a difficult problem to solve regarding guards on value properties in classifier state machines. I apologize for no visuals, but showing my work is not possible. I'll first describe this system model (Given), then what I do to cause the error (When), and finally what happens (Then).
Given: I have decomposed a system into two subsystems. Each subsystem has a value property of the same type as the other subsystems. These two value properties are joined together with an inherited port and a redefined interface. (Basically, whenever the value type on the source end of the port changes, the value type on the target end of the port changes, too. The method is described here https://www.youtube.com/watch?v=di7oJYtp1T8). Finally, the value property is typed by an enumeration with two strings for enumeration literals (literal1, literal2).
Each of these subsystems have a classifier behavior in a state machine. The interaction of these two state machines leads us to the When:
When: Both state machines have an initial state, which is entered when the parent system is simulated. Next, I transition the state machine of the source subsystem (the one that controls the value type in the redefined interface) to a state. This state has an opaque action which sets the value of the value property to literal1. Next, I transition the target subsystem to a state which is guarded by the value of the value type.
I.E: <valueType>=="literal1"
Then: In a nutshell, nothing happens. The guard is false so the transition does not fire. This seems impossible, since the value in the simulation for this target subsystem's value type clearly says "literal1". You can watch it change when the opaque action on the source subsystem fires. I dug into the debug code, though, and found that for some reason the guard is evaluated before the system reads the value property of the target subsystem.
The debug output from the simulation looks something like this:
Evaluating guard: selection=="literal1"
The context is : State Secondary
Evalutation result is: false
[register] object=subsystemB@######
outflow=[literal1]
selction=[literal1]
etc., etc., etc...
Why does the simulation engine evaluate a guard before even registering the object? It doesn't seem like I'm modeling something too out of the ordinary. Please help!