Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MDT (Model Development Tools) » [Xpand] Incremental generation does not work as expected
[Xpand] Incremental generation does not work as expected [message #636918] Wed, 03 November 2010 11:23 Go to next message
Roman Zimmer is currently offline Roman ZimmerFriend
Messages: 27
Registered: November 2010
Junior Member
Hi @ll,

I was trying to get my hand dirty on the incremental generation feature of Xpand. But I'm stuck now.

After discovering and locally fixing a NPE on the second generation run (see bugzilla entry), I found out that not all changes in a model will lead to a regeneration of the corresponding files.

I have this workflow file adopted from the docs:

	<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
	  <platformUri value=".."/>
	  <registerEcoreFile value="platform:/resource/XXXremovedXXX/src/main/resources/metamodel/Diagram.ecore"/>

  <component id="incremental"
    <newModelFile value="src/main/resources/examples/BPM.xmi" />
    <oldModelFile value="incremental/BPM-backup.xmi" />
    <traceModelFile value="incremental/BPM-trace.xmi" /> 
    <outlet path="src/generated/java" overwrite="true"/>

  <component id="generator" class="org.eclipse.xpand2.Generator">
    <expand value="templates::Root::main FOR model" />
    <outlet path="src/generated/java" overwrite="true" />
    <metaModel class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel" />
    <vetoableCallback idRef="incremental" />

Given e.g. this model in XMI:

<?xml version="1.0" encoding="ASCII"?>
<diagram:Diagram xmi:version="2.0" xmlns:xmi="" xmlns:xsi="" xmlns:diagram="http://XXXremovedXXX" xsi:schemaLocation="http://XXXremovedXXX ../metamodel/Diagram.ecore" name="ProcessDiagramm" width="500" height="500">
  <nodes name="StartNode" height="20" width="50">
    <properties name="name"/>
    <properties name="date"/>
  <nodes name="EndNode" height="30" width="30">
    <properties name="description"/>
    <properties name="date"/>
  <connections source="//@nodes.0" target="//@nodes.1" name="Process"/>

For every nodes there is one Java class generated and one file that contains informations of all nodes elements.

If I add <properties name="number" type="Integer" /> to a nodes element, incremental generation will internally discover a change, but does not regenerate the corresponding Java class file as it seems not to determine it correctly.

If I add a new <nodes>...</nodes element, it will generate a corresponding Java class as it should but will not update the file which contains the informations of all the nodes elements.

What is my mistake?

What are your experiences with the incremental generation feature?

Where could I get help? Are there any examples working as expectly?

Don't hesitate to ask if you need further information. Thanks a lot for your feedback! I'd really like to use this nice feature!
Re: [Xpand] Incremental generation does not work as expected [message #639663 is a reply to message #636918] Wed, 17 November 2010 11:27 Go to previous message
Roman Zimmer is currently offline Roman ZimmerFriend
Messages: 27
Registered: November 2010
Junior Member
I accidently posted in the wrong forum.

Another user had the same problem over in the M2T forum.

Sorry about the confusion.
Previous Topic:[EMF: Answered] How can I create references instead of copies of existing model objects?
Next Topic:Problems during loading my own Profile in standalone mode
Goto Forum:

Current Time: Sun Jul 21 10:46:42 GMT 2024

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

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

Back to the top