Print Page | Close Window

Import meta-model

Printed From: MetaCase
Category:
Forum Name: MetaEdit+
Forum Description: All topics relating to MetaEdit+ or DSM
URL: https://www.metacase.com/forums/forum_posts.asp?TID=907
Printed Date: 27.Mar.2026 at 03:35
Software Version: Web Wiz Forums 12.05 - http://www.webwizforums.com


Topic: Import meta-model
Posted By: djuka
Subject: Import meta-model
Date 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" rel="nofollow - 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



Replies:
Posted By: stevek
Date 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" rel="nofollow - 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


Posted By: djuka
Date 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" rel="nofollow - 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.05 - http://www.webwizforums.com
Copyright ©2001-2022 Web Wiz Ltd. - https://www.webwiz.net