[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2m] [ATL] How to put model elements in a package that is created in another rule?

Hey all,

I'm stuck with the following situation:

I want to map some model onto a UML model.

The first model is of a box which can contain squares and circles.

Therefore I created a rule:

rule struct {
    from
            b : BoxMM!Box
    to
            m : UML!Model (
                name<- b.name
            ),
            ps : UML!Package (
                name<-'squares',
                namespace<-m
            ),
            pc : UML!Package (
                name <-'circles',
                namespace <-m
            )
}


Now I want to put all the squares into the package squares and all the 
circles into the package circle.
So I thought it would be easy to create another rule:

rule squares {
    from
        s : BoxMM!Square
    to
        c : UML!Class (
            name<-s.name,
            namespace <-ps    <<<< THIS WON'T WORK!!
                                        Because ps was created in another 
rule.
        )
}

and a similar rule for circles. How to reference the package 'squares' that 
was created in another rule?

Kind regards