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();
}
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();
}
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);
}
Aggregations