|
|
|
|
Re: How to generate single EditPart class for different contexts of the same EObject? (BPMN exampl) [message #543489 is a reply to message #543119] |
Tue, 29 June 2010 14:59 |
emil salageanu Messages: 94 Registered: June 2010 Location: Nice, France |
Member |
|
|
If my example with professor/student identities did not captivate too many people (I admit I could have thought at something more interesting to illustrate my purpose), let's then take the well known bpmn example contributed by intalio (http://www.eclipse.org/bpmn/ with a tutorial here: http://wiki.eclipse.org/GMF_Tutorial_BPMN).
In the example we have an "Activity" EObject that can be child of a Pool or child of a Subprocess. (the subprocess itself is child of a pool).
In the gmfmap file they have something like:
NodeMapping <Pool/Pool>
ChildReference <vertices:Activity/Activity>
NodeMapping <Activity/Activity>
ChildReference <vertices:SubProcess/SubProcess>
NodeMapping <SubProcess/SubProcess>
ChildReference <vertices:Activity/Activity>
Which generates the classes:
ActivityEditPart
ActivityCanonicalEditPolicy
ActivityCreateCommand
ActivityItemSemanticEditPolicy
and also
Activity2EditPart
Activity2CanonicalEditPolicy
Activity2CreateCommand
Activity2ItemSemanticEditPolicy
Now, If I need to change something in one of the EditParts or one of the policies (that shoud affect all the Activity figures), I have to do the same thing twice.
Is this the only way to model and generate a case like that in GMF?
[Updated on: Tue, 29 June 2010 15:00] Report message to a moderator
|
|
|
Re: How to generate single EditPart class for different contexts of the same EObject? (BPMN exampl) [message #543504 is a reply to message #543489] |
Tue, 29 June 2010 15:42 |
emil salageanu Messages: 94 Registered: June 2010 Location: Nice, France |
Member |
|
|
Well, sometimes is good speaking to oneself, I got it clear right now:
In the GMF map, when writting a ChidReference, we dont have to add a NodeMapping child, but rather make a reference to an already defined NodeMapping.
So, in ly earlier example:
<identity>
<a>
< a1/>
</a>
<b>
...
</b>
</identity>
The mapping would rather be :
Node Mapping <Professor/ProfesorNode>
ChildReference <id:Identity/IdentityNode>
NodeMappping < Identity/IdentityNode>
ChildReference <a/aNode>
NodeMapping <a:a ....>
ChildReferenece <a1/a1Node>
NodeMapping <...>
Node Mapping <Student/StudentNode>
ChildReference <id:Identity/IdentityNode> <-- reference to the eralier defined NodeMapping
rather then the mapping I defiined in my previous message.
This will generate 2 EditParts for Identity (one as child of Professor and one as child of Student) but only one edit part for each sub-element of Identity. It seems correct right now, as Identity might have different behaviour depending on its parent, but children inside an Identity element should always have the same behaviour independently of the context of Identity.
|
|
|
Re: How to generate single EditPart class for different contexts of the same EObject? (BPMN exampl) [message #638458 is a reply to message #543504] |
Thu, 11 November 2010 11:17 |
Eclipse User |
|
|
|
Originally posted by: marius.groeger.googlemail.com
Emil, Aurelien,
this is a bit late but anyway...
On 29.06.2010 17:42, emil salageanu wrote:
> The mapping would rather be :
>
>
> Node Mapping <Professor/ProfesorNode> ChildReference
> <id:Identity/IdentityNode>
> NodeMappping < Identity/IdentityNode>
> ChildReference <a/aNode>
> NodeMapping <a:a ....>
> ChildReferenece <a1/a1Node>
> NodeMapping <...> Node Mapping <Student/StudentNode> ChildReference
> <id:Identity/IdentityNode> <-- reference to the eralier defined NodeMapping
>
> rather then the mapping I defiined in my previous message.
> This will generate 2 EditParts for Identity (one as child of Professor
> and one as child of Student) but only one edit part for each sub-element
> of Identity. It seems correct right now, as Identity might have
> different behaviour depending on its parent, but children inside an
> Identity element should always have the same behaviour independently of
> the context of Identity.
With this mapping, are you able to move (drag&drop) a professor's
identity to a student? I have a similar setup, and I can't. Even though
the semantic element is moved, and even though the diagram element
*appears* to move, the diagram element is then somehow incomplete and
can't be moved at its new position. Its feature label is shows the
default value (<...>) instead of the name.
BTW, I'm on Eclipse Galileo. (Can't upgrade to Helios that easily since
the GMFTools don't work with Helios. [Last time I checked anyway.]).
Thanks for any inputs on this.
Marius
|
|
|
Powered by
FUDForum. Page generated in 0.01924 seconds