Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Is it possible to reference data in a second model file via Xpand
Is it possible to reference data in a second model file via Xpand [message #63675] Sat, 04 July 2009 00:23 Go to next message
Bill HingeFriend
Messages: 156
Registered: July 2009
Senior Member
Hi

My Xpand is working fine now, however I have a question

If my model includes ref to an external file, eg a uml model
is it possible to read the data being pointed to in that file?
For example my DSL uses load resource to put the names of user
selected classes into a List attribute of type uml::Class


My test data file looks like this

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:contract="http://www.xx.com/2008/contract"
xmlns:informationModel="http://www.xx.com/2008/informationModel"
xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation"
xmlns:sla="http://www.xx.com/2008/sla"
xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML">
<contract:BusinessService xmi:id="_1LVM0WSgEd6Gb-e14Ojxqw"
description="IWasEar">
<specifiesContracts xmi:type="contract:Contract"
xmi:id="_4A2ocGSgEd6Gb-e14Ojxqw" Title="DemoContract">
<contractSLA xmi:type="sla:ContractSLA"
xmi:id="_4o-_cGSgEd6Gb-e14Ojxqw" value="90ms" actual="100ms"/>
<contractSLA xmi:type="sla:ContractSLA"
xmi:id="_i8_yEGfrEd6pOPMgnFheNQ" metric="TIMETOABANDON" value="900ms"
actual="800ms"/>
<tasks xmi:type="contract:Task" xmi:id="_iKzyEWfpEd6pOPMgnFheNQ"
taskBindingClasses="_Xug7EGglEd6pOPMgnFheNQ">
<slaFeatures xmi:type="sla:TaskSLA"
xmi:id="_jQExAGfpEd6pOPMgnFheNQ" metric="TIMETOMODIFYSLA" value="10ms"
actual=""/>
<operations xmi:type="uml:Operation"
xmi:id="_pAkI8GfpEd6pOPMgnFheNQ" name="exampleGetOperation"/>
</tasks>
</specifiesContracts>
<facets xmi:type="informationModel:Facet"
xmi:id="_Xug7EGglEd6pOPMgnFheNQ" FacetId="testFacet12345">
<subjectClass xmi:type="uml:Class"
href=" file:/Users/steveorobec/Desktop/UML_export/TMF608.uml#_H3Nxc y7LEd6puPIlLRacBA "/>
<associatedClasses xmi:type="uml:Class"
href=" file:/Users/steveorobec/Desktop/UML_export/TMF608.uml#_H3Xdm C7LEd6puPIlLRacBA "/>
<associatedClasses xmi:type="uml:Class"
href=" file:/Users/steveorobec/Desktop/UML_export/TMF608.uml#_H39Vu S7LEd6puPIlLRacBA "/>
<associatedClasses xmi:type="uml:Class"
href=" file:/Users/steveorobec/Desktop/UML_export/TMF608.uml#_H3qeG i7LEd6puPIlLRacBA "/>
<associatedClasses xmi:type="uml:Class"
href=" file:/Users/steveorobec/Desktop/UML_export/TMF608.uml#_H3zjw i7LEd6puPIlLRacBA "/>
</facets>
</contract:BusinessService>
<notation:Diagram xmi:id="_1LioMGSgEd6Gb-e14Ojxqw" type="Ngoss"
element="_1LVM0WSgEd6Gb-e14Ojxqw" name="default2.ngoss"
measurementUnit="Pixel">
<styles xmi:type="notation:DiagramStyle"
xmi:id="_1LioMWSgEd6Gb-e14Ojxqw"/>
</notation:Diagram>
</xmi:XMI>



regards
Steve
Re: Is it possible to reference data in a second model file via Xpand [message #63698 is a reply to message #63675] Sat, 04 July 2009 11:46 Go to previous message
Bill HingeFriend
Messages: 156
Registered: July 2009
Senior Member
OK answered my own question, yes it is possible
possibly had a bit of a problem with my logic last night.
There are some neat functions in uml model, works well, better than
I had hoped

However process time gone from a few ms to 24 sec on a fast
computer (large uml model)

regards
Steve


Bill Hinge wrote:
> Hi
>
> My Xpand is working fine now, however I have a question
>
> If my model includes ref to an external file, eg a uml model
> is it possible to read the data being pointed to in that file?
> For example my DSL uses load resource to put the names of user
> selected classes into a List attribute of type uml::Class
>
>
> My test data file looks like this
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:contract="http://www.xx.com/2008/contract"
> xmlns:informationModel="http://www.xx.com/2008/informationModel"
> xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation"
> xmlns:sla="http://www.xx.com/2008/sla"
> xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML">
> <contract:BusinessService xmi:id="_1LVM0WSgEd6Gb-e14Ojxqw"
> description="IWasEar">
> <specifiesContracts xmi:type="contract:Contract"
> xmi:id="_4A2ocGSgEd6Gb-e14Ojxqw" Title="DemoContract">
> <contractSLA xmi:type="sla:ContractSLA"
> xmi:id="_4o-_cGSgEd6Gb-e14Ojxqw" value="90ms" actual="100ms"/>
> <contractSLA xmi:type="sla:ContractSLA"
> xmi:id="_i8_yEGfrEd6pOPMgnFheNQ" metric="TIMETOABANDON" value="900ms"
> actual="800ms"/>
> <tasks xmi:type="contract:Task" xmi:id="_iKzyEWfpEd6pOPMgnFheNQ"
> taskBindingClasses="_Xug7EGglEd6pOPMgnFheNQ">
> <slaFeatures xmi:type="sla:TaskSLA"
> xmi:id="_jQExAGfpEd6pOPMgnFheNQ" metric="TIMETOMODIFYSLA" value="10ms"
> actual=""/>
> <operations xmi:type="uml:Operation"
> xmi:id="_pAkI8GfpEd6pOPMgnFheNQ" name="exampleGetOperation"/>
> </tasks>
> </specifiesContracts>
> <facets xmi:type="informationModel:Facet"
> xmi:id="_Xug7EGglEd6pOPMgnFheNQ" FacetId="testFacet12345">
> <subjectClass xmi:type="uml:Class"
> href=" file:/Users/steveorobec/Desktop/UML_export/TMF608.uml#_H3Nxc y7LEd6puPIlLRacBA "/>
>
> <associatedClasses xmi:type="uml:Class"
> href=" file:/Users/steveorobec/Desktop/UML_export/TMF608.uml#_H3Xdm C7LEd6puPIlLRacBA "/>
>
> <associatedClasses xmi:type="uml:Class"
> href=" file:/Users/steveorobec/Desktop/UML_export/TMF608.uml#_H39Vu S7LEd6puPIlLRacBA "/>
>
> <associatedClasses xmi:type="uml:Class"
> href=" file:/Users/steveorobec/Desktop/UML_export/TMF608.uml#_H3qeG i7LEd6puPIlLRacBA "/>
>
> <associatedClasses xmi:type="uml:Class"
> href=" file:/Users/steveorobec/Desktop/UML_export/TMF608.uml#_H3zjw i7LEd6puPIlLRacBA "/>
>
> </facets>
> </contract:BusinessService>
> <notation:Diagram xmi:id="_1LioMGSgEd6Gb-e14Ojxqw" type="Ngoss"
> element="_1LVM0WSgEd6Gb-e14Ojxqw" name="default2.ngoss"
> measurementUnit="Pixel">
> <styles xmi:type="notation:DiagramStyle"
> xmi:id="_1LioMWSgEd6Gb-e14Ojxqw"/>
> </notation:Diagram>
> </xmi:XMI>
>
>
>
> regards
> Steve
Previous Topic:Xpand quits with no exception text
Next Topic:com.sun.java.xml.ns.persistence.orm.OrmPackage
Goto Forum:
  


Current Time: Fri Apr 26 15:13:26 GMT 2024

Powered by FUDForum. Page generated in 0.04058 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top