Search in sources :

Example 1 with DataStore

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

the class DataStoreImpl method registerType.

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

        public DataStore newInstance(ModelTypeInstanceContext instanceContext) {
            return new DataStoreImpl(instanceContext);
        }
    });
    nameAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_NAME).build();
    capacityAttribute = typeBuilder.integerAttribute(BPMN_ATTRIBUTE_CAPACITY).build();
    isUnlimitedAttribute = typeBuilder.booleanAttribute(BPMN_ATTRIBUTE_IS_UNLIMITED).defaultValue(true).build();
    itemSubjectRefAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_ITEM_SUBJECT_REF).qNameAttributeReference(ItemDefinition.class).build();
    SequenceBuilder sequenceBuilder = typeBuilder.sequence();
    dataStateChild = sequenceBuilder.element(DataState.class).build();
    typeBuilder.build();
}
Also used : RootElement(org.camunda.bpm.model.bpmn.instance.RootElement) DataStore(org.camunda.bpm.model.bpmn.instance.DataStore) 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)

Example 2 with DataStore

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

the class DataStoreTest method testGetDataStore.

@Test
public void testGetDataStore() {
    DataStore dataStore = modelInstance.getModelElementById("myDataStore");
    assertThat(dataStore).isNotNull();
    assertThat(dataStore.getName()).isEqualTo("My Data Store");
    assertThat(dataStore.getCapacity()).isEqualTo(23);
    assertThat(dataStore.isUnlimited()).isFalse();
}
Also used : DataStore(org.camunda.bpm.model.bpmn.instance.DataStore) Test(org.junit.Test)

Example 3 with DataStore

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

the class DataStoreTest method testGetDataStoreReference.

@Test
public void testGetDataStoreReference() {
    DataStoreReference dataStoreReference = modelInstance.getModelElementById("myDataStoreReference");
    DataStore dataStore = modelInstance.getModelElementById("myDataStore");
    assertThat(dataStoreReference).isNotNull();
    assertThat(dataStoreReference.getName()).isEqualTo("My Data Store Reference");
    assertThat(dataStoreReference.getDataStore()).isEqualTo(dataStore);
}
Also used : DataStoreReference(org.camunda.bpm.model.bpmn.instance.DataStoreReference) DataStore(org.camunda.bpm.model.bpmn.instance.DataStore) Test(org.junit.Test)

Aggregations

DataStore (org.camunda.bpm.model.bpmn.instance.DataStore)3 Test (org.junit.Test)2 DataStoreReference (org.camunda.bpm.model.bpmn.instance.DataStoreReference)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