Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » How to add time related information in state machine?
How to add time related information in state machine? [message #1736864] Mon, 04 July 2016 05:17 Go to next message
Syed Samsul Arefin is currently offline Syed Samsul ArefinFriend
Messages: 17
Registered: May 2016
Junior Member
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 05:23 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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 #1736868 is a reply to message #1736867] Mon, 04 July 2016 05:37 Go to previous messageGo to next message
Syed Samsul Arefin is currently offline Syed Samsul ArefinFriend
Messages: 17
Registered: May 2016
Junior Member
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.
Re: How to add time related information in state machine? [message #1736869 is a reply to message #1736868] Mon, 04 July 2016 05:54 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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
Previous Topic:XMI idref reading error
Next Topic:Resolve proxy containing qualifiedName
Goto Forum:
  


Current Time: Tue Apr 23 17:38:00 GMT 2024

Powered by FUDForum. Page generated in 0.03262 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top