|OCL in Transition's Guard to access trigger properties [message #481353]
||Thu, 20 August 2009 15:19
| Timothy Marc
Registered: July 2009
i have a problem concerning guards and transitions and triggers. The
semnatics of an UML StateMachine is, that it is possible to access the
information carried by an event within the expression of a guard. In my
case, i want to compare a signal value with a value of the context
classifier of my transition's guard. My current approach is
self.data = self.Transition.Trigger.Signal.data
But i think this is not correct. Unfortunately, there is no convenient
example for this, mostly the example state only pseudo-ocl.
|Re: OCL in Transition's Guard to access trigger properties [message #492141 is a reply to message #492125]
||Mon, 19 October 2009 06:12
| Ed Willink
Registered: July 2009
As in the earlier reply; please ask UML questions on the UML newsgroup.
Don't the ^ or ^^ operators do this?
> I'm also interested in the answer for Timothy's question (if I
> understood him well):
> We have a transition that is triggered by a SignalEvent, and want to
> formulate the guard as an OCL expression (this is possible according to
> the OCL standard). The SignalEvent is generated because a Signal is
> received, which in our case has some attributes. According to the UML
> standard these attributes can be referenced in the guard expression. The
> question is how can we do this if we use OCL?
> My expectation would be to use these similarly to the attributes of the
> context (which - in case of guard expressions - is the context of the
> state machine that contains the transition, i.e., typically the class
> the behavior of which is described by the state machine). Or similarly
> as the parameters of an Operation in a pre- or postcondition.
> Signal S
> int targetID -- an attribute of signal S
> Class A
> int ID -- an attribute of class A ReceptionOfS -- declaration that
> class A can receive instances of signal S
> statemachine SM -- behavior of A is defined by SM
> transition T -- SM contains this T transition
> trigger: SignalEvent(Si) -- the reception of an Si instance of
> signal S triggers the transition
> guard: want to check if the targetID in Si is the same as the ID of A
> I would expect to write 'ID=targetID' (or maybe 'ID=Si.targetID').
> But as far as I have seen it is not supported in the current
> implementation. Is it right? And if yes are there any plans about it?
> Thanks in advance,
Powered by FUDForum
. Page generated in 0.01719 seconds