Search in sources :

Example 1 with CamundaProperties

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

the class CamundaExtensionsTest method testCamundaModelerProperties.

@Test
public void testCamundaModelerProperties() {
    CamundaProperties camundaProperties = endEvent.getExtensionElements().getElementsQuery().filterByType(CamundaProperties.class).singleResult();
    assertThat(camundaProperties).isNotNull();
    assertThat(camundaProperties.getCamundaProperties()).hasSize(2);
    for (CamundaProperty camundaProperty : camundaProperties.getCamundaProperties()) {
        assertThat(camundaProperty.getCamundaId()).isNull();
        assertThat(camundaProperty.getCamundaName()).startsWith("name");
        assertThat(camundaProperty.getCamundaValue()).startsWith("value");
    }
}
Also used : CamundaProperty(org.camunda.bpm.model.bpmn.instance.camunda.CamundaProperty) CamundaProperties(org.camunda.bpm.model.bpmn.instance.camunda.CamundaProperties) Test(org.junit.Test)

Example 2 with CamundaProperties

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

the class CamundaPropertiesImpl method registerType.

public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaProperties.class, CAMUNDA_ELEMENT_PROPERTIES).namespaceUri(CAMUNDA_NS).instanceProvider(new ModelTypeInstanceProvider<CamundaProperties>() {

        public CamundaProperties newInstance(ModelTypeInstanceContext instanceContext) {
            return new CamundaPropertiesImpl(instanceContext);
        }
    });
    SequenceBuilder sequenceBuilder = typeBuilder.sequence();
    camundaPropertyCollection = sequenceBuilder.elementCollection(CamundaProperty.class).build();
    typeBuilder.build();
}
Also used : CamundaProperties(org.camunda.bpm.model.bpmn.instance.camunda.CamundaProperties) 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

CamundaProperties (org.camunda.bpm.model.bpmn.instance.camunda.CamundaProperties)2 CamundaProperty (org.camunda.bpm.model.bpmn.instance.camunda.CamundaProperty)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 Test (org.junit.Test)1