Search in sources :

Example 1 with ModelTypeInstanceProvider

use of org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider in project camunda-bpmn-model by camunda.

the class CorrelationPropertyImpl method registerType.

public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder;
    typeBuilder = modelBuilder.defineType(CorrelationProperty.class, BPMN_ELEMENT_CORRELATION_PROPERTY).namespaceUri(BPMN20_NS).extendsType(RootElement.class).instanceProvider(new ModelTypeInstanceProvider<CorrelationProperty>() {

        public CorrelationProperty newInstance(ModelTypeInstanceContext instanceContext) {
            return new CorrelationPropertyImpl(instanceContext);
        }
    });
    nameAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_NAME).build();
    typeAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_TYPE).qNameAttributeReference(ItemDefinition.class).build();
    SequenceBuilder sequenceBuilder = typeBuilder.sequence();
    correlationPropertyRetrievalExpressionCollection = sequenceBuilder.elementCollection(CorrelationPropertyRetrievalExpression.class).required().build();
    typeBuilder.build();
}
Also used : SequenceBuilder(org.camunda.bpm.model.xml.type.child.SequenceBuilder) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) ModelTypeInstanceProvider(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext) CorrelationPropertyRetrievalExpression(org.camunda.bpm.model.bpmn.instance.CorrelationPropertyRetrievalExpression)

Aggregations

CorrelationPropertyRetrievalExpression (org.camunda.bpm.model.bpmn.instance.CorrelationPropertyRetrievalExpression)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1 ModelTypeInstanceProvider (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider)1 SequenceBuilder (org.camunda.bpm.model.xml.type.child.SequenceBuilder)1