Search in sources :

Example 1 with Resource

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

the class ResourceImpl method registerType.

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

        public Resource newInstance(ModelTypeInstanceContext instanceContext) {
            return new ResourceImpl(instanceContext);
        }
    });
    nameAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_NAME).required().build();
    SequenceBuilder sequenceBuilder = typeBuilder.sequence();
    resourceParameterCollection = sequenceBuilder.elementCollection(ResourceParameter.class).build();
    typeBuilder.build();
}
Also used : RootElement(org.camunda.bpm.model.bpmn.instance.RootElement) SequenceBuilder(org.camunda.bpm.model.xml.type.child.SequenceBuilder) Resource(org.camunda.bpm.model.bpmn.instance.Resource) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)

Aggregations

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