Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Exporting ECL Traces in Ant Tasks
Exporting ECL Traces in Ant Tasks [message #1841044] Sat, 01 May 2021 16:26 Go to next message
Patrick Stünkel is currently offline Patrick StünkelFriend
Messages: 3
Registered: September 2019
Junior Member
Hi everyone,

I am currently trying to export th match-trace from running an ECL script into a file using the ANT workflow language.
However, I do not understand how to configure the export.
The <epsilon.ecl> task has an attribute "exportMatchTrace" of type String. But it is unclear what value to put in this field. I tried several things:

- true
- Filename
- Model name, which should be stored with a respective <epsilon.storeModel>

However, nothing works. And the documentation (https://www.eclipse.org/epsilon/doc/workflow/#model-comparison-task) is quite unclear on this matter.

The following example snippet

 <target name="runEpsilon" depends="setup-epsilon">
        <epsilon.emf.loadModel name="Fam" modelfile="data/Families.families" metamodelfile="metamodels/Families.ecore"/>
        <epsilon.emf.loadModel name="Pers" modelfile="data/Persons.persons" metamodelfile="metamodels/Persons.ecore"/>

        <epsilon.ecl src="MatchFamiliesPersons.ecl" exportMatchTrace="Traces" >
            <model ref="Fam"/>
            <model ref="Pers"/>
        </epsilon.ecl>

        <epsilon.storeModel model="Traces" target="traces.xmi" />

    </target>


fails with
/Users/...../build.xml:93: Model 'Traces' not found
	at org.eclipse.epsilon.eol.models.ModelGroup.<init>(ModelGroup.java:43)
	at org.eclipse.epsilon.eol.models.ModelRepository.getModelByName(ModelRepository.java:94)
	at org.eclipse.epsilon.workflow.tasks.StoreModelTask.executeImpl(StoreModelTask.java:32)
	at org.eclipse.epsilon.workflow.tasks.EpsilonTask.execute(EpsilonTask.java:42)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
	at jdk.internal.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:352)
	at org.apache.tools.ant.Target.execute(Target.java:437)
	at org.apache.tools.ant.Target.performTasks(Target.java:458)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1406)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1377)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1261)
	at org.apache.tools.ant.Main.runBuild(Main.java:857)
	at org.apache.tools.ant.Main.startAnt(Main.java:236)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:287)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)


Furthermore, I found an inconsistency in your documentation: Here it says that <epsilon.storeModel> has "name" attribute, which does not work
And, apparently, someone in 2010 had the same issue...
By looking into the source I found out that the respective attribute is named "model". Maybe, you should consider updating the documentation or the name of the attribute.

Re: Exporting ECL Traces in Ant Tasks [message #1841055 is a reply to message #1841044] Sun, 02 May 2021 11:12 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Patrick,

exportMatchTrace exports the match trace computed by ECL as a named variable that can be reused by other tasks (more commonly EML, which needs a match trace to merge model elements). I have clarified this in [1] now. I've also fixed the issue your spotted in the documentation of the storeModel task [2].

Best,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/workflow/#model-comparison-task
[2] https://www.eclipse.org/epsilon/doc/workflow/#model-storing-task
Re: Exporting ECL Traces in Ant Tasks [message #1841081 is a reply to message #1841055] Mon, 03 May 2021 11:24 Go to previous messageGo to next message
Patrick Stünkel is currently offline Patrick StünkelFriend
Messages: 3
Registered: September 2019
Junior Member
Hi Dimitris,

Awesome! Indeed combining "exportMatchTrace=x" in the ECL task and "useMatchTrace=x" in the EML tasks works!
Thank you very much for the quick response! =)

Now, another thing I have become curious about:
According to https://www.eclipse.org/epsilon/doc/workflow/#model-validation-task the EVL task has an attribute "exportAsModel", which when set to true adds a new model called "EVL" to the project repository, which contains all violations. How, can I access this model.

I tried to store it with "epsilon.storeModel" but that tasks then fails because the model 'EVL' cannot be found
/.../build.xml:103: Model 'EVL' not found
	at org.eclipse.epsilon.eol.models.ModelGroup.<init>(ModelGroup.java:43)
	at org.eclipse.epsilon.eol.models.ModelRepository.getModelByName(ModelRepository.java:94)
	at org.eclipse.epsilon.workflow.tasks.StoreModelTask.executeImpl(StoreModelTask.java:32)
	at org.eclipse.epsilon.workflow.tasks.EpsilonTask.execute(EpsilonTask.java:42)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
	at jdk.internal.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:352)
	at org.apache.tools.ant.Target.execute(Target.java:437)
	at org.apache.tools.ant.Target.performTasks(Target.java:458)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1406)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1377)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1261)
	at org.apache.tools.ant.Main.runBuild(Main.java:857)
	at org.apache.tools.ant.Main.startAnt(Main.java:236)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:287)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)


The whole Ant target below:
 <target name="runEpsilon" depends="setup-epsilon" >
        
        <epsilon.emf.loadModel name="Fam" modelfile="Families.families" metamodelfile="Families.ecore"/>
        <epsilon.emf.loadModel name="Pers" modelfile="Persons.persons" metamodelfile="Persons.ecore"/>
        <epsilon.emf.loadModel name="Merge" modelfile="emptyMerge.xmi" metamodelfile="FamiliesPersonsMerged.ecore"/>

        <epsilon.ecl src="MatchFamiliesPersons.ecl" exportMatchTrace="traces" >
            <model ref="Fam"/>
            <model ref="Pers"/>
        </epsilon.ecl>

        <epsilon.eml src="MergeFamiliesPersons.eml" useMatchTrace="traces"  >
            <model ref="Fam"/>
            <model ref="Pers"/>
            <model ref="Merge"/>
        </epsilon.eml>

        <epsilon.evl src="CheckMerged.evl" failOnErrors="false" exportAsModel="true" >
        	<model ref="Merge"/>
        </epsilon.evl>

        <epsilon.storeModel model="EVL" target="output/violations.xmi" />

    </target>


Re: Exporting ECL Traces in Ant Tasks [message #1841087 is a reply to message #1841081] Mon, 03 May 2021 13:08 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Patrick,

The documentation of exportAsModel was out of date I'm afraid but I've fixed it now [1]. The exported model cannot be stored as it's essentially a wrapper for the unsatisfied constraints identified by EVL.

Best,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/workflow/#model-validation-task
Previous Topic:Model to text transformations
Next Topic:Epsilon ETL - Ecore2Ecore full copy
Goto Forum:
  


Current Time: Wed Apr 24 23:05:03 GMT 2024

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

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

Back to the top