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();
}
Aggregations