MetaCase Homepage
Forum Home Forum Home > > MetaEdit+
  New Posts New Posts RSS Feed - Import meta-model
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Import meta-model

 Post Reply Post Reply
Author
Message
djuka View Drop Down
Major Contributor
Major Contributor
Avatar

Joined: 22.Jun.2011
Location: Germany
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote djuka Quote  Post ReplyReply Direct Link To This Post Topic: Import meta-model
    Posted: 15.Apr.2019 at 16:50
Hi !

I have meta-model created by another tool and want to import
it in ME+, along with representations of language concepts,
mainly images. Here is one file that contains only model properites,
not definition for orher DSL elements. 

http://www.metacase.com/forums/uploads/173/ForImportToMe.mxt

What is wrong in this mxt file? Some parts related to property
domains are for sure errors, but importer reports error in line 3.
Suppose we have empry repository. What is the content after
importing of this definition?

Thanks,
Djukic
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 641
Answer Answer
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post Posted: 15.Apr.2019 at 18:05
Hi!
The namespace for MXT is http://www.metacase.com/gxlGOPRRType :)

<widget> must contain a legal widget type (or can be omitted). In your file it's either empty (which isn't a legal value - just omit it instead) or something like:

<widget>Code report name</widget>

Maybe you want <description> instead of <widget>?

That gets us quite far. Next is:
<property typeName="Action_Report_Name">
<dataType>
<complexType>me_Enum</complexType>
</dataType>
<defaultValue>
<me_Enum>PrepareAllModelExec</me_Enum>
</defaultValue>
<listValues>
<string>PrepareAllModelExec=0</string>
<string>PrepareSingleModelExec</string>
</listValues>

It looks like you're trying to invent your own syntax for MXT files ("<me_Enum>"). That's not how XML works - you have to follow the format used by the tool, see https://www.metacase.com/support/55/manuals/mwb/Mw-8_4_2.html

For that case, I'd imagine <simpleType>String and <widget>Fixed List would be appropriate. (An easy way to see the correct syntax is to make an example type in MetaEdit+ and export it (e.g. just a Graph type 'Test' with one FixedList property like this)). Correct your MXT to <defaultValue><string> and drop the "=0" from the end of the first listValue - the default value must be one of the listValues.

Also, I think you might want me_Enum to be the name of the property type, and Action_Report_Name to be the name of the slot. 

<slot name="Action_Report_Name">
<property typeName="me_Enum">
<dataType>
<simpleType>String</simpleType>
</dataType>
<defaultValue>
<string>PrepareAllModelExec</string>
</defaultValue>
<widget>Fixed List</widget>
<listValues>
<string>PrepareAllModelExec</string>
<string>PrepareSingleModelExec</string>
</listValues>
</property>
</slot>

I'm not sure what you want with Sirina and Visina - maybe <simpleType>Number? Or maybe (looking at the last case in TarAppRect) you want to define a property holding an Object with two Number slots, Width and Height. That would appear inline the first time with <property id="me_Size" typeName="meSize">, and later occurrences can be referred to with just <property href="#me_Size" /> (note the tag is closed straight away with no other content, and the # is used to refer to a corresponding id in this file).

ModelImage sounds like <simpleType>String with <widget>External Element.

The remaining cases in the file seem to follow one of the above patterns. 

Hope this helps!
Steve


Edited by stevek - 15.Apr.2019 at 18:07
Back to Top
djuka View Drop Down
Major Contributor
Major Contributor
Avatar

Joined: 22.Jun.2011
Location: Germany
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote djuka Quote  Post ReplyReply Direct Link To This Post Posted: 16.Apr.2019 at 07:54
Thank You Steve!

I got it imported after minor updates. The main problem was that I had
wrong namespace, like You noted (gxlGOPRR instead of gxlGOPRRType).

Here is the new metamodel file used for import:

http://www.metacase.com/forums/uploads/173/ForImportToMe_2.mxt

There are some things to do with Color, Font, Sound and other complex
domain types.

Djukic
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.05
Copyright ©2001-2022 Web Wiz Ltd.

This page was generated in 0.078 seconds.