[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [henshin-dev] {Disarmed} Re: [question?] using the new version of henshin
|
I guess that Simon needs a special loader for his files which is
dedicated to uml profiles (UMLResource.Factory.INSTANCE) and which
requires additional magic
(.URIConverter.URI_MAP.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
uri.appendSegment("profiles").appendSegment("")); etc.)
This is pretty specific and not supported by our quite EMF generic
editor tooling.
Simon, you might rather want to use the Henshin API to load your
files and then perform the transformation. Have a look at the
example plugin how to achieve this.
Regards, Stefan
Am 17.04.2012 08:27, schrieb Christian Krause:
Hi Simon,
On 16.04.2012 22:29, sih wrote:
i wonder if there can be a way that henshin can load a profile
and use the profile as the loaded metamodel of a model for
manipulation ... ...
I do not fully understand what you want to achieve. In general, in
Henshin you specify transformations over EMF models (typed over
Ecore) and apply these transformations to instance models (typed
over the EMF models).
Cheers,
Christian
many thanks!
yours sincerely,
Fenglin Han
On 16.04.2012 20:34, Christian Krause wrote:
Hi Simon,
this is not a problem of Henshin. The loading of models is
completely done by EMF. There is no bug or anything like this.
It is just a matter of correctly using URIs. Proper URI
handling can be quite tricky in EMF.
Looking at your example, the first problem I see is that I am
not aware o the "pathmap" scheme in the first example. If you
want to refer to a file in your workspace, the correct way to
do it would be using a platform-resource URI:
platform:/resource/project-name/path
where you have to replace "project-name" and "path". Using
this pattern you can access files in your workspace using an
absolute path (within your workspace, not the filesystem!).
What works better in practice is to use relative URIs. In your
model, a relative path could be used like this:
<references xmi:type="ecore:EPackage" href="">"arctis.profile.uml#_WFTqUXjGEdyxtoUMycQn9Q"/>
assuming that the UML model and the profile are located in the
same directory.
Of course, you are not editing your models using a text
editor. What you have to ensure is that in the editors you use
you properly import your models, e.g. using relative paths.
When you save the files, open them in a text editor and make
sure the URIs are ok. If you refer to elements in other files,
you usually should have relative paths or platform-resource
URIs.
Cheers,
Christian
On 04/16/2012 02:38 PM, sih wrote:
hi Christian,
i have a problem with applying henshin to the uml model
i use. it seems to be the problem of pathmap definition in
the model plugin.
for example the following lines compares two ways of
importing a profile:
<profileApplication xmi:id="_uMWN8YYXEeGsGOj-M3HL4Q">
<eAnnotations xmi:id="_uMWN8oYXEeGsGOj-M3HL4Q"
source=MailScanner has detected a possible fraud
attempt from "www.eclipse.org" claiming to be
"http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage" href="">"pathmap://ARCTIS_PROFILES/arctis.profile.uml#_WFTqUXjGEdyxtoUMycQn9Q"/>
</eAnnotations>
<appliedProfile
href=""/>
</profileApplication>
<profileApplication
xmi:id="_ONjgoIYYEeGsGOj-M3HL4Q">
<eAnnotations xmi:id="_ONjgoYYYEeGsGOj-M3HL4Q"
source=MailScanner has detected a possible fraud
attempt from "www.eclipse.org" claiming to be
"http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage" href=""true" class="moz-txt-link-freetext"
href="file:/E:/Program%20Files/Papyrus-1.12/workspace/ArctisProfile/model/arctis.profile.uml#_85TLIAoDEeGPj89VQGUoOg">file:/E:/Program%20Files/Papyrus-1.12/workspace/ArctisProfile/model/arctis.profile.uml#_85TLIAoDEeGPj89VQGUoOg"/>
</eAnnotations>
<appliedProfile href="" moz-do-not-send="true"
class="moz-txt-link-rfc2396E"
href="file:/E:/Program%20Files/Papyrus-1.12/workspace/ArctisProfile/model/arctis.profile.uml#_lbS9gFm_Ed-BsIyprHxBdA">"file:/E:/Program%20Files/Papyrus-1.12/workspace/ArctisProfile/model/arctis.profile.uml#_lbS9gFm_Ed-BsIyprHxBdA"/>
</profileApplication>
Henshin will recognize the second way of importing the
profiles. but the first way,the profile is contained in the
plugin in the eclipse environment, won't.
Can henshin support pathmap in eclipse plugin? if not, is
there a compensate way?
yours sincerely,
Simon Han
On 14.04.2012 11:43, Christian Krause wrote:
Hi Simon,
if the attribute is of type String and you want to assign
the constant "hahah" to it, the correct _expression_ would
be:
body="hahah"
So if you want to use a string constant, you have to use
the quotes.
Cheers,
Christian
Am 13.04.2012 21:15, schrieb sih:
hi i got a not-working example:
this one is not related with profiling, is about add
attributes to the nodes.
add a comment to a flow final node.
if i put a attribute to the comment, the transformation
will not working, if i delete the property in the
comment node. the rule will work.
since any "real" uml models will contain attributes,
this should be corrected.
to avoid complexity, i did not apply any profile.
you can test it out with the attached files: root model
: My1.uml henshin file: uml_metamodel.henshin
yours sincerely,
Simon Han
_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev
_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev
_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev
_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev
_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev
_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev
|
Attachment:
signature.asc
Description: OpenPGP digital signature