I would like to connect PORT with Statechart, and then use the events routed to the Statechart.
I am using v 6.0. Help says that there is "getEvent()" method to get the events that triggered transitions.
However, compiler says there is no such method, and API description does not list this under Statechart class APIs.
"getEvent()" was a method in v 5.0. So, either it was forgotten to be added to v 6.0, or the Help was not
updated. I could not find ANY ability to get the events from Statechart.
Please help. Thanks
Georgiy Levchuk — 19.12.07
I found that there is a variable "msg". I was able to access it, and it might be the variable that is
equivalent to the one supposed to be returned by "getEvent()". However, I am not sure if "msg" will
hold the received event until the next state of the statechart is activated (transition occurs). Please advise.
Thanks
Victor Gleim — 20.12.07
to Georgiy:
The feature that allows connecting a port with a statechart is not implemented in AnyLogic 6 yet.
You can use a variable 'msg' to access a message that triggers a transition in the Action code section.
Georgiy Levchuk — 20.12.07
To Victor:
From help, I determined that I can do "map" from port to Statechart, something like:
myPort.map(myStatechart);
Help said that the messages will be routed from myPort to the myStatechart
Is this wrong?
Thanks
Victor Gleim — 21.12.07
to Georgiy:
You are right! I am mistaken. You could map a port with a statechart. So when a message is received by the port, the
method 'receiveMessage' of the statechart will be called.