Skip to main content



      Home
Home » Modeling » UML2 » Connect StateInvariant to a State
Connect StateInvariant to a State [message #1781362] Tue, 06 February 2018 07:36 Go to next message
Eclipse UserFriend
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 07:58 Go to previous messageGo to next message
Eclipse UserFriend
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 08:03 Go to previous messageGo to next message
Eclipse UserFriend
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 09:30 Go to previous messageGo to next message
Eclipse UserFriend
@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 09:40 Go to previous message
Eclipse UserFriend
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: Wed Jul 16 14:38:31 EDT 2025

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

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

Back to the top