Skip to main content

alphaWorks  >  forumlabel  >  Model Transformation Framework  >  developerWorks

uml:Expression.body in UML2 ??? (solved!)    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

loginbox.header
 loginbox.welcomelabel loginbox.guestlabel
loginbox.signin
Permlink Replies: 1 - Pages: 1 - Last Post: Dec 12, 2007 9:17 AM Last Post By: Jinhui Threads: [ Previous | Next ]
Jinhui

Posts: 6
Registered: Dec 11, 2007 08:11:19 AM
uml:Expression.body in UML2 ??? (solved!)
Posted: Dec 11, 2007 08:25:42 AM
Click to report abuse...   Click to reply to this thread Reply
Hi everyone,

I'm currently reverse engineering an MTF project and there people have imported 3 package with the same "uml" prefix, like this:

(1) import uml "http://www.eclipse.org/uml2/1.1.0/UML"
(2) import uml "http:///com/ibm/mtf/uml.ecore"
(3) import uml "http:///com/ibm/mtf/xtools/uml2.ecore"

I changed (1) to the uml2/2.1.0, cause I'm using the new UML2 plugin, like this:
import uml "http://www.eclipse.org/uml2/2.1.0/UML"

Now the problem is, in the following .rdl rule, the element "expression.body" can't be resolved, even

relate bindExpressionDefaultValue (uml:Expression expression, doc:Document subDoc)
{
bindJavaObjToString[1] (match over subDoc.value, "defaultValue", expression.body)
}

so the my question is, which package does this "uml:Expression" relate to? why I can't find the "body" property of "uml:Expression"?

greetings.
Jinhui

Message was edited by: Jinhui

Jinhui

Posts: 6
Registered: Dec 11, 2007 08:11:19 AM
Re: what happens if I import 2 packages with the same prefix?
Posted: Dec 12, 2007 07:52:03 AM   in response to: Jinhui in response to: Jinhuithread.responsepost
Click to report abuse...   Click to reply to this thread Reply
I think I got the answer, in short, changes between different UML versions.

in case anyone else needs it:

the uml:Expression in UML1.x has the attribute body(which can be found in the UML1.4 Spec)
but in UML2.1 the design has been changed(see UML2.1 Spec): if I change type of expression from uml:Expression to uml:OpaqueExpression, it works.

//relate bindExpressionDefaultValue (uml:Expression expression, doc:Document subDoc)
relate bindExpressionDefaultValue (uml:OpaqueExpression expression, doc:Document subDoc)
{
bindJavaObjToString[1] (match over subDoc.value, "defaultValue", expression.body)
}
greetings.


Point your RSS reader here for a feed of the latest messages in all forums