Hi Klaus,

please open your model and select the root model element in the outline.
Then assign a name to your model using the properties view. After that
enumerations will work without problems.

Regards,

Benjamin

On Wed, Jul 22, 2009 at 9:41 PM, Klaus Mueller <muell...@fh-trier.de> wrote:

>
> Hello,
> up to now I used Magic Draw as a modeling tool. Due to restrictions
> concerning the number of actions that can be created (with the community
> edition) I switched to Topcased. I started creating my profile with
> Topcased
> and after that I created my first models. The first tests were ok, but then
> I got an error message from oAW (I'll show it with a small example after
> describing the problem). After some time of investigation I found out that
> the usage of an enumeration seems to be the problem. As soon as I add an
> enumeration with an enumeration literal to my model, oAW reports an
> EvaluationException. After deleting the enumeration literal everything
> works
> fine.
>
> I created a small template and a small workflow to ensure that it was not a
> coincidence. Here is my simple workflow:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <workflow>
>        <bean class="oaw.uml2.Setup" standardUML2Setup="true"/>
>
>        <bean id="mm_uml2"
> class="org.openarchitectureware.uml2.UML2MetaModel" />
>
>        <bean id="mm_test"
> class="org.openarchitectureware.uml2.profile.ProfileMetaModel">
>                <profile value="test/TestProfile.profile.uml" />
>        </bean>
>
>        <component class="oaw.emf.XmiReader">
>        <modelFile value="test/EnumTest.uml"/>
>        <outputSlot value="model"/>
>        </component>
>
>        <component id="enum_test_generator" class="oaw.xpand2.Generator"
> skipOnErrors="true">
>                <metaModel idRef="mm_uml2" />
>                <metaModel idRef="mm_test" />
>
>        <expand value="test::EnumTest::root FOR model"/>
>        <outlet path="src-gen" overwrite="true" />
>        </component>
> </workflow>
>
> And here the corresponding template (its not a meaningful template, but it
> is sufficient for demonstration):
>
> «DEFINE root FOR uml::Model»
> «FILE "testoutput.txt"»
> «FOREACH this.eAllContents.typeSelect(uml::Class) AS c»
> class «c.name»
> «ENDFOREACH»
>
> «FOREACH this.eAllContents.typeSelect(TestProfile::Stereotype1) AS c»
> test «c.name»
> «ENDFOREACH»
>
> «FOREACH this.eAllContents.typeSelect(uml::Enumeration) AS e»
> enum «e.name»
> «ENDFOREACH»
> «ENDFILE»
> «ENDDEFINE»
>
> TestProfile is my Profile that simply contains one stereotype Stereotype1
> (with baseclass uml::Class).
>
> When I execute the workflow using a model without enumerations everything
> works fine. The file contains the expected output. Adding an enumeration
> does not change everything (now the enumeration is shown in the output as
> well). But adding an enumeration literal causes problems. Here the output
> after adding one enumeration literal to the enumeration:
>
> 2312 INFO  CompositeComponent - Generator(enum_test_generator): generating
> 'test::EnumTest::root FOR model' => src-gen
> 2547 ERROR AbstractExpressionsUsingWorkflowComponent - Error in Component
> enum_test_generator of type org.openarchitectureware.xpand2.Generator:
>        EvaluationException : null
>        test::EnumTest.xpt[65,40] on line 3
> 'this.eAllContents.typeSelect(uml::Class)'
>        [23,37] on line 1 'EXPAND test::EnumTest::root FOR model'
>
> 2547 ERROR WorkflowRunner     - Workflow interrupted. Reason:
> EvaluationException : null
>        test::EnumTest.xpt[65,40] on line 3
> 'this.eAllContents.typeSelect(uml::Class)'
>        [23,37] on line 1 'EXPAND test::EnumTest::root FOR model'
>
> 2547 ERROR WorkflowRunner     - ERROR in Component enum_test_generator of
> type org.openarchitectureware.xpand2.Generator
>        null [this.eAllContents.typeSelect(uml::Class)]  in workflow:
> Generator(enum_test_generator): generating 'test::EnumTest::root FOR model'
> => src-gen
> 2547 ERROR WorkflowRunner     - ERROR in Component enum_test_generator of
> type org.openarchitectureware.xpand2.Generator
>        null [org.openarchitectureware.xpand2.ast.foreachstatem...@1dec1dd]
>  in
> workflow: Generator(enum_test_generator): generating 'test::EnumTest::root
> FOR model' => src-gen
> 2547 ERROR WorkflowRunner     - ERROR in Component enum_test_generator of
> type org.openarchitectureware.xpand2.Generator
>        null [org.openarchitectureware.xpand2.ast.filestatem...@189c036]
>  in
> workflow: Generator(enum_test_generator): generating 'test::EnumTest::root
> FOR model' => src-gen
> 2547 ERROR WorkflowRunner     - ERROR in Component enum_test_generator of
> type org.openarchitectureware.xpand2.Generator
>        null [root : uml::Model]  in workflow:
> Generator(enum_test_generator):
> generating 'test::EnumTest::root FOR model' => src-gen
> 2547 ERROR WorkflowRunner     - ERROR in Component enum_test_generator of
> type org.openarchitectureware.xpand2.Generator
>        null [EXPAND test::EnumTest::root FOR model]  in workflow:
> Generator(enum_test_generator): generating 'test::EnumTest::root FOR model'
> => src-gen
>
> After that I deleted the profile and created a model with some classes
> (without using any profile). Moreover I adjusted the workflow and template.
> After these changes I can execute the workflow with a model containg
> enumerations and enumeration literals without any errors.
>
> Is there any explanation for this behavior? I hope I simply did something
> wrong.
>
> By the way, I'm using oAW 4.3.1 and Topcased 2.5.
>
> Thank you in advance.
>
> Regards,
> Klaus
> --
> View this message in context:
> http://www.nabble.com/Problems-using-Topcased-in-conjunction-with-enumeration-and-own-profile-tp24613148s17564p24613148.html
> Sent from the Fornax-Platform mailing list archive at Nabble.com.
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Fornax-developer mailing list
> Fornax-developer@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fornax-developer
>
------------------------------------------------------------------------------
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to