State Machine Transitions, Guard vs Constraint

Discussions about systems engineering product SysML functionalities

Moderator: Moderators

State Machine Transitions, Guard vs Constraint

Postby mustafaA » Fri Jul 28, 2017 6:54 am

Hi,
In STM transitions specifications, one can define a guard or a constraint for the transition to happen. Also, both guard and constraint is illustrated with the same icons, in the containment tree and transition specification. They work the same I think. But in specification of the transition, constraints placed under "constraints" branch, while guard is placed under "inner element" branch. I do not understand why it is needed that way? Are they the same or not? Does Cameo/SysML really need them both?

I see that in older version of Cameo, one could select a constraint for a guard. Even that was coherent. But now, in Cameo 18.5, I cannot select a constraint for a guard.

Moreover, one can define more than one constraints for a transition and it is treated as an element by the containment tree, while guard accepts only one expression. Is there a way to add more guards that each are treated as an element by the containment tree? Or should I go with the constraints only?

br,
Mustafa
mustafaA
Forum Newbie
Forum Newbie
 
Posts: 11
Posts Rating:0
Joined: Thu Feb 02, 2017 1:06 am

Re: State Machine Transitions, Guard vs Constraint

Postby piccolocanadesevolante@gmail.com » Sat Jul 29, 2017 6:14 am

mustafaA wrote:Hi,
...

Moreover, one can define more than one constraints for a transition and it is treated as an element by the containment tree, while guard accepts only one expression. Is there a way to add more guards that each are treated as an element by the containment tree? Or should I go with the constraints only?



I'm fairly new to Cameo and I'm battling with various elements due to limited experience (but I'm learning), I'm not going to pretend I can answer all your questions but what I can say is that, I have set up a model with multiple guards for a single transition. Basically, I have a transition (transmit message) and it is evaluate against multiple guards. In the 'guard' field of the specification properties for the transition, I entered constraints I had set up in the model separated by a comma and it works e.g. messagerate==1, messageformat==2 etc

I hope that make some sort of sense.
piccolocanadesevolante@gmail.com
Forum Newbie
Forum Newbie
 
Posts: 10
Posts Rating:0
Joined: Tue Jun 20, 2017 2:33 pm

Re: State Machine Transitions, Guard vs Constraint

Postby mustafaA » Wed Aug 02, 2017 3:09 am

Hi,
Thank you very much for the reply. No judgement for the SysML skills:)
I tried to seperate the guard expression by a comma, but in the containment tree it seems like only one element. So I think it would be counted one signal by the simmulation package. Apart from that, I would like to see the multiple guards as multiple elements in containment tree, even if comma seperated.

Example:
in State_1 There is Event_1
in State_2 there is Event_2
From State_2 to State_3 Guard [Event_1 == True, Event_2 == True]

So, does Cameo checks two independent events or checks for a one whole "Event_1 == True, Event_2 == True" event? In my experiments, it asks me the whole event. I might be doing something wrong.

br,
mustafaA
Forum Newbie
Forum Newbie
 
Posts: 11
Posts Rating:0
Joined: Thu Feb 02, 2017 1:06 am

Re: State Machine Transitions, Guard vs Constraint

Postby indraja.germanaite@nomagic.com » Tue Aug 08, 2017 9:58 am

Hello,

Thank you for your questions.
Please look at the attached excerpt from UML metamodel.

Transition.png

Here we can see, that:
1) the Transition may have just one Constraint that serves as a Guard, e.g. just one Constraint can play Guard’s role for the Transition.
2) the Transition may have many Triggers.

So you should describe your Event_1 and Event_2 not like Guards, but using two Triggers instead.
You can add more than one Trigger to the Transition using “All” properties mode in the Transition specification dialog.
Please look at the screenshot below for the exact place where to turn on "All" properties mode and where to add the Triggers.

Triggers.png
You do not have the required permissions to view the files attached to this post.
Best regards,
No Magic, Inc. Customer Support
indraja.germanaite@nomagic.com
Forum Newbie
Forum Newbie
 
Posts: 10
Posts Rating:0
Joined: Tue May 23, 2017 12:59 am


Return to SysML

Who is online

Users browsing this forum: No registered users and 0 guests