ModelSet usage in rule-based model configuration


(Brian Keyser) #1

I am trying to configure a ModelSet element type rule-base model configuration with a model element type containing a ModelSet managed collection. As an example, consider the model proposed in the basicRuleSourcePlugin of the gradle 3.5 distribution. The Person type has the following (partial) definition

@Managed
interface Person {
    ModelSet<Person> getChildren()
}

Given this definition, I had thought the following would define the children of a person

model {
    person {
        lastName = "Smith"
        children {
             firstName = "Brian"
        }
    }
}

However, this set the firstName attribute of the person model and does not create a new person. How would a child be added to a person?