Multiple expressions in transition

345 views
Skip to first unread message

Michael

unread,
Oct 2, 2014, 3:58:43 PM10/2/14
to yakind...@googlegroups.com
Hi,

Can I use multiple expressions in transition? - to change state from state ON to OFF there must be met two conditions:
var1
&& var2

if var1=true and var2=true then stateON => stateOff

Best Regards
Michael
Message has been deleted

Michael

unread,
Oct 3, 2014, 3:15:00 AM10/3/14
to yakind...@googlegroups.com


Please check this screenshot:

Axel Terfloth

unread,
Oct 3, 2014, 11:55:23 AM10/3/14
to yakind...@googlegroups.com
Hi Michael,

the syntax for transitions labels is:

events [guard] / action

where events is a comma separated list of event triggers like: 

User.accept_call, User.unlock_screen, after 10s

If one of these events is active then the transition may fire. But it will  only fire if the guard evaluates to true. The guard is a boolean expression that can also use events.  So for your case you should write:

[User.accept_call && User.unlock_screen]

Just to be complete:  
e1, e2 [b && x == 10] 

is equivalent to  

[ (e1 || e2) && (b && x==10) 

Hope that helps.

Best regards,
Axel




Need professional support for Yakindu Statechart Tools?
Contact us: state...@itemis.de
 

--
You received this message because you are subscribed to the Google Groups "YAKINDU User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yakindu-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Michael

unread,
Oct 7, 2014, 7:59:28 AM10/7/14
to yakind...@googlegroups.com
Thanks for help :)

And how about transitions label with condition like : [User.accept_call && Phone.StateID=4] ?

var StateID: Integer

Axel Terfloth

unread,
Oct 7, 2014, 8:11:26 AM10/7/14
to yakind...@googlegroups.com
Hi Michael,

yes - if you mean ‚Phone.StateID==4‘  instead of the assignment ‚Phone.StateID=4‘  it should work when stateID is defined in an named interface : ‚

interface Phone:
var StateID: integer 

According to my explanation an equivalent expression would be:

User.accept_call [Phone.StateID==4]


Best regards,
Axel



Need professional support for Yakindu Statechart Tools?
Contact us: state...@itemis.de

Reply all
Reply to author
Forward
0 new messages