The solution is to consider that in RoboSim the only event permitted in a Communication, which can only be used in triggers of Transitions, must be exec.
From an implementation standpoint, as the event attribute is a reference it needs to point to an instance of Event. Therefore, we define a new library under lib/robosim/score.rst of this plug-in that contains a package named robosim__core with one interface events that contains the only event exec.
The RoboSimRuntimeModule.xtend class has been changed to make use of a new RoboSimImportURIGlobalScopeProvider and RoboSimImportedNamespaceAwareLocalScopeProvider, which subclass their RoboChart counterparts, to ensure that the resource lib/robosim/score.rst is loaded in the ResourceSet and that exec is in scope. The RoboSim scope provider has been changed to ensure the event exec of an ExecTrigger can be found in this library.
The key changes in the Xtext grammar is that ExecTrigger now has the rule: event=[Event|'exec']. This allows the exec keyword to be used, while still encoding a cross-reference to the appropriate event. (I did experiment with alternatives to auto-populate this attribute behind the scenes, but the serializer, which is crucial for the work with Epsilon, wouldn't be able to handle it if implemented differently). Note that the ability to handle this kind of terminal in Xtext is only possible from version 2.22 onwards.
ExecStatement has the same rule as before, which uses the keyword exec.
So in conclusion the textual representation, and metamodel, are the same as before. I've checked this works properly with a local Eclipse installation. The only difference regarding the work with Epsilon is that when an ExecTrigger element is created it needs to be populated with the correct exec Event. I have also tested that this is possible and have let @madielfilho know of the impending changes.
After this is merged further updates are required to the following RoboSim plug-ins: graphical, assertions and generator-csp.
This pull request contains changes to support the changes to the
Communication
class as merged in https://github.com/UoY-RoboStar/robochart-metamodel/pull/8, where the attributeevent
is now mandatory.The solution is to consider that in RoboSim the only event permitted in a
Communication
, which can only be used in triggers ofTransitions
, must beexec
.From an implementation standpoint, as the
event
attribute is a reference it needs to point to an instance ofEvent
. Therefore, we define a new library underlib/robosim/score.rst
of this plug-in that contains a package namedrobosim__core
with one interfaceevents
that contains the only eventexec
.The
RoboSimRuntimeModule.xtend
class has been changed to make use of a newRoboSimImportURIGlobalScopeProvider
andRoboSimImportedNamespaceAwareLocalScopeProvider
, which subclass their RoboChart counterparts, to ensure that the resourcelib/robosim/score.rst
is loaded in the ResourceSet and thatexec
is in scope. The RoboSim scope provider has been changed to ensure the eventexec
of anExecTrigger
can be found in this library.The key changes in the Xtext grammar is that ExecTrigger now has the rule:
event=[Event|'exec']
. This allows theexec
keyword to be used, while still encoding a cross-reference to the appropriate event. (I did experiment with alternatives to auto-populate this attribute behind the scenes, but the serializer, which is crucial for the work with Epsilon, wouldn't be able to handle it if implemented differently). Note that the ability to handle this kind of terminal in Xtext is only possible from version 2.22 onwards.ExecStatement has the same rule as before, which uses the keyword
exec
.So in conclusion the textual representation, and metamodel, are the same as before. I've checked this works properly with a local Eclipse installation. The only difference regarding the work with Epsilon is that when an
ExecTrigger
element is created it needs to be populated with the correctexec
Event. I have also tested that this is possible and have let @madielfilho know of the impending changes.After this is merged further updates are required to the following RoboSim plug-ins: graphical, assertions and generator-csp.