use of org.camunda.bpm.model.bpmn.instance.camunda.CamundaProperty 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");
}
}
use of org.camunda.bpm.model.bpmn.instance.camunda.CamundaProperty in project camunda-bpmn-model by camunda.
the class CamundaExtensionsTest method testFormData.
@Test
public void testFormData() {
CamundaFormData formData = userTask.getExtensionElements().getElementsQuery().filterByType(CamundaFormData.class).singleResult();
CamundaFormField formField = formData.getCamundaFormFields().iterator().next();
assertThat(formField.getCamundaId()).isEqualTo(TEST_STRING_XML);
assertThat(formField.getCamundaLabel()).isEqualTo(TEST_STRING_XML);
assertThat(formField.getCamundaType()).isEqualTo(TEST_STRING_XML);
assertThat(formField.getCamundaDatePattern()).isEqualTo(TEST_STRING_XML);
assertThat(formField.getCamundaDefaultValue()).isEqualTo(TEST_STRING_XML);
formField.setCamundaId(TEST_STRING_API);
formField.setCamundaLabel(TEST_STRING_API);
formField.setCamundaType(TEST_STRING_API);
formField.setCamundaDatePattern(TEST_STRING_API);
formField.setCamundaDefaultValue(TEST_STRING_API);
assertThat(formField.getCamundaId()).isEqualTo(TEST_STRING_API);
assertThat(formField.getCamundaLabel()).isEqualTo(TEST_STRING_API);
assertThat(formField.getCamundaType()).isEqualTo(TEST_STRING_API);
assertThat(formField.getCamundaDatePattern()).isEqualTo(TEST_STRING_API);
assertThat(formField.getCamundaDefaultValue()).isEqualTo(TEST_STRING_API);
CamundaProperty property = formField.getCamundaProperties().getCamundaProperties().iterator().next();
assertThat(property.getCamundaId()).isEqualTo(TEST_STRING_XML);
assertThat(property.getCamundaValue()).isEqualTo(TEST_STRING_XML);
property.setCamundaId(TEST_STRING_API);
property.setCamundaValue(TEST_STRING_API);
assertThat(property.getCamundaId()).isEqualTo(TEST_STRING_API);
assertThat(property.getCamundaValue()).isEqualTo(TEST_STRING_API);
CamundaConstraint constraint = formField.getCamundaValidation().getCamundaConstraints().iterator().next();
assertThat(constraint.getCamundaName()).isEqualTo(TEST_STRING_XML);
assertThat(constraint.getCamundaConfig()).isEqualTo(TEST_STRING_XML);
constraint.setCamundaName(TEST_STRING_API);
constraint.setCamundaConfig(TEST_STRING_API);
assertThat(constraint.getCamundaName()).isEqualTo(TEST_STRING_API);
assertThat(constraint.getCamundaConfig()).isEqualTo(TEST_STRING_API);
CamundaValue value = formField.getCamundaValues().iterator().next();
assertThat(value.getCamundaId()).isEqualTo(TEST_STRING_XML);
assertThat(value.getCamundaName()).isEqualTo(TEST_STRING_XML);
value.setCamundaId(TEST_STRING_API);
value.setCamundaName(TEST_STRING_API);
assertThat(value.getCamundaId()).isEqualTo(TEST_STRING_API);
assertThat(value.getCamundaName()).isEqualTo(TEST_STRING_API);
}
use of org.camunda.bpm.model.bpmn.instance.camunda.CamundaProperty in project camunda-bpmn-model by camunda.
the class CamundaPropertyImpl method registerType.
public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaProperty.class, CAMUNDA_ELEMENT_PROPERTY).namespaceUri(CAMUNDA_NS).instanceProvider(new ModelTypeInstanceProvider<CamundaProperty>() {
public CamundaProperty newInstance(ModelTypeInstanceContext instanceContext) {
return new CamundaPropertyImpl(instanceContext);
}
});
camundaIdAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_ID).namespace(CAMUNDA_NS).build();
camundaNameAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_NAME).namespace(CAMUNDA_NS).build();
camundaValueAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_VALUE).namespace(CAMUNDA_NS).build();
typeBuilder.build();
}
Aggregations