How to add time related information in state machine? [message #1736864] |
Mon, 04 July 2016 01:17  |
Eclipse User |
|
|
|
In a state machine, as we know, a transition occurs when a trigger fire and a certain guard is true. Now, I want to add a little bit more information (constraint) here which is, if the constraint is true for a certain amount of time (say 10 sec) then the transition will occur. I mean, It does not only require the constraint to be to occur the transition true but also it requires the constraint to be true for at least 10 second.
So, is that feasible? If so, how can I do it using papyrus and ocl? Do I have to use MARTE? Any suggestion? Thank you.
|
|
|
Re: How to add time related information in state machine? [message #1736867 is a reply to message #1736864] |
Mon, 04 July 2016 01:23   |
Eclipse User |
|
|
|
Hi
If you just want to express a constraint using time you can use a
comment, or some spurious OCL that has no more value than a comment.
If you want execution to observe a time constraint, you need a code
generation approach that supports time. Perhaps the combination of MARTE
and Papyrus-RT may help.
Regards
Ed Willink
On 04/07/2016 07:17, Syed Samsul Arefin wrote:
> In a state machine, as we know, a transition occurs when a trigger fire
> and a certain guard is true. Now, I want to add a little bit more
> information (constraint) here which is, if the constraint is true for a
> certain amount of time (say 10 sec) then the transition will occur. I
> mean, It does not only require the constraint to be to occur the
> transition true but also it requires the constraint to be true for at
> least 10 second.
> So, is that feasible? If so, how can I do it using papyrus and ocl? Do I
> have to use MARTE? Any suggestion? Thank you.
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
|
|
|
|
Re: How to add time related information in state machine? [message #1736869 is a reply to message #1736868] |
Mon, 04 July 2016 01:54  |
Eclipse User |
|
|
|
Hi
There are at least a couple of temporal OCL extensions that might
interest you.
However 'spurious' OCL might do. Just add a system routine somewhere:
currentTime()
so that you can cache "startTime = currentTime()" and check that
"currentTime() < startTime + 10.0"
Regards
Ed Willink
On 04/07/2016 07:37, Syed Samsul Arefin wrote:
> Ed,
> Thanks for your quick reply. Actually, I am developing a tool to
> generate test out of the state machine. The domain actually has a
> requirement like this. Yeah, comment is an option. But, I am wondering
> if there is any special uml element/ocl-feature using which I can add
> the required duration of a constraint of a state machine while keeping
> the model error free. I will not execute the state machine, rather I
> want it to be error free while having such information. Thanks.
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
|
|
|
Powered by
FUDForum. Page generated in 0.03064 seconds