Home » Modeling » UML2 » Reusing package-element in UML Metamodel extension
Reusing package-element in UML Metamodel extension [message #478102] |
Sun, 04 January 2009 21:28 |
Eclipse User |
|
|
|
Hello,
Is there any possibility to use uml:package in an extended UML-Metamodel ?
What I tried so far:
-Create new UML model (Model Object: Model)
-I add an UML Package element to the model and then I transform this
model to a metamodel (convert to->metamodel).
After that I generate EMF Model and let EMF create the code for the
model and editor.
When I run the editor there is no UML Package available in my instance
model.
Regards,
Deepak
|
|
| | |
Re: Reusing package-element in UML Metamodel extension [message #478113 is a reply to message #478110] |
Wed, 07 January 2009 18:37 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Deepak,
I think you might want something like in the attachment.
Try adding the attached .ecore, reloading you .genmodel, then regenerate
all.
Let me know if that is what you were looking for.
-James.
"Deepak" <dee_n@gmx.de> wrote in message
news:gk2a1s$15v$1@build.eclipse.org...
> Hi James,
>
> Yes, I can see the corresponding EPackage but if I run the generated
> editor I can't insert any UML:Package element in my model. I just start
> with the Activity element.
>
> I attached a sample of my UML extended model and the derived Ecore file.
>
> I want to create a specific activity diagram (no value pins, no
> callbehavior action and some other unnecessary elements) which contains
> OCL constraints.
>
> The layout of my activity diagram should be:
>
> uml:package
> Activity
> CallOperationAction
> InputPin
> OutputPin
> ControlFlow
> InitialNode
> FinalNode....
>
>
> Regards,
>
> Deepak
>
>
>
>
>
>
>
>
>
>
> James Bruck schrieb:
>> Hi Deepak,
>>
>> If you can see the corresponding EPackage in the EMF model then the EMF
>> codegenerator should create a package for you.
>> What does your EMF model look like?
>>
>> Cheers,
>> - James.
>>
>>
>> "Deepak" <dee_n@gmx.de> wrote in message
>> news:gjr9lq$17g$1@build.eclipse.org...
>>> Hello,
>>>
>>> Is there any possibility to use uml:package in an extended UML-Metamodel
>>> ?
>>>
>>> What I tried so far:
>>> -Create new UML model (Model Object: Model)
>>>
>>> -I add an UML Package element to the model and then I transform this
>>> model
>>> to a metamodel (convert to->metamodel).
>>> After that I generate EMF Model and let EMF create the code for the
>>> model
>>> and editor.
>>>
>>> When I run the editor there is no UML Package available in my instance
>>> model.
>>>
>>>
>>> Regards,
>>>
>>> Deepak
>>>
>>>
>>>
>>
>>
>
>
------------------------------------------------------------ --------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:Standard="http://www.eclipse.org/uml2/schemas/Standard/1"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
> xsi:schemaLocation="http://www.eclipse.org/uml2/schemas/Standard/1
> pathmap://UML_PROFILES/Standard.profile.uml#_yzU58YinEdqtvbn fB2L_5w">
> <uml:Model xmi:id="_0" name="TestMeta">
> <packagedElement xmi:type="uml:Package" xmi:id="ActvityWithOCL"
> name="ActvityWithOCL">
> <packagedElement xmi:type="uml:Activity"
> xmi:id="ActvityWithOCL-ExtActivity" name="ExtActivity"
> precondition="ActvityWithOCL-ExtActivity-OCL">
> <ownedRule xmi:id="ActvityWithOCL-ExtActivity-OCL" name="OCL">
> <specification xmi:type="uml:OpaqueExpression"
> xmi:id="ActvityWithOCL-ExtActivity-OCL-containsInputPin"
> name="containsInputPin">
> <language>OCL</language>
> </specification>
> </ownedRule>
> <generalization
> xmi:id="ActvityWithOCL-ExtActivity-_generalization.0">
> <general xmi:type="uml:Class"
> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Activity"/>
> </generalization>
> <node xmi:type="uml:CallBehaviorAction"
> xmi:id="ActvityWithOCL-ExtActivity-testGet" name="testGet"/>
> </packagedElement>
> </packagedElement>
> <profileApplication xmi:id="_profileApplication.0">
> <eAnnotations
> xmi:id=" _profileApplication.0-_http2F2Fwww.eclipse.org2Fuml22F2.0.02 FUML "
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href=" pathmap://UML_PROFILES/Standard.profile.uml#_yzU58YinEdqtvbn fB2L_5w"/>
> </eAnnotations>
> <appliedProfile
> href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
> </profileApplication>
> </uml:Model>
> <Standard:Metamodel xmi:id="_mORn4L--Ed2_NN0Jjs2C1w" base_Model="_0"/>
> <Standard:Metaclass xmi:id="_mOax0L--Ed2_NN0Jjs2C1w"
> base_Class="ActvityWithOCL-ExtActivity"/>
> </xmi:XMI>
>
------------------------------------------------------------ --------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="testMeta"
> nsURI="http:///testMeta.ecore" nsPrefix="testMeta">
> <eSubpackages name="actvityWithOcl"
> nsURI="http:///testMeta/actvityWithOcl.ecore"
> nsPrefix="testMeta.actvityWithOcl">
> <eClassifiers xsi:type="ecore:EClass" name="ExtActivity"
> eSuperTypes=" platform:/plugin/org.eclipse.uml2.uml/model/UML.ecore#//Acti vity ">
> <eOperations name="ocl" eType="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
> <eParameters name="diagnostics" eType="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain">
> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
> <details key="documentation" value="The chain of diagnostics to
> which problems are to be appended."/>
> </eAnnotations>
> </eParameters>
> <eParameters name="context">
> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
> <details key="documentation" value="The cache of
> context-specific information."/>
> </eAnnotations>
> <eGenericType eClassifier="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EMap">
> <eTypeArguments eClassifier="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/>
> <eTypeArguments eClassifier="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/>
> </eGenericType>
> </eParameters>
> </eOperations>
> </eClassifiers>
> </eSubpackages>
> </ecore:EPackage>
>
|
|
|
Re: Reusing package-element in UML Metamodel extension [message #478114 is a reply to message #478113] |
Thu, 08 January 2009 08:54 |
Eclipse User |
|
|
|
Thanks James !!
That's exactly what I want.
I thought it could be done in with the UML editor itself.
Regards,
Deepak
James Bruck schrieb:
> Hi Deepak,
>
> I think you might want something like in the attachment.
> Try adding the attached .ecore, reloading you .genmodel, then regenerate
> all.
> Let me know if that is what you were looking for.
>
> -James.
>
> "Deepak" <dee_n@gmx.de> wrote in message
> news:gk2a1s$15v$1@build.eclipse.org...
>> Hi James,
>>
>> Yes, I can see the corresponding EPackage but if I run the generated
>> editor I can't insert any UML:Package element in my model. I just start
>> with the Activity element.
>>
>> I attached a sample of my UML extended model and the derived Ecore file.
>>
>> I want to create a specific activity diagram (no value pins, no
>> callbehavior action and some other unnecessary elements) which contains
>> OCL constraints.
>>
>> The layout of my activity diagram should be:
>>
>> uml:package
>> Activity
>> CallOperationAction
>> InputPin
>> OutputPin
>> ControlFlow
>> InitialNode
>> FinalNode....
>>
>>
>> Regards,
>>
>> Deepak
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> James Bruck schrieb:
>>> Hi Deepak,
>>>
>>> If you can see the corresponding EPackage in the EMF model then the EMF
>>> codegenerator should create a package for you.
>>> What does your EMF model look like?
>>>
>>> Cheers,
>>> - James.
>>>
>>>
>>> "Deepak" <dee_n@gmx.de> wrote in message
>>> news:gjr9lq$17g$1@build.eclipse.org...
>>>> Hello,
>>>>
>>>> Is there any possibility to use uml:package in an extended UML-Metamodel
>>>> ?
>>>>
>>>> What I tried so far:
>>>> -Create new UML model (Model Object: Model)
>>>>
>>>> -I add an UML Package element to the model and then I transform this
>>>> model
>>>> to a metamodel (convert to->metamodel).
>>>> After that I generate EMF Model and let EMF create the code for the
>>>> model
>>>> and editor.
>>>>
>>>> When I run the editor there is no UML Package available in my instance
>>>> model.
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Deepak
>>>>
>>>>
>>>>
|
|
|
Re: Reusing package-element in UML Metamodel extension [message #478115 is a reply to message #478114] |
Thu, 08 January 2009 16:00 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Deepak,
Yes you could do this with UML itself - you can do all your metamodeling
using UML only. Simply create a meta-type called MyPackage that
specializes the Package meta-type from UML. Behind the scenes, the .uml
model gets converted to a .ecore model. EMF codegeneration works with the
..ecore representation. The .ecore representation should look like the
previously attached file - I cut some corners by just jumping to the .ecore
representation.
What you are doing in your example is "meta-modeling" not "modeling". That
is, you are trying to create specializtions of UML meta-types etc. as
opposed to creating a model using *instances* of UML types. It looks like
you created a "Package" which is an instance of the uml:Package metatype
(modeling); what you want to do is create a new meta-type called "MyPackge"
which extends uml:Package (meta-modeling). The "MyPackage" would be
represented with an instance of a MOF meta-type.
Hopefully I didn't overly complicate this ;)
Cheers,
- James.
"Deepak" <dee_n@gmx.de> wrote in message
news:gk4eve$igu$1@build.eclipse.org...
> Thanks James !!
>
> That's exactly what I want.
>
> I thought it could be done in with the UML editor itself.
>
> Regards,
>
> Deepak
>
>
>
> James Bruck schrieb:
>> Hi Deepak,
>>
>> I think you might want something like in the attachment.
>> Try adding the attached .ecore, reloading you .genmodel, then regenerate
>> all.
>> Let me know if that is what you were looking for.
>>
>> -James.
>>
>> "Deepak" <dee_n@gmx.de> wrote in message
>> news:gk2a1s$15v$1@build.eclipse.org...
>>> Hi James,
>>>
>>> Yes, I can see the corresponding EPackage but if I run the generated
>>> editor I can't insert any UML:Package element in my model. I just start
>>> with the Activity element.
>>>
>>> I attached a sample of my UML extended model and the derived Ecore file.
>>>
>>> I want to create a specific activity diagram (no value pins, no
>>> callbehavior action and some other unnecessary elements) which contains
>>> OCL constraints.
>>>
>>> The layout of my activity diagram should be:
>>>
>>> uml:package
>>> Activity
>>> CallOperationAction
>>> InputPin
>>> OutputPin
>>> ControlFlow
>>> InitialNode
>>> FinalNode....
>>>
>>>
>>> Regards,
>>>
>>> Deepak
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> James Bruck schrieb:
>>>> Hi Deepak,
>>>>
>>>> If you can see the corresponding EPackage in the EMF model then the EMF
>>>> codegenerator should create a package for you.
>>>> What does your EMF model look like?
>>>>
>>>> Cheers,
>>>> - James.
>>>>
>>>>
>>>> "Deepak" <dee_n@gmx.de> wrote in message
>>>> news:gjr9lq$17g$1@build.eclipse.org...
>>>>> Hello,
>>>>>
>>>>> Is there any possibility to use uml:package in an extended
>>>>> UML-Metamodel ?
>>>>>
>>>>> What I tried so far:
>>>>> -Create new UML model (Model Object: Model)
>>>>>
>>>>> -I add an UML Package element to the model and then I transform this
>>>>> model
>>>>> to a metamodel (convert to->metamodel).
>>>>> After that I generate EMF Model and let EMF create the code for the
>>>>> model
>>>>> and editor.
>>>>>
>>>>> When I run the editor there is no UML Package available in my instance
>>>>> model.
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>> Deepak
>>>>>
>>>>>
>>>>>
|
|
|
Re: Reusing package-element in UML Metamodel extension [message #478119 is a reply to message #478115] |
Fri, 09 January 2009 09:18 |
Eclipse User |
|
|
|
Hi James,
Thank you very much for your explanation. I should always keep in mind
the difference between metamodeling and modeling.
This confused me:
The element uml:model will be converted to <<metamodel>> when choosing
"convert to"-->"Metamodel.
So I somehow thought uml:package will also be automatically converted to
<<metapackage>>
Regards,
Deepak
James Bruck schrieb:
> Hi Deepak,
>
> Yes you could do this with UML itself - you can do all your metamodeling
> using UML only. Simply create a meta-type called MyPackage that
> specializes the Package meta-type from UML. Behind the scenes, the .uml
> model gets converted to a .ecore model. EMF codegeneration works with the
> .ecore representation. The .ecore representation should look like the
> previously attached file - I cut some corners by just jumping to the .ecore
> representation.
>
> What you are doing in your example is "meta-modeling" not "modeling". That
> is, you are trying to create specializtions of UML meta-types etc. as
> opposed to creating a model using *instances* of UML types. It looks like
> you created a "Package" which is an instance of the uml:Package metatype
> (modeling); what you want to do is create a new meta-type called "MyPackge"
> which extends uml:Package (meta-modeling). The "MyPackage" would be
> represented with an instance of a MOF meta-type.
>
> Hopefully I didn't overly complicate this ;)
>
> Cheers,
> - James.
>
>
> "Deepak" <dee_n@gmx.de> wrote in message
> news:gk4eve$igu$1@build.eclipse.org...
>> Thanks James !!
>>
>> That's exactly what I want.
>>
>> I thought it could be done in with the UML editor itself.
>>
>> Regards,
>>
>> Deepak
>>
>>
>>
>> James Bruck schrieb:
>>> Hi Deepak,
>>>
>>> I think you might want something like in the attachment.
>>> Try adding the attached .ecore, reloading you .genmodel, then regenerate
>>> all.
>>> Let me know if that is what you were looking for.
>>>
>>> -James.
>>>
>>> "Deepak" <dee_n@gmx.de> wrote in message
>>> news:gk2a1s$15v$1@build.eclipse.org...
>>>> Hi James,
>>>>
>>>> Yes, I can see the corresponding EPackage but if I run the generated
>>>> editor I can't insert any UML:Package element in my model. I just start
>>>> with the Activity element.
>>>>
>>>> I attached a sample of my UML extended model and the derived Ecore file.
>>>>
>>>> I want to create a specific activity diagram (no value pins, no
>>>> callbehavior action and some other unnecessary elements) which contains
>>>> OCL constraints.
>>>>
>>>> The layout of my activity diagram should be:
>>>>
>>>> uml:package
>>>> Activity
>>>> CallOperationAction
>>>> InputPin
>>>> OutputPin
>>>> ControlFlow
>>>> InitialNode
>>>> FinalNode....
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Deepak
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> James Bruck schrieb:
>>>>> Hi Deepak,
>>>>>
>>>>> If you can see the corresponding EPackage in the EMF model then the EMF
>>>>> codegenerator should create a package for you.
>>>>> What does your EMF model look like?
>>>>>
>>>>> Cheers,
>>>>> - James.
>>>>>
>>>>>
>>>>> "Deepak" <dee_n@gmx.de> wrote in message
>>>>> news:gjr9lq$17g$1@build.eclipse.org...
>>>>>> Hello,
>>>>>>
>>>>>> Is there any possibility to use uml:package in an extended
>>>>>> UML-Metamodel ?
>>>>>>
>>>>>> What I tried so far:
>>>>>> -Create new UML model (Model Object: Model)
>>>>>>
>>>>>> -I add an UML Package element to the model and then I transform this
>>>>>> model
>>>>>> to a metamodel (convert to->metamodel).
>>>>>> After that I generate EMF Model and let EMF create the code for the
>>>>>> model
>>>>>> and editor.
>>>>>>
>>>>>> When I run the editor there is no UML Package available in my instance
>>>>>> model.
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Deepak
>>>>>>
>>>>>>
>>>>>>
>
>
|
|
| |
Re: UML2 Metamodel extension [message #478161 is a reply to message #478154] |
Thu, 05 February 2009 17:19 |
Eclipse User |
|
|
|
Rodrigues schrieb:
> Hi Deepak,
>
> I am trying to transform a annotated(with MARTE)deployment diagram
> (source model in .di2 extension)into another model.
>
> Can I directly use the UML2 metamodel(.ecore) or I need to extend it
> with MARTE profile first.
>
> Please can you let me know if the source model file has to be in .ecore
> for the transformation to be successful.
>
>
> Thanks
>
Hello,
You should better ask in M2M newsgroup :-)
Anyway; if you are using ATL you have to use the UML2 metamodel in ecore.
I think you must use both of them : UML.ecore and Marte Profile
The source model can be in uml.
This would be the first lines in ATL:
module MARTE2AnoterModel
create OUT : UML2 from IN: UML2, MARTEProfile:UML2;
You have to point to the UML.ecore for "UML2" while MARTEProfile will be
directed to the MARTE-Profile.
|
|
| | |
Re: Reusing package-element in UML Metamodel extension [message #627320 is a reply to message #478110] |
Wed, 07 January 2009 18:37 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Deepak,
I think you might want something like in the attachment.
Try adding the attached .ecore, reloading you .genmodel, then regenerate
all.
Let me know if that is what you were looking for.
-James.
"Deepak" <dee_n@gmx.de> wrote in message
news:gk2a1s$15v$1@build.eclipse.org...
> Hi James,
>
> Yes, I can see the corresponding EPackage but if I run the generated
> editor I can't insert any UML:Package element in my model. I just start
> with the Activity element.
>
> I attached a sample of my UML extended model and the derived Ecore file.
>
> I want to create a specific activity diagram (no value pins, no
> callbehavior action and some other unnecessary elements) which contains
> OCL constraints.
>
> The layout of my activity diagram should be:
>
> uml:package
> Activity
> CallOperationAction
> InputPin
> OutputPin
> ControlFlow
> InitialNode
> FinalNode....
>
>
> Regards,
>
> Deepak
>
>
>
>
>
>
>
>
>
>
> James Bruck schrieb:
>> Hi Deepak,
>>
>> If you can see the corresponding EPackage in the EMF model then the EMF
>> codegenerator should create a package for you.
>> What does your EMF model look like?
>>
>> Cheers,
>> - James.
>>
>>
>> "Deepak" <dee_n@gmx.de> wrote in message
>> news:gjr9lq$17g$1@build.eclipse.org...
>>> Hello,
>>>
>>> Is there any possibility to use uml:package in an extended UML-Metamodel
>>> ?
>>>
>>> What I tried so far:
>>> -Create new UML model (Model Object: Model)
>>>
>>> -I add an UML Package element to the model and then I transform this
>>> model
>>> to a metamodel (convert to->metamodel).
>>> After that I generate EMF Model and let EMF create the code for the
>>> model
>>> and editor.
>>>
>>> When I run the editor there is no UML Package available in my instance
>>> model.
>>>
>>>
>>> Regards,
>>>
>>> Deepak
>>>
>>>
>>>
>>
>>
>
>
------------------------------------------------------------ --------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:Standard="http://www.eclipse.org/uml2/schemas/Standard/1"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
> xsi:schemaLocation="http://www.eclipse.org/uml2/schemas/Standard/1
> pathmap://UML_PROFILES/Standard.profile.uml#_yzU58YinEdqtvbn fB2L_5w">
> <uml:Model xmi:id="_0" name="TestMeta">
> <packagedElement xmi:type="uml:Package" xmi:id="ActvityWithOCL"
> name="ActvityWithOCL">
> <packagedElement xmi:type="uml:Activity"
> xmi:id="ActvityWithOCL-ExtActivity" name="ExtActivity"
> precondition="ActvityWithOCL-ExtActivity-OCL">
> <ownedRule xmi:id="ActvityWithOCL-ExtActivity-OCL" name="OCL">
> <specification xmi:type="uml:OpaqueExpression"
> xmi:id="ActvityWithOCL-ExtActivity-OCL-containsInputPin"
> name="containsInputPin">
> <language>OCL</language>
> </specification>
> </ownedRule>
> <generalization
> xmi:id="ActvityWithOCL-ExtActivity-_generalization.0">
> <general xmi:type="uml:Class"
> href="pathmap://UML_METAMODELS/UML.metamodel.uml#Activity"/>
> </generalization>
> <node xmi:type="uml:CallBehaviorAction"
> xmi:id="ActvityWithOCL-ExtActivity-testGet" name="testGet"/>
> </packagedElement>
> </packagedElement>
> <profileApplication xmi:id="_profileApplication.0">
> <eAnnotations
> xmi:id=" _profileApplication.0-_http2F2Fwww.eclipse.org2Fuml22F2.0.02 FUML "
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href=" pathmap://UML_PROFILES/Standard.profile.uml#_yzU58YinEdqtvbn fB2L_5w"/>
> </eAnnotations>
> <appliedProfile
> href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
> </profileApplication>
> </uml:Model>
> <Standard:Metamodel xmi:id="_mORn4L--Ed2_NN0Jjs2C1w" base_Model="_0"/>
> <Standard:Metaclass xmi:id="_mOax0L--Ed2_NN0Jjs2C1w"
> base_Class="ActvityWithOCL-ExtActivity"/>
> </xmi:XMI>
>
------------------------------------------------------------ --------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="testMeta"
> nsURI="http:///testMeta.ecore" nsPrefix="testMeta">
> <eSubpackages name="actvityWithOcl"
> nsURI="http:///testMeta/actvityWithOcl.ecore"
> nsPrefix="testMeta.actvityWithOcl">
> <eClassifiers xsi:type="ecore:EClass" name="ExtActivity"
> eSuperTypes=" platform:/plugin/org.eclipse.uml2.uml/model/UML.ecore#//Acti vity ">
> <eOperations name="ocl" eType="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
> <eParameters name="diagnostics" eType="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EDiagnosticChain">
> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
> <details key="documentation" value="The chain of diagnostics to
> which problems are to be appended."/>
> </eAnnotations>
> </eParameters>
> <eParameters name="context">
> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
> <details key="documentation" value="The cache of
> context-specific information."/>
> </eAnnotations>
> <eGenericType eClassifier="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EMap">
> <eTypeArguments eClassifier="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/>
> <eTypeArguments eClassifier="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"/>
> </eGenericType>
> </eParameters>
> </eOperations>
> </eClassifiers>
> </eSubpackages>
> </ecore:EPackage>
>
|
|
|
Re: Reusing package-element in UML Metamodel extension [message #627321 is a reply to message #478113] |
Thu, 08 January 2009 08:54 |
Eclipse User |
|
|
|
Thanks James !!
That's exactly what I want.
I thought it could be done in with the UML editor itself.
Regards,
Deepak
James Bruck schrieb:
> Hi Deepak,
>
> I think you might want something like in the attachment.
> Try adding the attached .ecore, reloading you .genmodel, then regenerate
> all.
> Let me know if that is what you were looking for.
>
> -James.
>
> "Deepak" <dee_n@gmx.de> wrote in message
> news:gk2a1s$15v$1@build.eclipse.org...
>> Hi James,
>>
>> Yes, I can see the corresponding EPackage but if I run the generated
>> editor I can't insert any UML:Package element in my model. I just start
>> with the Activity element.
>>
>> I attached a sample of my UML extended model and the derived Ecore file.
>>
>> I want to create a specific activity diagram (no value pins, no
>> callbehavior action and some other unnecessary elements) which contains
>> OCL constraints.
>>
>> The layout of my activity diagram should be:
>>
>> uml:package
>> Activity
>> CallOperationAction
>> InputPin
>> OutputPin
>> ControlFlow
>> InitialNode
>> FinalNode....
>>
>>
>> Regards,
>>
>> Deepak
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> James Bruck schrieb:
>>> Hi Deepak,
>>>
>>> If you can see the corresponding EPackage in the EMF model then the EMF
>>> codegenerator should create a package for you.
>>> What does your EMF model look like?
>>>
>>> Cheers,
>>> - James.
>>>
>>>
>>> "Deepak" <dee_n@gmx.de> wrote in message
>>> news:gjr9lq$17g$1@build.eclipse.org...
>>>> Hello,
>>>>
>>>> Is there any possibility to use uml:package in an extended UML-Metamodel
>>>> ?
>>>>
>>>> What I tried so far:
>>>> -Create new UML model (Model Object: Model)
>>>>
>>>> -I add an UML Package element to the model and then I transform this
>>>> model
>>>> to a metamodel (convert to->metamodel).
>>>> After that I generate EMF Model and let EMF create the code for the
>>>> model
>>>> and editor.
>>>>
>>>> When I run the editor there is no UML Package available in my instance
>>>> model.
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Deepak
>>>>
>>>>
>>>>
|
|
|
Re: Reusing package-element in UML Metamodel extension [message #627322 is a reply to message #478114] |
Thu, 08 January 2009 16:00 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Deepak,
Yes you could do this with UML itself - you can do all your metamodeling
using UML only. Simply create a meta-type called MyPackage that
specializes the Package meta-type from UML. Behind the scenes, the .uml
model gets converted to a .ecore model. EMF codegeneration works with the
..ecore representation. The .ecore representation should look like the
previously attached file - I cut some corners by just jumping to the .ecore
representation.
What you are doing in your example is "meta-modeling" not "modeling". That
is, you are trying to create specializtions of UML meta-types etc. as
opposed to creating a model using *instances* of UML types. It looks like
you created a "Package" which is an instance of the uml:Package metatype
(modeling); what you want to do is create a new meta-type called "MyPackge"
which extends uml:Package (meta-modeling). The "MyPackage" would be
represented with an instance of a MOF meta-type.
Hopefully I didn't overly complicate this ;)
Cheers,
- James.
"Deepak" <dee_n@gmx.de> wrote in message
news:gk4eve$igu$1@build.eclipse.org...
> Thanks James !!
>
> That's exactly what I want.
>
> I thought it could be done in with the UML editor itself.
>
> Regards,
>
> Deepak
>
>
>
> James Bruck schrieb:
>> Hi Deepak,
>>
>> I think you might want something like in the attachment.
>> Try adding the attached .ecore, reloading you .genmodel, then regenerate
>> all.
>> Let me know if that is what you were looking for.
>>
>> -James.
>>
>> "Deepak" <dee_n@gmx.de> wrote in message
>> news:gk2a1s$15v$1@build.eclipse.org...
>>> Hi James,
>>>
>>> Yes, I can see the corresponding EPackage but if I run the generated
>>> editor I can't insert any UML:Package element in my model. I just start
>>> with the Activity element.
>>>
>>> I attached a sample of my UML extended model and the derived Ecore file.
>>>
>>> I want to create a specific activity diagram (no value pins, no
>>> callbehavior action and some other unnecessary elements) which contains
>>> OCL constraints.
>>>
>>> The layout of my activity diagram should be:
>>>
>>> uml:package
>>> Activity
>>> CallOperationAction
>>> InputPin
>>> OutputPin
>>> ControlFlow
>>> InitialNode
>>> FinalNode....
>>>
>>>
>>> Regards,
>>>
>>> Deepak
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> James Bruck schrieb:
>>>> Hi Deepak,
>>>>
>>>> If you can see the corresponding EPackage in the EMF model then the EMF
>>>> codegenerator should create a package for you.
>>>> What does your EMF model look like?
>>>>
>>>> Cheers,
>>>> - James.
>>>>
>>>>
>>>> "Deepak" <dee_n@gmx.de> wrote in message
>>>> news:gjr9lq$17g$1@build.eclipse.org...
>>>>> Hello,
>>>>>
>>>>> Is there any possibility to use uml:package in an extended
>>>>> UML-Metamodel ?
>>>>>
>>>>> What I tried so far:
>>>>> -Create new UML model (Model Object: Model)
>>>>>
>>>>> -I add an UML Package element to the model and then I transform this
>>>>> model
>>>>> to a metamodel (convert to->metamodel).
>>>>> After that I generate EMF Model and let EMF create the code for the
>>>>> model
>>>>> and editor.
>>>>>
>>>>> When I run the editor there is no UML Package available in my instance
>>>>> model.
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>> Deepak
>>>>>
>>>>>
>>>>>
|
|
|
Re: Reusing package-element in UML Metamodel extension [message #627326 is a reply to message #478115] |
Fri, 09 January 2009 09:18 |
Eclipse User |
|
|
|
Hi James,
Thank you very much for your explanation. I should always keep in mind
the difference between metamodeling and modeling.
This confused me:
The element uml:model will be converted to <<metamodel>> when choosing
"convert to"-->"Metamodel.
So I somehow thought uml:package will also be automatically converted to
<<metapackage>>
Regards,
Deepak
James Bruck schrieb:
> Hi Deepak,
>
> Yes you could do this with UML itself - you can do all your metamodeling
> using UML only. Simply create a meta-type called MyPackage that
> specializes the Package meta-type from UML. Behind the scenes, the .uml
> model gets converted to a .ecore model. EMF codegeneration works with the
> .ecore representation. The .ecore representation should look like the
> previously attached file - I cut some corners by just jumping to the .ecore
> representation.
>
> What you are doing in your example is "meta-modeling" not "modeling". That
> is, you are trying to create specializtions of UML meta-types etc. as
> opposed to creating a model using *instances* of UML types. It looks like
> you created a "Package" which is an instance of the uml:Package metatype
> (modeling); what you want to do is create a new meta-type called "MyPackge"
> which extends uml:Package (meta-modeling). The "MyPackage" would be
> represented with an instance of a MOF meta-type.
>
> Hopefully I didn't overly complicate this ;)
>
> Cheers,
> - James.
>
>
> "Deepak" <dee_n@gmx.de> wrote in message
> news:gk4eve$igu$1@build.eclipse.org...
>> Thanks James !!
>>
>> That's exactly what I want.
>>
>> I thought it could be done in with the UML editor itself.
>>
>> Regards,
>>
>> Deepak
>>
>>
>>
>> James Bruck schrieb:
>>> Hi Deepak,
>>>
>>> I think you might want something like in the attachment.
>>> Try adding the attached .ecore, reloading you .genmodel, then regenerate
>>> all.
>>> Let me know if that is what you were looking for.
>>>
>>> -James.
>>>
>>> "Deepak" <dee_n@gmx.de> wrote in message
>>> news:gk2a1s$15v$1@build.eclipse.org...
>>>> Hi James,
>>>>
>>>> Yes, I can see the corresponding EPackage but if I run the generated
>>>> editor I can't insert any UML:Package element in my model. I just start
>>>> with the Activity element.
>>>>
>>>> I attached a sample of my UML extended model and the derived Ecore file.
>>>>
>>>> I want to create a specific activity diagram (no value pins, no
>>>> callbehavior action and some other unnecessary elements) which contains
>>>> OCL constraints.
>>>>
>>>> The layout of my activity diagram should be:
>>>>
>>>> uml:package
>>>> Activity
>>>> CallOperationAction
>>>> InputPin
>>>> OutputPin
>>>> ControlFlow
>>>> InitialNode
>>>> FinalNode....
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Deepak
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> James Bruck schrieb:
>>>>> Hi Deepak,
>>>>>
>>>>> If you can see the corresponding EPackage in the EMF model then the EMF
>>>>> codegenerator should create a package for you.
>>>>> What does your EMF model look like?
>>>>>
>>>>> Cheers,
>>>>> - James.
>>>>>
>>>>>
>>>>> "Deepak" <dee_n@gmx.de> wrote in message
>>>>> news:gjr9lq$17g$1@build.eclipse.org...
>>>>>> Hello,
>>>>>>
>>>>>> Is there any possibility to use uml:package in an extended
>>>>>> UML-Metamodel ?
>>>>>>
>>>>>> What I tried so far:
>>>>>> -Create new UML model (Model Object: Model)
>>>>>>
>>>>>> -I add an UML Package element to the model and then I transform this
>>>>>> model
>>>>>> to a metamodel (convert to->metamodel).
>>>>>> After that I generate EMF Model and let EMF create the code for the
>>>>>> model
>>>>>> and editor.
>>>>>>
>>>>>> When I run the editor there is no UML Package available in my instance
>>>>>> model.
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Deepak
>>>>>>
>>>>>>
>>>>>>
>
>
|
|
| |
Re: UML2 Metamodel extension [message #627367 is a reply to message #478154] |
Thu, 05 February 2009 17:19 |
Eclipse User |
|
|
|
Rodrigues schrieb:
> Hi Deepak,
>
> I am trying to transform a annotated(with MARTE)deployment diagram
> (source model in .di2 extension)into another model.
>
> Can I directly use the UML2 metamodel(.ecore) or I need to extend it
> with MARTE profile first.
>
> Please can you let me know if the source model file has to be in .ecore
> for the transformation to be successful.
>
>
> Thanks
>
Hello,
You should better ask in M2M newsgroup :-)
Anyway; if you are using ATL you have to use the UML2 metamodel in ecore.
I think you must use both of them : UML.ecore and Marte Profile
The source model can be in uml.
This would be the first lines in ATL:
module MARTE2AnoterModel
create OUT : UML2 from IN: UML2, MARTEProfile:UML2;
You have to point to the UML.ecore for "UML2" while MARTEProfile will be
directed to the MARTE-Profile.
|
|
|
Goto Forum:
Current Time: Wed Apr 24 22:27:03 GMT 2024
Powered by FUDForum. Page generated in 0.05774 seconds
|