Search in sources :

Example 1 with Relationship

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

the class RelationshipImpl method registerType.

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

        public Relationship newInstance(ModelTypeInstanceContext instanceContext) {
            return new RelationshipImpl(instanceContext);
        }
    });
    typeAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_TYPE).required().build();
    directionAttribute = typeBuilder.enumAttribute(BPMN_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 : BaseElement(org.camunda.bpm.model.bpmn.instance.BaseElement) Relationship(org.camunda.bpm.model.bpmn.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)

Aggregations

BaseElement (org.camunda.bpm.model.bpmn.instance.BaseElement)1 Relationship (org.camunda.bpm.model.bpmn.instance.Relationship)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