Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Connect StateInvariant to a State
Connect StateInvariant to a State [message #1781362] Tue, 06 February 2018 12:36 Go to next message
Yoann Farré is currently offline Yoann FarréFriend
Messages: 36
Registered: November 2017
Member
Hello everyone,

In Papyrus, I try to use the element StateInvariant in a sequence diagram.

When I add a StateInvariant to a lifeline, I can then change the field "Invariant" in the properties view and add a constraint. Well. What I would do is different: I would connect the StateInvariant to a State (of the object represented by the lifeline). I can't find a such feature or how to do that cleanly in Papyrus.

Is it possible? Or I maybe missuse the StateInvariant element?

Have I to create a constraint to check the state of the object represented by the lifeline? In this case, could you give me an example, please?

Thanks for reading!

Re: Connect StateInvariant to a State [message #1781365 is a reply to message #1781362] Tue, 06 February 2018 12:58 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5883
Registered: July 2009
Senior Member
Hi

(If someone can explain StateInvariant to me, I'd be interested).

IMHO, some UML author didn't understand the secret flexibility underlying the lack of specification for Constraints and so duplicated the functionality of a Constraint on a State with a StateInvariant. Both are probably the same, but of course very dependent on what particular tools actually implement, If you want Eclipse OCL support, use Constraint.

Regards

Ed Willink
Re: Connect StateInvariant to a State [message #1781366 is a reply to message #1781362] Tue, 06 February 2018 13:03 Go to previous messageGo to next message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 1170
Registered: July 2009
Location: Canada
Senior Member

Hi,

As I understand it, the StateInvariant doesn't pertain particularly to States but rather is an invariant constraint on the state (in the abstract sense) of the object represented by the interaction lifeline, its attributes and such. The constraint that it specifies can be expressed in any way that you need. In your case, for example, the standard OCL operation oclIsInState(State) : Boolean may help if you formulate your constraint with OCL.
Re: Connect StateInvariant to a State [message #1781375 is a reply to message #1781366] Tue, 06 February 2018 14:30 Go to previous messageGo to next message
Yoann Farré is currently offline Yoann FarréFriend
Messages: 36
Registered: November 2017
Member
@Ed : Thank you for reply!

@Christian : I agree with your vision of the StateInvariant.

I was looking for a specific feature to link a StateInvariant to a State but it seems that it is not available in Papyrus. I will try with OCL Constraint. I have a lot to learn on that!

Re: Connect StateInvariant to a State [message #1781376 is a reply to message #1781375] Tue, 06 February 2018 14:40 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5883
Registered: July 2009
Senior Member
Hi

If your work leads to a simple example that demonstrates the utility of constraints on States, please share it with this newsgroup and I will try to ensure that Eclipse OCL supports it usefully and continues to do so by embedding it as a regression test.

Regards

Ed Willink
Previous Topic:Standalone: load profile from Papyrus models
Next Topic:Convert .uml to .ecore in Oxygen
Goto Forum:
  


Current Time: Sun May 20 16:10:10 GMT 2018

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

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

Back to the top