Hi,

I posted over on the oAW forums about resolving nested imports for design
files.  Someone responded with a solution that looks very promising.  This
obviously does not solve my problem of keeping a "common" model separate
from my "app" one, but if I can solve this nested imports problem, I am
pretty sure that I can solve the other one.

The sample solution is in the third post here:
http://www.openarchitectureware.org/forum/viewtopic.php?showtopic=10600&lastpost=true

I tried to mimic what he was doing by making a few changes for Sculptor's
DSL.  I am having some trouble though.  Here's my version:

cached List[DslApplication] allModelElements (DslModel this) :
        imports().app.collect(this.app).flatten();

imports (DslModel this) :
        importClosure( {}.toSet(), { this } );

private Set[DslModel] importClosure (Set[DslModel] result, List[DslModel]
nextModels) :
        nextModels.isEmpty ? result : (
                let m = nextModels.first() : (
                        result.contains(m) ?
                                importClosure(result, 
nextModels.withoutFirst()) :
                                importClosure(result.add(m).toSet(),
                                                          
nextModels.withoutFirst().addAll( m.imports.model.flatten()
).toList()
                                                         )
                )
        );

List[emf::EObject] allVisibleElements(emf::EObject x):
        ((DslModel)x.eRootContainer).allModelElements();

When I run the generator unit tests, I get:

625 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 
1719 ERROR WorkflowRunner     - Workflow interrupted. Reason: Errors during
validation.
1719 ERROR WorkflowRunner     - Couldn't resolve reference to
'PlanetMessage' [EMAIL PROTECTED]
(eClass: [EMAIL PROTECTED] (name: DslConsumer)
(instanceClassName: null) (abstract: false, interface: false))] 
1734 ERROR WorkflowRunner     - Couldn't resolve reference to 'MoonMessage'
[EMAIL PROTECTED] (eClass:
[EMAIL PROTECTED] (name: DslConsumer)
(instanceClassName: null) (abstract: false, interface: false))] 
1734 ERROR WorkflowRunner     - Couldn't resolve reference to 'Planet'
[EMAIL PROTECTED] (eClass:
[EMAIL PROTECTED] (name: DslServiceOperation)
(instanceClassName: null) (abstract: false, interface: false))] 
1734 ERROR WorkflowRunner     - Couldn't resolve reference to
'PlanetManager' [EMAIL PROTECTED]
(eClass: [EMAIL PROTECTED] (name:
DslServiceOperationDelegate) (instanceClassName: null) (abstract: false,
interface: false))] 
1734 ERROR WorkflowRunner     - Couldn't resolve reference to 'Planet'
[EMAIL PROTECTED] (eClass:
[EMAIL PROTECTED] (name: DslReference)
(instanceClassName: null) (abstract: false, interface: false))] 
1734 ERROR WorkflowRunner     - Couldn't resolve reference to 'XmlMoon'
[EMAIL PROTECTED] (eClass:
[EMAIL PROTECTED] (name: DslReference)
(instanceClassName: null) (abstract: false, interface: false))] 
1734 ERROR WorkflowRunner     - Couldn't resolve reference to 'Planet'
[EMAIL PROTECTED] (eClass:
[EMAIL PROTECTED] (name: DslReference)
(instanceClassName: null) (abstract: false, interface: false))] 
1734 ERROR WorkflowRunner     - Couldn't resolve reference to 'Moon'
[EMAIL PROTECTED] (eClass:
[EMAIL PROTECTED] (name: DslReference)
(instanceClassName: null) (abstract: false, interface: false))] 
1734 ERROR WorkflowRunner     - Couldn't resolve reference to
'PlanetManager' [EMAIL PROTECTED]
(eClass: [EMAIL PROTECTED] (name: DslDependency)
(instanceClassName: null) (abstract: false, interface: false))] 
1734 ERROR WorkflowRunner     - Couldn't resolve reference to
'PlanetManager' [EMAIL PROTECTED]
(eClass: [EMAIL PROTECTED] (name: DslDependency)
(instanceClassName: null) (abstract: false, interface: false))] 
1734 ERROR WorkflowRunner     - Unkown reference moons
[EMAIL PROTECTED] (eClass:
[EMAIL PROTECTED] (name: DslReference)
(instanceClassName: null) (abstract: false, interface: false))] 
1734 ERROR WorkflowRunner     - Unkown reference planet
[EMAIL PROTECTED] (eClass:
[EMAIL PROTECTED] (name: DslReference)
(instanceClassName: null) (abstract: false, interface: false))] 
1734 ERROR WorkflowRunner     - Opposite should specify this reference as
opposite: moons" <-> "planet
[EMAIL PROTECTED] (eClass:
[EMAIL PROTECTED] (name: DslReference)
(instanceClassName: null) (abstract: false, interface: false))] 
1734 ERROR WorkflowRunner     - Opposite should specify this reference as
opposite: planet" <-> "moons
[EMAIL PROTECTED] (eClass:
[EMAIL PROTECTED] (name: DslReference)
(instanceClassName: null) (abstract: false, interface: false))] 

It looks like the current model's contents are not being found, so I tried
to add "this.app" in allModelElements.  It's not working though.  I'll keep
beating at this, but if you see something that I'm missing, please let me
know!

Thanks!
--Polly

-- 
View this message in context: 
http://www.nabble.com/-Sculptor--importing-nested-design-files-tp20269181s17564p20269181.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