Search in sources :

Example 1 with Operation

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

the class OperationImpl method registerType.

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

        public Operation newInstance(ModelTypeInstanceContext instanceContext) {
            return new OperationImpl(instanceContext);
        }
    });
    nameAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_NAME).required().build();
    implementationRefAttribute = typeBuilder.stringAttribute(BPMN_ELEMENT_IMPLEMENTATION_REF).build();
    SequenceBuilder sequenceBuilder = typeBuilder.sequence();
    inMessageRefChild = sequenceBuilder.element(InMessageRef.class).required().qNameElementReference(Message.class).build();
    outMessageRefChild = sequenceBuilder.element(OutMessageRef.class).qNameElementReference(Message.class).build();
    errorRefCollection = sequenceBuilder.elementCollection(ErrorRef.class).qNameElementReferenceCollection(Error.class).build();
    typeBuilder.build();
}
Also used : BaseElement(org.camunda.bpm.model.bpmn.instance.BaseElement) SequenceBuilder(org.camunda.bpm.model.xml.type.child.SequenceBuilder) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) Operation(org.camunda.bpm.model.bpmn.instance.Operation) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)

Aggregations

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