Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[henshin-dev] Problem with enums and registered packages


Dear Henshin developers,


I have some troubles regarding the _javascript_ interpreter when using Enums to match attribute values. Attached you'll find the error message [1].

The bug only appears when using the metamodel via the package registry. I have to do so, since I am not working on an xmi file but using Xtext in my usecase.

Attached, you find all necessary files in order to reconstruct the bug.

- ecore-model / genmodel (you probably need to create a new one)
- henshin-model (working - with xmi)
- henshin-model (not working - with registered package)
- Tester file to run the unit

Please note that the EnumBug.* files are actually working when used with an xmi file. (I attached those also, just to see the difference).

Steps to Reconstruct the Error

1. To actually see the error you have to register the EBug Package and its genmodel to your instance.
2. Run HenshinTester.xtend|.java

(By the way, is there any convenient way to do this in the same eclipse instance? Currently I am Exporting the project into my dropins folder, but that cannot be the ultimate solution)


Thanks for your help

Jona


[1]
Exception in thread "main" java.lang.RuntimeException: sun.org.mozilla._javascript_.internal.EcmaError: ReferenceError: "belongs_to" is not defined. (<Unknown source>#1) in <Unknown source> at line number 1
    at org.eclipse.emf.henshin.interpreter.impl.EngineImpl.evalAttributeExpression(EngineImpl.java:656)
    at org.eclipse.emf.henshin.interpreter.info.VariableInfo.createConstraints(VariableInfo.java:150)
    at org.eclipse.emf.henshin.interpreter.info.VariableInfo.createVariables(VariableInfo.java:107)
    at org.eclipse.emf.henshin.interpreter.info.VariableInfo.createVariables(VariableInfo.java:123)
    at org.eclipse.emf.henshin.interpreter.info.VariableInfo.createVariables(VariableInfo.java:120)
    at org.eclipse.emf.henshin.interpreter.info.VariableInfo.createVariables(VariableInfo.java:112)
    at org.eclipse.emf.henshin.interpreter.info.VariableInfo.<init>(VariableInfo.java:73)
    at org.eclipse.emf.henshin.interpreter.info.RuleInfo.<init>(RuleInfo.java:26)
    at org.eclipse.emf.henshin.interpreter.impl.EngineImpl.getRuleInfo(EngineImpl.java:496)
    at org.eclipse.emf.henshin.interpreter.impl.EngineImpl$MatchFinder.<init>(EngineImpl.java:193)
    at org.eclipse.emf.henshin.interpreter.impl.EngineImpl$MatchGenerator.iterator(EngineImpl.java:153)
    at org.eclipse.emf.henshin.interpreter.impl.RuleApplicationImpl.execute(RuleApplicationImpl.java:89)
    at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.executeRule(UnitApplicationImpl.java:175)
    at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.doExecute(UnitApplicationImpl.java:99)
    at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.execute(UnitApplicationImpl.java:89)
    at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.executeSequentialUnit(UnitApplicationImpl.java:222)
    at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.doExecute(UnitApplicationImpl.java:103)
    at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.execute(UnitApplicationImpl.java:89)
    at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.executeLoopUnit(UnitApplicationImpl.java:395)
    at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.doExecute(UnitApplicationImpl.java:111)
    at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.execute(UnitApplicationImpl.java:89)
    at de.unimarburg.webdsl.HenshinTester$3.apply(HenshinTester.java:139)
    at de.unimarburg.webdsl.HenshinTester$3.apply(HenshinTester.java:1)
    at org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_doubleArrow(ObjectExtensions.java:104)
    at de.unimarburg.webdsl.HenshinTester.transform(HenshinTester.java:143)
    at de.unimarburg.webdsl.HenshinTester.main(HenshinTester.java:35)



<?xml version="1.0" encoding="ASCII"?>
<enumBug:SomeSuperclass
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xmlns:enumBug="http://myenumbug.com/EnumBug";
    xsi:schemaLocation="http://myenumbug.com/EnumBug EnumBug.ecore">
  <models/>
</enumBug:SomeSuperclass>

<?xml version="1.0" encoding="UTF-8"?>
<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"; xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"; xmlns:henshin="http://www.eclipse.org/emf/2011/Henshin"; xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation"; xmi:id="_NBjyUGu8EeKeVu301dE9dA" type="Henshin" measurementUnit="Pixel">
  <children xmi:type="notation:Shape" xmi:id="_WauhIGu8EeKeVu301dE9dA" type="2001" fontName="Ubuntu" italic="true" fillColor="16114135" lineColor="0">
    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_XZUQUGu8EeKeVu301dE9dA" source="defaultAction">
      <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_XZUQUWu8EeKeVu301dE9dA" key="value" value="preserve"/>
    </eAnnotations>
    <children xmi:type="notation:DecorationNode" xmi:id="_WawWUGu8EeKeVu301dE9dA" type="5001"/>
    <children xmi:type="notation:DecorationNode" xmi:id="_WawWUWu8EeKeVu301dE9dA" type="7001">
      <children xmi:type="notation:Shape" xmi:id="_XZVecGu8EeKeVu301dE9dA" type="3001" fontName="Ubuntu">
        <children xmi:type="notation:DecorationNode" xmi:id="_XZWFgGu8EeKeVu301dE9dA" type="5002"/>
        <children xmi:type="notation:DecorationNode" xmi:id="_XZWFgWu8EeKeVu301dE9dA" type="5003"/>
        <children xmi:type="notation:DecorationNode" xmi:id="_XZWskGu8EeKeVu301dE9dA" type="7002">
          <children xmi:type="notation:Node" xmi:id="_aouLkGu8EeKeVu301dE9dA" type="3002">
            <element xmi:type="henshin:Attribute" href="EnumBug.henshin#_aooE8Gu8EeKeVu301dE9dA"/>
            <layoutConstraint xmi:type="notation:Location" xmi:id="_aouLkWu8EeKeVu301dE9dA"/>
          </children>
          <styles xmi:type="notation:SortingStyle" xmi:id="_XZWskWu8EeKeVu301dE9dA"/>
          <styles xmi:type="notation:FilteringStyle" xmi:id="_XZWskmu8EeKeVu301dE9dA"/>
        </children>
        <element xmi:type="henshin:Node" href="EnumBug.henshin#_XZP-4Gu8EeKeVu301dE9dA"/>
        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_XZVecWu8EeKeVu301dE9dA" x="27" y="31" width="134" height="90"/>
      </children>
      <children xmi:type="notation:Shape" xmi:id="_dsTRUGu8EeKeVu301dE9dA" type="3001" fontName="Ubuntu">
        <children xmi:type="notation:DecorationNode" xmi:id="_dsT4YGu8EeKeVu301dE9dA" type="5002"/>
        <children xmi:type="notation:DecorationNode" xmi:id="_dsT4YWu8EeKeVu301dE9dA" type="5003"/>
        <children xmi:type="notation:DecorationNode" xmi:id="_dsT4Ymu8EeKeVu301dE9dA" type="7002">
          <children xmi:type="notation:Node" xmi:id="_egcEAGu8EeKeVu301dE9dA" type="3002">
            <element xmi:type="henshin:Attribute" href="EnumBug.henshin#_egYZoGu8EeKeVu301dE9dA"/>
            <layoutConstraint xmi:type="notation:Location" xmi:id="_egcEAWu8EeKeVu301dE9dA"/>
          </children>
          <styles xmi:type="notation:SortingStyle" xmi:id="_dsT4Y2u8EeKeVu301dE9dA"/>
          <styles xmi:type="notation:FilteringStyle" xmi:id="_dsT4ZGu8EeKeVu301dE9dA"/>
        </children>
        <element xmi:type="henshin:Node" href="EnumBug.henshin#_dsO_4Gu8EeKeVu301dE9dA"/>
        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_dsTRUWu8EeKeVu301dE9dA" x="195" y="31" width="144" height="90"/>
      </children>
    </children>
    <element xmi:type="henshin:Rule" href="EnumBug.henshin#_WaScQGu8EeKeVu301dE9dA"/>
    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WauhIWu8EeKeVu301dE9dA" x="272" y="122" width="370" height="211"/>
  </children>
  <styles xmi:type="notation:DiagramStyle" xmi:id="_NBjyUWu8EeKeVu301dE9dA"/>
  <element xmi:type="henshin:Module" href="EnumBug.henshin#_AQEc0Gu8EeKeVu301dE9dA"/>
</notation:Diagram>

<?xml version="1.0" encoding="UTF-8"?>
<henshin:Module xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:henshin="http://www.eclipse.org/emf/2011/Henshin"; xmi:id="_AQEc0Gu8EeKeVu301dE9dA">
  <imports href="EnumBug.ecore#/"/>
  <units xsi:type="henshin:Rule" xmi:id="_WaScQGu8EeKeVu301dE9dA" name="testRule @SomeSuperclass">
    <lhs xmi:id="_WbQsoGu8EeKeVu301dE9dA" name="Lhs">
      <nodes xmi:id="_XZP-4Gu8EeKeVu301dE9dA">
        <type href="EnumBug.ecore#//SomeModel"/>
        <attributes xmi:id="_aooE8Gu8EeKeVu301dE9dA" value="foo">
          <type href="EnumBug.ecore#//SomeModel/enumAttr"/>
        </attributes>
      </nodes>
    </lhs>
    <rhs xmi:id="_WbQsoWu8EeKeVu301dE9dA" name="Rhs">
      <nodes xmi:id="_XZQl8Gu8EeKeVu301dE9dA">
        <type href="EnumBug.ecore#//SomeModel"/>
        <attributes xmi:id="_aopTEGu8EeKeVu301dE9dA" value="foo">
          <type href="EnumBug.ecore#//SomeModel/enumAttr"/>
        </attributes>
      </nodes>
      <nodes xmi:id="_dsO_4Gu8EeKeVu301dE9dA">
        <type href="EnumBug.ecore#//SomeModel"/>
        <attributes xmi:id="_egYZoGu8EeKeVu301dE9dA" value="foo">
          <type href="EnumBug.ecore#//SomeModel/enumAttr"/>
        </attributes>
      </nodes>
    </rhs>
    <mappings xmi:id="_XZTCMGu8EeKeVu301dE9dA" origin="_XZP-4Gu8EeKeVu301dE9dA" image="_XZQl8Gu8EeKeVu301dE9dA"/>
  </units>
</henshin:Module>

<?xml version="1.0" encoding="UTF-8"?>
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"; xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore";
    xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel"; modelDirectory="/EnumBug/src" modelPluginID="EnumBug" modelName="EnumBug"
    importerID="org.eclipse.emf.importer.ecore" complianceLevel="7.0" copyrightFields="false">
  <foreignModel>EnumBug.ecore</foreignModel>
  <genPackages prefix="EnumBug" disposableProviderFactory="true" ecorePackage="EnumBug.ecore#/">
    <genEnums typeSafeEnumCompatible="false" ecoreEnum="EnumBug.ecore#//SomeEnum">
      <genEnumLiterals ecoreEnumLiteral="EnumBug.ecore#//SomeEnum/foo"/>
    </genEnums>
    <genClasses ecoreClass="EnumBug.ecore#//SomeSuperclass">
      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference EnumBug.ecore#//SomeSuperclass/models"/>
    </genClasses>
    <genClasses ecoreClass="EnumBug.ecore#//SomeModel">
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute EnumBug.ecore#//SomeModel/enumAttr"/>
    </genClasses>
  </genPackages>
</genmodel:GenModel>

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"; name="EnumBug" nsURI="http://myenumbug.com/EnumBug"; nsPrefix="enumBug">
  <eClassifiers xsi:type="ecore:EEnum" name="SomeEnum">
    <eLiterals name="foo" literal="foo"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="SomeSuperclass">
    <eStructuralFeatures xsi:type="ecore:EReference" name="models" upperBound="-1"
        eType="#//SomeModel" containment="true"/>
  </eClassifiers>
  <eClassifiers xsi:type="ecore:EClass" name="SomeModel">
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="enumAttr" eType="#//SomeEnum"/>
  </eClassifiers>
</ecore:EPackage>

<?xml version="1.0" encoding="UTF-8"?>
<henshin:Module xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:henshin="http://www.eclipse.org/emf/2011/Henshin"; xmi:id="_3l7P0Gu-EeKtEK7du4RqbQ">
  <imports href="http://myenumbug.com/EnumBug#/"/>
  <units xsi:type="henshin:Rule" xmi:id="__VsX4Gu-EeKtEK7du4RqbQ" name="testRule">
    <lhs xmi:id="__Wb-wGu-EeKtEK7du4RqbQ" name="Lhs">
      <nodes xmi:id="_EnXs4Gu_EeKtEK7du4RqbQ" name="root" outgoing="_wREssGu_EeK4z9Hok4OuiA">
        <type href="http://myenumbug.com/EnumBug#//SomeSuperclass"/>
      </nodes>
      <nodes xmi:id="_wQ-mEGu_EeK4z9Hok4OuiA" incoming="_wREssGu_EeK4z9Hok4OuiA">
        <type href="http://myenumbug.com/EnumBug#//SomeModel"/>
        <attributes xmi:id="_xsVw0Gu_EeK4z9Hok4OuiA" value="foo">
          <type href="http://myenumbug.com/EnumBug#//SomeModel/enumAttr"/>
        </attributes>
      </nodes>
      <edges xmi:id="_wREssGu_EeK4z9Hok4OuiA" source="_EnXs4Gu_EeKtEK7du4RqbQ" target="_wQ-mEGu_EeK4z9Hok4OuiA">
        <type href="http://myenumbug.com/EnumBug#//SomeSuperclass/models"/>
      </edges>
    </lhs>
    <rhs xmi:id="__Wb-wWu-EeKtEK7du4RqbQ" name="Rhs">
      <nodes xmi:id="_EnbXQGu_EeKtEK7du4RqbQ" name="root" outgoing="_wRFTwGu_EeK4z9Hok4OuiA _yUFtUGu_EeK4z9Hok4OuiA">
        <type href="http://myenumbug.com/EnumBug#//SomeSuperclass"/>
      </nodes>
      <nodes xmi:id="_wRC3gGu_EeK4z9Hok4OuiA" incoming="_wRFTwGu_EeK4z9Hok4OuiA">
        <type href="http://myenumbug.com/EnumBug#//SomeModel"/>
        <attributes xmi:id="_xsW-8Gu_EeK4z9Hok4OuiA" value="foo">
          <type href="http://myenumbug.com/EnumBug#//SomeModel/enumAttr"/>
        </attributes>
      </nodes>
      <nodes xmi:id="_yUCC8Gu_EeK4z9Hok4OuiA" incoming="_yUFtUGu_EeK4z9Hok4OuiA">
        <type href="http://myenumbug.com/EnumBug#//SomeModel"/>
        <attributes xmi:id="_yx0LIGu_EeK4z9Hok4OuiA" value="foo">
          <type href="http://myenumbug.com/EnumBug#//SomeModel/enumAttr"/>
        </attributes>
      </nodes>
      <edges xmi:id="_wRFTwGu_EeK4z9Hok4OuiA" source="_EnbXQGu_EeKtEK7du4RqbQ" target="_wRC3gGu_EeK4z9Hok4OuiA">
        <type href="http://myenumbug.com/EnumBug#//SomeSuperclass/models"/>
      </edges>
      <edges xmi:id="_yUFtUGu_EeK4z9Hok4OuiA" source="_EnbXQGu_EeKtEK7du4RqbQ" target="_yUCC8Gu_EeK4z9Hok4OuiA">
        <type href="http://myenumbug.com/EnumBug#//SomeSuperclass/models"/>
      </edges>
    </rhs>
    <mappings xmi:id="_EnbXQWu_EeKtEK7du4RqbQ" origin="_EnXs4Gu_EeKtEK7du4RqbQ" image="_EnbXQGu_EeKtEK7du4RqbQ"/>
    <mappings xmi:id="_wRC3gWu_EeK4z9Hok4OuiA" origin="_wQ-mEGu_EeK4z9Hok4OuiA" image="_wRC3gGu_EeK4z9Hok4OuiA"/>
  </units>
  <units xsi:type="henshin:SequentialUnit" xmi:id="_KmuDYGvDEeKZ8qH1Kxc-Gw" name="testUnit" subUnits="__VsX4Gu-EeKtEK7du4RqbQ"/>
</henshin:Module>

<?xml version="1.0" encoding="UTF-8"?>
<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"; xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"; xmlns:henshin="http://www.eclipse.org/emf/2011/Henshin"; xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation"; xmi:id="_70CPAGu-EeKtEK7du4RqbQ" type="Henshin" measurementUnit="Pixel">
  <children xmi:type="notation:Shape" xmi:id="__V-rwGu-EeKtEK7du4RqbQ" type="2001" fontName="Ubuntu" italic="true" fillColor="16114135" lineColor="0">
    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_EnXF0Gu_EeKtEK7du4RqbQ" source="rootObject">
      <references xmi:type="henshin:Node" href="EnumBugRegistered.henshin#_EnXs4Gu_EeKtEK7du4RqbQ"/>
    </eAnnotations>
    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_wRHI8Gu_EeK4z9Hok4OuiA" source="defaultAction">
      <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_wRHI8Wu_EeK4z9Hok4OuiA" key="value" value="create"/>
    </eAnnotations>
    <children xmi:type="notation:DecorationNode" xmi:id="__WAg8Gu-EeKtEK7du4RqbQ" type="5001"/>
    <children xmi:type="notation:DecorationNode" xmi:id="__WAg8Wu-EeKtEK7du4RqbQ" type="7001">
      <children xmi:type="notation:Shape" xmi:id="_wRgxkGu_EeK4z9Hok4OuiA" type="3001" fontName="Ubuntu">
        <children xmi:type="notation:DecorationNode" xmi:id="_wRhYoGu_EeK4z9Hok4OuiA" type="5002"/>
        <children xmi:type="notation:DecorationNode" xmi:id="_wRhYoWu_EeK4z9Hok4OuiA" type="5003"/>
        <children xmi:type="notation:DecorationNode" xmi:id="_wRimwGu_EeK4z9Hok4OuiA" type="7002">
          <children xmi:type="notation:Node" xmi:id="_xsYNEGu_EeK4z9Hok4OuiA" type="3002">
            <element xmi:type="henshin:Attribute" href="EnumBugRegistered.henshin#_xsVw0Gu_EeK4z9Hok4OuiA"/>
            <layoutConstraint xmi:type="notation:Location" xmi:id="_xsYNEWu_EeK4z9Hok4OuiA"/>
          </children>
          <styles xmi:type="notation:SortingStyle" xmi:id="_wRimwWu_EeK4z9Hok4OuiA"/>
          <styles xmi:type="notation:FilteringStyle" xmi:id="_wRimwmu_EeK4z9Hok4OuiA"/>
        </children>
        <element xmi:type="henshin:Node" href="EnumBugRegistered.henshin#_wQ-mEGu_EeK4z9Hok4OuiA"/>
        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_wRgxkWu_EeK4z9Hok4OuiA" x="20" y="33" width="134" height="85"/>
      </children>
      <children xmi:type="notation:Shape" xmi:id="_yUNCEGu_EeK4z9Hok4OuiA" type="3001" fontName="Ubuntu">
        <children xmi:type="notation:DecorationNode" xmi:id="_yUNpIGu_EeK4z9Hok4OuiA" type="5002"/>
        <children xmi:type="notation:DecorationNode" xmi:id="_yUNpIWu_EeK4z9Hok4OuiA" type="5003"/>
        <children xmi:type="notation:DecorationNode" xmi:id="_yUNpImu_EeK4z9Hok4OuiA" type="7002">
          <children xmi:type="notation:Node" xmi:id="_yx7f4Gu_EeK4z9Hok4OuiA" type="3002">
            <element xmi:type="henshin:Attribute" href="EnumBugRegistered.henshin#_yx0LIGu_EeK4z9Hok4OuiA"/>
            <layoutConstraint xmi:type="notation:Location" xmi:id="_yx7f4Wu_EeK4z9Hok4OuiA"/>
          </children>
          <styles xmi:type="notation:SortingStyle" xmi:id="_yUNpI2u_EeK4z9Hok4OuiA"/>
          <styles xmi:type="notation:FilteringStyle" xmi:id="_yUNpJGu_EeK4z9Hok4OuiA"/>
        </children>
        <element xmi:type="henshin:Node" href="EnumBugRegistered.henshin#_yUCC8Gu_EeK4z9Hok4OuiA"/>
        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_yUNCEWu_EeK4z9Hok4OuiA" x="166" y="33" width="119" height="85"/>
      </children>
    </children>
    <element xmi:type="henshin:Rule" href="EnumBugRegistered.henshin#__VsX4Gu-EeKtEK7du4RqbQ"/>
    <layoutConstraint xmi:type="notation:Bounds" xmi:id="__V-rwWu-EeKtEK7du4RqbQ" x="154" y="87" width="305" height="192"/>
  </children>
  <children xmi:type="notation:Shape" xmi:id="_KnQO4GvDEeKZ8qH1Kxc-Gw" type="2002" fontName="Ubuntu" italic="true" fillColor="14808535" lineColor="0">
    <children xmi:type="notation:DecorationNode" xmi:id="_KnQ18GvDEeKZ8qH1Kxc-Gw" type="5004"/>
    <children xmi:type="notation:DecorationNode" xmi:id="_KnQ18WvDEeKZ8qH1Kxc-Gw" type="7003">
      <children xmi:type="notation:Node" xmi:id="_KnSrIGvDEeKZ8qH1Kxc-Gw" type="3004">
        <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_KnTSMGvDEeKZ8qH1Kxc-Gw" source="symbol">
          <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_KnTSMWvDEeKZ8qH1Kxc-Gw" key="type" value="UNIT_BEGIN"/>
        </eAnnotations>
        <styles xmi:type="notation:DescriptionStyle" xmi:id="_KnSrIWvDEeKZ8qH1Kxc-Gw"/>
        <styles xmi:type="notation:FontStyle" xmi:id="_KnSrImvDEeKZ8qH1Kxc-Gw" fontName="Ubuntu"/>
        <element xmi:type="henshin:SequentialUnit" href="EnumBugRegistered.henshin#_KmuDYGvDEeKZ8qH1Kxc-Gw"/>
        <layoutConstraint xmi:type="notation:Location" xmi:id="_KnTSMmvDEeKZ8qH1Kxc-Gw" x="15" y="15"/>
      </children>
      <children xmi:type="notation:Node" xmi:id="_KnTSM2vDEeKZ8qH1Kxc-Gw" type="3004">
        <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_KnT5QGvDEeKZ8qH1Kxc-Gw" source="symbol">
          <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_KnT5QWvDEeKZ8qH1Kxc-Gw" key="type" value="UNIT_END"/>
        </eAnnotations>
        <styles xmi:type="notation:DescriptionStyle" xmi:id="_KnTSNGvDEeKZ8qH1Kxc-Gw"/>
        <styles xmi:type="notation:FontStyle" xmi:id="_KnTSNWvDEeKZ8qH1Kxc-Gw" fontName="Ubuntu"/>
        <element xmi:type="henshin:SequentialUnit" href="EnumBugRegistered.henshin#_KmuDYGvDEeKZ8qH1Kxc-Gw"/>
        <layoutConstraint xmi:type="notation:Location" xmi:id="_KnT5QmvDEeKZ8qH1Kxc-Gw" x="205" y="15"/>
      </children>
      <children xmi:type="notation:Shape" xmi:id="_MVSeAGvDEeKZ8qH1Kxc-Gw" type="3003" fontName="Ubuntu" italic="true" lineColor="0">
        <children xmi:type="notation:DecorationNode" xmi:id="_MVTFEGvDEeKZ8qH1Kxc-Gw" type="5005"/>
        <element xmi:type="henshin:Rule" href="EnumBugRegistered.henshin#__VsX4Gu-EeKtEK7du4RqbQ"/>
        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MVSeAWvDEeKZ8qH1Kxc-Gw" x="86" y="15"/>
      </children>
    </children>
    <element xmi:type="henshin:SequentialUnit" href="EnumBugRegistered.henshin#_KmuDYGvDEeKZ8qH1Kxc-Gw"/>
    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_KnQO4WvDEeKZ8qH1Kxc-Gw" x="154" y="351" width="283" height="108"/>
  </children>
  <styles xmi:type="notation:DiagramStyle" xmi:id="_70CPAWu-EeKtEK7du4RqbQ"/>
  <element xmi:type="henshin:Module" href="EnumBugRegistered.henshin#_3l7P0Gu-EeKtEK7du4RqbQ"/>
  <edges xmi:type="notation:Edge" xmi:id="_MVTFEWvDEeKZ8qH1Kxc-Gw" type="4002" source="_KnSrIGvDEeKZ8qH1Kxc-Gw" target="_MVSeAGvDEeKZ8qH1Kxc-Gw">
    <styles xmi:type="notation:RoutingStyle" xmi:id="_MVTFEmvDEeKZ8qH1Kxc-Gw" routing="Rectilinear"/>
    <styles xmi:type="notation:FontStyle" xmi:id="_MVTFE2vDEeKZ8qH1Kxc-Gw" fontName="Ubuntu"/>
    <element xmi:type="henshin:SequentialUnit" href="EnumBugRegistered.henshin#_KmuDYGvDEeKZ8qH1Kxc-Gw"/>
    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_MVTFFGvDEeKZ8qH1Kxc-Gw" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
  </edges>
  <edges xmi:type="notation:Edge" xmi:id="_MVTsIGvDEeKZ8qH1Kxc-Gw" type="4002" source="_MVSeAGvDEeKZ8qH1Kxc-Gw" target="_KnTSM2vDEeKZ8qH1Kxc-Gw">
    <styles xmi:type="notation:RoutingStyle" xmi:id="_MVTsIWvDEeKZ8qH1Kxc-Gw" routing="Rectilinear"/>
    <styles xmi:type="notation:FontStyle" xmi:id="_MVTsImvDEeKZ8qH1Kxc-Gw" fontName="Ubuntu"/>
    <element xmi:type="henshin:SequentialUnit" href="EnumBugRegistered.henshin#_KmuDYGvDEeKZ8qH1Kxc-Gw"/>
    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_MVTsI2vDEeKZ8qH1Kxc-Gw" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
  </edges>
</notation:Diagram>

import org.eclipse.emf.henshin.model.resource.HenshinResourceSet
import org.eclipse.emf.henshin.interpreter.impl.EGraphImpl
import org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl
import org.eclipse.emf.henshin.interpreter.impl.EngineImpl
import org.eclipse.emf.ecore.EObject

import EnumBug.EnumBugFactory
import static EnumBug.SomeEnum.*

/**
 * http://dev.eclipse.org/svnroot/modeling/org.eclipse.emft.henshin/trunk/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/util/InterpreterUtil.java
 * http://wiki.eclipse.org/Henshin_Interpreter
 * http://www.user.tu-berlin.de/lieske/tfs/projekte/henshin/
 */
class HenshinTester {
	
	def static void main(String[] args) {
				
		val model = getInstance
		
		transform(model)
	}
	
	def static EObject getInstance() {
		
		val it = EnumBugFactory::eINSTANCE		
		
		createSomeSuperclass => [ root |			
			val someModel = createSomeModel => [ enumAttr = FOO ]
			root.models.add(someModel)
		]
		
	}
	
	def static transform(EObject model) {
		val resourceSet = new HenshinResourceSet("src") 
		
		// Create a resource set with a base directory, load the module and find the rule:
		val unit = resourceSet
			.getModule("EnumBugRegistered.henshin", false)
			.getUnit("testUnit")
	
		val graph = new EGraphImpl(model)
	
		val engine = new EngineImpl()		
		
		new UnitApplicationImpl(engine, graph, unit, null) => [
			println( execute(null) )
		]
		
	}	
}
import EnumBug.EnumBugFactory;
import EnumBug.SomeEnum;
import EnumBug.SomeModel;
import EnumBug.SomeSuperclass;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.henshin.interpreter.impl.EGraphImpl;
import org.eclipse.emf.henshin.interpreter.impl.EngineImpl;
import org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl;
import org.eclipse.emf.henshin.model.Module;
import org.eclipse.emf.henshin.model.Unit;
import org.eclipse.emf.henshin.model.resource.HenshinResourceSet;
import org.eclipse.xtext.xbase.lib.InputOutput;
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;

/**
 * http://dev.eclipse.org/svnroot/modeling/org.eclipse.emft.henshin/trunk/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/util/InterpreterUtil.java
 * http://wiki.eclipse.org/Henshin_Interpreter
 * http://www.user.tu-berlin.de/lieske/tfs/projekte/henshin/
 */
@SuppressWarnings("all")
public class HenshinTester {
  public static void main(final String[] args) {
    final EObject model = HenshinTester.getInstance();
    HenshinTester.transform(model);
  }
  
  public static EObject getInstance() {
    SomeSuperclass _xblockexpression = null;
    {
      final EnumBugFactory it = EnumBugFactory.eINSTANCE;
      SomeSuperclass _createSomeSuperclass = it.createSomeSuperclass();
      final Procedure1<SomeSuperclass> _function = new Procedure1<SomeSuperclass>() {
          public void apply(final SomeSuperclass root) {
            SomeModel _createSomeModel = it.createSomeModel();
            final Procedure1<SomeModel> _function = new Procedure1<SomeModel>() {
                public void apply(final SomeModel it) {
                  it.setEnumAttr(SomeEnum.FOO);
                }
              };
            final SomeModel someModel = ObjectExtensions.<SomeModel>operator_doubleArrow(_createSomeModel, _function);
            EList<SomeModel> _models = root.getModels();
            _models.add(someModel);
          }
        };
      SomeSuperclass _doubleArrow = ObjectExtensions.<SomeSuperclass>operator_doubleArrow(_createSomeSuperclass, _function);
      _xblockexpression = (_doubleArrow);
    }
    return _xblockexpression;
  }
  
  public static UnitApplicationImpl transform(final EObject model) {
    UnitApplicationImpl _xblockexpression = null;
    {
      HenshinResourceSet _henshinResourceSet = new HenshinResourceSet("src");
      final HenshinResourceSet resourceSet = _henshinResourceSet;
      Module _module = resourceSet.getModule("EnumBugRegistered.henshin", false);
      final Unit unit = _module.getUnit("testUnit");
      EGraphImpl _eGraphImpl = new EGraphImpl(model);
      final EGraphImpl graph = _eGraphImpl;
      EngineImpl _engineImpl = new EngineImpl();
      final EngineImpl engine = _engineImpl;
      UnitApplicationImpl _unitApplicationImpl = new UnitApplicationImpl(engine, graph, unit, null);
      final Procedure1<UnitApplicationImpl> _function = new Procedure1<UnitApplicationImpl>() {
          public void apply(final UnitApplicationImpl it) {
            boolean _execute = it.execute(null);
            InputOutput.<Boolean>println(Boolean.valueOf(_execute));
          }
        };
      UnitApplicationImpl _doubleArrow = ObjectExtensions.<UnitApplicationImpl>operator_doubleArrow(_unitApplicationImpl, _function);
      _xblockexpression = (_doubleArrow);
    }
    return _xblockexpression;
  }
}


Back to the top