use of org.camunda.bpm.model.bpmn.instance.camunda.CamundaField in project camunda-bpmn-model by camunda.
the class CamundaFieldImpl method registerType.
public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaField.class, CAMUNDA_ELEMENT_FIELD).namespaceUri(CAMUNDA_NS).instanceProvider(new ModelTypeInstanceProvider<CamundaField>() {
public CamundaField newInstance(ModelTypeInstanceContext instanceContext) {
return new CamundaFieldImpl(instanceContext);
}
});
camundaNameAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_NAME).namespace(CAMUNDA_NS).build();
camundaExpressionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_EXPRESSION).namespace(CAMUNDA_NS).build();
camundaStringValueAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_STRING_VALUE).namespace(CAMUNDA_NS).build();
SequenceBuilder sequenceBuilder = typeBuilder.sequence();
camundaExpressionChild = sequenceBuilder.element(CamundaExpression.class).build();
camundaStringChild = sequenceBuilder.element(CamundaString.class).build();
typeBuilder.build();
}
use of org.camunda.bpm.model.bpmn.instance.camunda.CamundaField in project camunda-bpmn-model by camunda.
the class CamundaExtensionsTest method testFieldExtension.
@Test
public void testFieldExtension() {
CamundaField field = sendTask.getExtensionElements().getElementsQuery().filterByType(CamundaField.class).singleResult();
assertThat(field.getCamundaName()).isEqualTo(TEST_STRING_XML);
assertThat(field.getCamundaExpression()).isEqualTo(TEST_EXPRESSION_XML);
assertThat(field.getCamundaStringValue()).isEqualTo(TEST_STRING_XML);
assertThat(field.getCamundaExpressionChild().getTextContent()).isEqualTo(TEST_EXPRESSION_XML);
assertThat(field.getCamundaString().getTextContent()).isEqualTo(TEST_STRING_XML);
field.setCamundaName(TEST_STRING_API);
field.setCamundaExpression(TEST_EXPRESSION_API);
field.setCamundaStringValue(TEST_STRING_API);
field.getCamundaExpressionChild().setTextContent(TEST_EXPRESSION_API);
field.getCamundaString().setTextContent(TEST_STRING_API);
assertThat(field.getCamundaName()).isEqualTo(TEST_STRING_API);
assertThat(field.getCamundaExpression()).isEqualTo(TEST_EXPRESSION_API);
assertThat(field.getCamundaStringValue()).isEqualTo(TEST_STRING_API);
assertThat(field.getCamundaExpressionChild().getTextContent()).isEqualTo(TEST_EXPRESSION_API);
assertThat(field.getCamundaString().getTextContent()).isEqualTo(TEST_STRING_API);
}
use of org.camunda.bpm.model.bpmn.instance.camunda.CamundaField in project camunda-bpmn-model by camunda.
the class CamundaExtensionsTest method testTaskListener.
@Test
public void testTaskListener() {
CamundaTaskListener taskListener = userTask.getExtensionElements().getElementsQuery().filterByType(CamundaTaskListener.class).list().get(0);
assertThat(taskListener.getCamundaEvent()).isEqualTo(TEST_TASK_EVENT_XML);
assertThat(taskListener.getCamundaClass()).isEqualTo(TEST_CLASS_XML);
assertThat(taskListener.getCamundaExpression()).isEqualTo(TEST_EXPRESSION_XML);
assertThat(taskListener.getCamundaDelegateExpression()).isEqualTo(TEST_DELEGATE_EXPRESSION_XML);
taskListener.setCamundaEvent(TEST_TASK_EVENT_API);
taskListener.setCamundaClass(TEST_CLASS_API);
taskListener.setCamundaExpression(TEST_EXPRESSION_API);
taskListener.setCamundaDelegateExpression(TEST_DELEGATE_EXPRESSION_API);
assertThat(taskListener.getCamundaEvent()).isEqualTo(TEST_TASK_EVENT_API);
assertThat(taskListener.getCamundaClass()).isEqualTo(TEST_CLASS_API);
assertThat(taskListener.getCamundaExpression()).isEqualTo(TEST_EXPRESSION_API);
assertThat(taskListener.getCamundaDelegateExpression()).isEqualTo(TEST_DELEGATE_EXPRESSION_API);
CamundaField field = taskListener.getCamundaFields().iterator().next();
assertThat(field.getCamundaName()).isEqualTo(TEST_STRING_XML);
assertThat(field.getCamundaString().getTextContent()).isEqualTo(TEST_STRING_XML);
}
Aggregations