use of org.camunda.bpm.model.bpmn.instance.camunda.CamundaInputOutput in project camunda-bpmn-model by camunda.
the class AbstractEventBuilder method camundaInputParameter.
/**
* Creates a new camunda input parameter extension element with the
* given name and value.
*
* @param name the name of the input parameter
* @param value the value of the input parameter
* @return the builder object
*/
public B camundaInputParameter(String name, String value) {
CamundaInputOutput camundaInputOutput = getCreateSingleExtensionElement(CamundaInputOutput.class);
CamundaInputParameter camundaInputParameter = createChild(camundaInputOutput, CamundaInputParameter.class);
camundaInputParameter.setCamundaName(name);
camundaInputParameter.setTextContent(value);
return myself;
}
use of org.camunda.bpm.model.bpmn.instance.camunda.CamundaInputOutput in project camunda-bpmn-model by camunda.
the class CamundaInputOutputImpl method registerType.
public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaInputOutput.class, CAMUNDA_ELEMENT_INPUT_OUTPUT).namespaceUri(CAMUNDA_NS).instanceProvider(new ModelTypeInstanceProvider<CamundaInputOutput>() {
public CamundaInputOutput newInstance(ModelTypeInstanceContext instanceContext) {
return new CamundaInputOutputImpl(instanceContext);
}
});
SequenceBuilder sequenceBuilder = typeBuilder.sequence();
camundaInputParameterCollection = sequenceBuilder.elementCollection(CamundaInputParameter.class).build();
camundaOutputParameterCollection = sequenceBuilder.elementCollection(CamundaOutputParameter.class).build();
typeBuilder.build();
}
use of org.camunda.bpm.model.bpmn.instance.camunda.CamundaInputOutput in project camunda-bpmn-model by camunda.
the class CamundaExtensionsTest method testCamundaConnector.
@Test
public void testCamundaConnector() {
CamundaConnector camundaConnector = serviceTask.getExtensionElements().getElementsQuery().filterByType(CamundaConnector.class).singleResult();
assertThat(camundaConnector).isNotNull();
CamundaConnectorId camundaConnectorId = camundaConnector.getCamundaConnectorId();
assertThat(camundaConnectorId).isNotNull();
assertThat(camundaConnectorId.getTextContent()).isEqualTo("soap-http-connector");
CamundaInputOutput camundaInputOutput = camundaConnector.getCamundaInputOutput();
Collection<CamundaInputParameter> inputParameters = camundaInputOutput.getCamundaInputParameters();
assertThat(inputParameters).hasSize(1);
CamundaInputParameter inputParameter = inputParameters.iterator().next();
assertThat(inputParameter.getCamundaName()).isEqualTo("endpointUrl");
assertThat(inputParameter.getTextContent()).isEqualTo("http://example.com/webservice");
Collection<CamundaOutputParameter> outputParameters = camundaInputOutput.getCamundaOutputParameters();
assertThat(outputParameters).hasSize(1);
CamundaOutputParameter outputParameter = outputParameters.iterator().next();
assertThat(outputParameter.getCamundaName()).isEqualTo("result");
assertThat(outputParameter.getTextContent()).isEqualTo("output");
}
use of org.camunda.bpm.model.bpmn.instance.camunda.CamundaInputOutput in project camunda-bpmn-model by camunda.
the class CamundaExtensionsTest method testCamundaInputOutput.
@Test
public void testCamundaInputOutput() {
CamundaInputOutput camundaInputOutput = serviceTask.getExtensionElements().getElementsQuery().filterByType(CamundaInputOutput.class).singleResult();
assertThat(camundaInputOutput).isNotNull();
assertThat(camundaInputOutput.getCamundaInputParameters()).hasSize(6);
assertThat(camundaInputOutput.getCamundaOutputParameters()).hasSize(1);
}
use of org.camunda.bpm.model.bpmn.instance.camunda.CamundaInputOutput in project camunda-bpmn-model by camunda.
the class ProcessBuilderTest method assertCamundaInputOutputParameter.
protected void assertCamundaInputOutputParameter(BaseElement element) {
CamundaInputOutput camundaInputOutput = element.getExtensionElements().getElementsQuery().filterByType(CamundaInputOutput.class).singleResult();
assertThat(camundaInputOutput).isNotNull();
List<CamundaInputParameter> camundaInputParameters = new ArrayList<CamundaInputParameter>(camundaInputOutput.getCamundaInputParameters());
assertThat(camundaInputParameters).hasSize(2);
CamundaInputParameter camundaInputParameter = camundaInputParameters.get(0);
assertThat(camundaInputParameter.getCamundaName()).isEqualTo("foo");
assertThat(camundaInputParameter.getTextContent()).isEqualTo("bar");
camundaInputParameter = camundaInputParameters.get(1);
assertThat(camundaInputParameter.getCamundaName()).isEqualTo("yoo");
assertThat(camundaInputParameter.getTextContent()).isEqualTo("hoo");
List<CamundaOutputParameter> camundaOutputParameters = new ArrayList<CamundaOutputParameter>(camundaInputOutput.getCamundaOutputParameters());
assertThat(camundaOutputParameters).hasSize(2);
CamundaOutputParameter camundaOutputParameter = camundaOutputParameters.get(0);
assertThat(camundaOutputParameter.getCamundaName()).isEqualTo("one");
assertThat(camundaOutputParameter.getTextContent()).isEqualTo("two");
camundaOutputParameter = camundaOutputParameters.get(1);
assertThat(camundaOutputParameter.getCamundaName()).isEqualTo("three");
assertThat(camundaOutputParameter.getTextContent()).isEqualTo("four");
}
Aggregations