| [news.eclipse.modeling.gmf] Re: Link Mapping - Constraint for one Link |
Hallo Alex,
Hallo Alex,
I plan to create a diagram as enclosed.
the rectangles specified inside the input messageContainer represents the Class message. Since i do like to write a constraint to specify tath the number of messages should be equal in both the containers from the Aggregator Context; my constraint would be like;
Context AggregatorContainer inv: self.inputMessageChannel.srcMessageContainer.message->size() = self.outputMessageChannel.destMessageContainer.message->size()
Since i need to navigate through associations to both the containers i specify them in a bidirectional associations.
When i specified the constraint to prevent more that one linkmapping ;which you have specified in your previous reply , i receive a validation error and i have changed all the associations into bidirectional one; But still i get the below error
"Diagnosis of org.eclipse.gmf.codegen.gmfgen.impl.GenEditorGeneratorImpl@f379b8{platform:/resource/org.madan.sts1.eaipattern/model/eaipattern5.gmfgen#/} Invalid expression body 'self.outputMessageChannel2AC->collect(m|m.destMessageContainer = oppositeEnd)->size() = 0'. Cause: Invalid expression body 'self.outputMessageChannel2AC->collect(m|m.destMessageContainer = oppositeEnd)->size() = 0'. Cause: ERROR in (variableExpCS): (Unrecognized variable: (outputMessageChannel2AC))" which is ofcourse present in the ecore.
I have enclosed my project for your reference.
And; when i evaluate a constraint at AggregatorContainer context i get the
number of Links drawn between this AggregatorContainer and
MessageContainer as one inspite of having two of them.
Please shower some more light on this problem.
Regards, Madanagopal.
On Wed, 06 Sep 2006 15:27:41 +0200, Alex Shatalin <vano@xxxxxxxxxxx> wrote:
Hello Madanagopal,
1. Can you suggest a constraint that allows user to draw only one valid link mapping between the two classes.Try something similar to the following source end constraint: self.outputMessageChannel->collect(m|m.destMessageContainer = oppositeEnd)->size() = 0
This was written for messageChannel link from AggregatorContainer to MessageContainer. BTW, don't you think about creating two different meta-model objects for message links drawn in different directions?
2. What is the purpose of "Feature Seq Initializer" in link mapping.? Please find my snapshot of my metamodel as well.Take a look on: http://wiki.eclipse.org/index.php/GMF_Tutorial_Part_2#Feature_Initializers
----------------- Alex Shatalin
Attachment:
org.madan.sts1.eaipattern__.zip
Description: Zip archive