Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Executable UML(This topic is intended to discuss how to use Papyrus for editing Executable UML (Shlaer-Mellor OOA/D) models)
Executable UML [message #1262479] Mon, 03 March 2014 17:29 Go to next message
Dan George is currently offline Dan George
Messages: 9
Registered: December 2012
Junior Member
I would like mark Attribute Properties and have those marks visible in the diagram as well as to QTV and MOF2T. I'm not entirely sure about the best way to do that but Sparx EA handles it with a special tag: "xuml". Attributes with that tag have the value of the tag displayed next to them in the class diagram.

Foo
---
+FooId {I}
+BarId {R3}
etc...

Any ideas?

Thanks,
Dan
Re: Executable UML [message #1262968 is a reply to message #1262479] Tue, 04 March 2014 04:48 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
Dan, UML supports marking properties as identifiers already, right?
Re: Executable UML [message #1263128 is a reply to message #1262968] Tue, 04 March 2014 08:00 Go to previous messageGo to next message
Dan George is currently offline Dan George
Messages: 9
Registered: December 2012
Junior Member
Rafael, yes, a Property can have an isID property which is specified using property-modifier notation.

+idNumber : int {id}

This is close to EUML but it doesn't allow for multiple identifier sets.

The 2.5 beta spec mentions identifiers in the context of database keys or id attributes in XML. Leon Starr points out that in EUML models the {I}, {I2}, etc. marks are for the purpose of analysis and not implementation. He advises that modeling all identifying constraints helps to avoid creating buggy programs.

I could create an <<xuml>> stereotype and give it properties identifierSet and attributeOrigin. If identifierSet == "null" then non-identifier; otherwise, identifierSet value specifies the set membership. If attributeOrigin = ["native" | <relation-name>].

Does Papyrus provide a way for me to cause the stereotype values to be rendered as property-modifiers in the notation? E.g., +idNumber : int {I, R1}.

[Updated on: Tue, 04 March 2014 08:02]

Report message to a moderator

Re: Executable UML [message #1263238 is a reply to message #1263128] Tue, 04 March 2014 09:58 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille Letavernier
Messages: 457
Registered: February 2011
Senior Member
Hi,


The brace notation can have different semantics:

- Modifiers

P1: String[*] {readonly, unique}


- Constraints

E.g. In UML 2.5 / Fig 7.15:

size : Integer {size >= 0}


Additionnally, you can use stereotypes. The stereotype itself is not displayed within braces, but its properties can be:

┬źMyStereotype┬╗ {stProperty=value} P1: String


Papyrus currently doesn't support the braces notation for constraints. It doesn't provide support for custom "tags" either (Which, AFAIK, is not a standard UML concept anyway).


Regards,
Camille


Camille Letavernier
Papyrus developer
Re: Executable UML [message #1263540 is a reply to message #1263238] Tue, 04 March 2014 15:22 Go to previous messageGo to next message
Dan George is currently offline Dan George
Messages: 9
Registered: December 2012
Junior Member
Hi Camille,
thank you for pointing out the syntax for using the stereotype notation. It isn't quite as concise as the notation show in Section 9.5.4, of the October 2012 UML 2.5 beta, but it works for me.

You are right about tags. I think Sparx EA has the feature left over from very early days. Stereotypes are the official mechanism for extending UML with custom/profile-specific marks.

Cheers,
Dan
Re: Executable UML [message #1263684 is a reply to message #1263540] Tue, 04 March 2014 17:44 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille Letavernier
Messages: 457
Registered: February 2011
Senior Member
Hi Dan,


UML 2.5 Section 9.5.4 only shows brace notation for Modifiers. Modifiers are built-in UML concepts, which cannot be customized.

Quote:
<prop-modifier> indicates a modifier that applies to the Property.
<prop-modifier> ::= 'readOnly' | 'union' | 'subsets' <property-name> | 'redefines' <property-name> | 'ordered' | 'unordered' | 'unique' | 'nonunique' | 'seq' | 'sequence' | 'id' | <prop-constraint>


There is a set of predefined values; you can't add your own modifiers.


Regards,
Camille


Camille Letavernier
Papyrus developer
Re: Executable UML [message #1270418 is a reply to message #1263684] Thu, 13 March 2014 00:50 Go to previous messageGo to next message
Dan George is currently offline Dan George
Messages: 9
Registered: December 2012
Junior Member
Hi Camille,
I think <prop-constraint> leaves a way to extend the set. I can assume that constraints "I", "I#", etc indicate identifier set membership and "R#" indicates the property value must match the identifiers on the other end of R#. If the syntax for these constraints happens to collide with another constraint language I can qualify them with something like "xuml", right?

However, Papyrus doesn't support the notation so I guess it doesn't matter.

Thanks,
Dan
Re: Executable UML [message #1360533 is a reply to message #1263540] Fri, 16 May 2014 21:30 Go to previous message
Charles Rivet is currently offline Charles Rivet
Messages: 1
Registered: May 2014
Junior Member
Tags, or "tagged values" were a UML1 extension mechanism that allows for arbitrary text to be added to an element. There was not syntax associated, asides from being displayed in curly brackets.
The concept of tags has been replaced by stereotypes in UML2, which now have more semantics associated with them. For backward compatibility, some early UML2 tools simply provided the ability to enter anything in a special, no-syntax, stereotype property (along with provided formal definitions).
Previous Topic:Papyrus model to emf/uml2 - stereotypes get lost
Next Topic:Sample Reflective Ecore Editor's Validator
Goto Forum:
  


Current Time: Mon Sep 22 04:35:54 GMT 2014

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

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