Search in sources :

Example 1 with Relationship

use of org.camunda.bpm.model.cmmn.instance.Relationship in project camunda-cmmn-model by camunda.

the class RelationshipImpl method registerType.

public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Relationship.class, CMMN_ELEMENT_RELATIONSHIP).namespaceUri(CMMN11_NS).extendsType(CmmnElement.class).instanceProvider(new ModelTypeInstanceProvider<Relationship>() {

        public Relationship newInstance(ModelTypeInstanceContext instanceContext) {
            return new RelationshipImpl(instanceContext);
        }
    });
    typeAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_TYPE).required().build();
    directionAttribute = typeBuilder.enumAttribute(CMMN_ATTRIBUTE_DIRECTION, RelationshipDirection.class).build();
    SequenceBuilder sequenceBuilder = typeBuilder.sequence();
    sourceCollection = sequenceBuilder.elementCollection(Source.class).minOccurs(1).build();
    targetCollection = sequenceBuilder.elementCollection(Target.class).minOccurs(1).build();
    typeBuilder.build();
}
Also used : CmmnElement(org.camunda.bpm.model.cmmn.instance.CmmnElement) Target(org.camunda.bpm.model.cmmn.instance.Target) Relationship(org.camunda.bpm.model.cmmn.instance.Relationship) SequenceBuilder(org.camunda.bpm.model.xml.type.child.SequenceBuilder) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext) Source(org.camunda.bpm.model.cmmn.instance.Source)

Aggregations

CmmnElement (org.camunda.bpm.model.cmmn.instance.CmmnElement)1 Relationship (org.camunda.bpm.model.cmmn.instance.Relationship)1 Source (org.camunda.bpm.model.cmmn.instance.Source)1 Target (org.camunda.bpm.model.cmmn.instance.Target)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1 SequenceBuilder (org.camunda.bpm.model.xml.type.child.SequenceBuilder)1