Hi,

Sorry I have yet another question.  :(  I am getting a weird error that I
simply do not understand, and I've been beating on this for a while now to
no avail.  

I am trying to add a field to DslReference.  I want the syntax to look like
this in the design file:
    Entity Apple {
    ...
    }

    Entity Banana {
    ...
    }

    Entity Cantaloupe {
        - @Banana banana [EMAIL PROTECTED]
    }

I changed the DSL definition by adding the "foo" field:

DslReference :
  (doc=STRING)?
  REF (visibility=DslVisibility)? (collectionType=DslCollectionType"<")?
(("@")?domainObjectType=[DslSimpleDomainObject]) (">")? name=ID
    ((key?="key") |
     ((notChangeable?=NOT "changeable") | ("changeable")) |
     ((required?="required") | (NOT "required")) |
     ((nullable?="nullable") | (NOT "nullable")) |
     ("cascade" "=" cascade=STRING) |
     ("fetch" "=" fetch=STRING) |
     ((cache?="cache") | (NOT "cache")) |
     ((inverse?="inverse") | (NOT "inverse")) |
     ("databaseColumn" "=" databaseColumn=STRING) |
     ("orderBy" "=" orderBy=ID) |      
     ("foo" "=" ("@")?foo=[DslSimpleDomainObject]))*
    (OPPOSITE oppositeName=ID)? (";")?;  

The transformation definition didn't seem to make any difference in this
problem, but here it is just in case:

create sculptormetamodel::Reference this transform(DslReference reference) :
    setDoc(reference.doc) ->
    ...
    setDatabaseColumn(reference.databaseColumn) ->
    (reference.foo != null ?
      setFoo(reference.foo.transform()) :
      null) ->
    (reference.oppositeName != null ?
     
setOpposite(reference.findOppositeReference(reference.oppositeName).transform()):
      null);

When I run mvn-install, I get a bunch of transformation test failures like
this:

Running
org.fornax.cartridges.sculptor.generator.transformation.UniverseGuiTransformationTest
...
391  INFO  WorkflowRunner     - running workflow:
workflowgui-test-universe.oaw
391  INFO  WorkflowRunner     - 
1125 INFO  CompositeComponent - Workflow: executing workflow
sculptorguiworkflowtest.oaw in workflowgui-test-universe.oaw:3
1125 INFO  CompositeComponent - Workflow: executing workflow
org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw in
sculptorguiworkflowtest.oaw:19
1125 INFO  CompositeComponent - ParserComponent(sculptordsl-parser)
1657 INFO  CompositeComponent - IfComponent: executing if
org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw in
org/fornax/cartridges/sculptor/dsl/parser/Parser.oaw:9
1657 INFO  ConditionalComponent - CheckComponent(sculptordsl-checker):
expression dslModel.eAllContents.union({dslModel}) check file(s):
org::fornax::cartridges::sculptor::dsl::GenChecks
org::fornax::cartridges::sculptor::dsl::Checks 
1688 ERROR AbstractExpressionsUsingWorkflowComponent - Error in Component
sculptordsl-checker of type org.openarchitectureware.check.CheckComponent: 
        EvaluationException : java.lang.NullPointerException
        org::fornax::cartridges::sculptor::dsl::GenChecks.chk[1668,24] on line 
27
'this.parsedString("foo")'

1688 ERROR WorkflowRunner     - Workflow interrupted. Reason:
EvaluationException : java.lang.NullPointerException
        org::fornax::cartridges::sculptor::dsl::GenChecks.chk[1668,24] on line 
27
'this.parsedString("foo")'

1703 ERROR WorkflowRunner     - Error during linking phase :
java.lang.NullPointerException on line 1 in universe.design
1703 ERROR WorkflowRunner     - ERROR in Component sculptordsl-checker of
type org.openarchitectureware.check.CheckComponent
        java.lang.NullPointerException [String parsedString(emf::EObject 
o,String
property)]  in workflow: CheckComponent(sculptordsl-checker): expression
dslModel.eAllContents.union({dslModel}) check file(s):
org::fornax::cartridges::sculptor::dsl::GenChecks
org::fornax::cartridges::sculptor::dsl::Checks 
1703 ERROR WorkflowRunner     - ERROR in Component sculptordsl-checker of
type org.openarchitectureware.check.CheckComponent
        java.lang.NullPointerException [this.parsedString("foo")]  in workflow:
CheckComponent(sculptordsl-checker): expression
dslModel.eAllContents.union({dslModel}) check file(s):
org::fornax::cartridges::sculptor::dsl::GenChecks
org::fornax::cartridges::sculptor::dsl::Checks 
1703 ERROR WorkflowRunner     - ERROR in Component sculptordsl-checker of
type org.openarchitectureware.check.CheckComponent
        java.lang.NullPointerException [this.parsedString("foo").!=(null)]  in
workflow: CheckComponent(sculptordsl-checker): expression
dslModel.eAllContents.union({dslModel}) check file(s):
org::fornax::cartridges::sculptor::dsl::GenChecks
org::fornax::cartridges::sculptor::dsl::Checks 
1703 ERROR WorkflowRunner     - ERROR in Component sculptordsl-checker of
type org.openarchitectureware.check.CheckComponent
        java.lang.NullPointerException [if this.parsedString("foo").!=(null) 
then
foo.!=(null) else true]  in workflow: CheckComponent(sculptordsl-checker):
expression dslModel.eAllContents.union({dslModel}) check file(s):
org::fornax::cartridges::sculptor::dsl::GenChecks
org::fornax::cartridges::sculptor::dsl::Checks 
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.828 sec
<<< FAILURE!

I looked in the GenChecks file and don't see anything different.  Deleting
the transformation snippet makes no difference.  I changed the reference
from "[DslSimpleDomainObject]" to String, and that passes the tests.  I
changed it to "ID", and that passes the tests.  I also changed it to
DslSimpleDomainObject without the brackets, and that passes the tests too. 
But that doesn't do what I want because the editor doesn't recognize the
entity name properly.  So I thought maybe something's wrong with using
DslSimpleDomainObject, and I tried DslEntity and DslBasicType.  But those
don't work either.  Oddly enough, I have gotten this exact syntax to work
before for this other definition:

DslConstant :
  (doc=STRING)?
  "const" (name=ID)? 
     ("value" "=" value=STRING) |
     ("valueRef" "=" ("@")?valueRef=[DslSimpleDomainObject]))* (";")?;   

So what is different about DslReference?  What the heck does the error mean?

Thanks for all your help!

--Polly
-- 
View this message in context: 
http://www.nabble.com/-Sculptor--GenChecks-error-after-adding-to-DslReference-tp18990651s17564p18990651.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fornax-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to