Search in sources :

Example 1 with CamundaInputOutput

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;
}
Also used : CamundaInputOutput(org.camunda.bpm.model.bpmn.instance.camunda.CamundaInputOutput) CamundaInputParameter(org.camunda.bpm.model.bpmn.instance.camunda.CamundaInputParameter)

Example 2 with CamundaInputOutput

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();
}
Also used : CamundaInputOutput(org.camunda.bpm.model.bpmn.instance.camunda.CamundaInputOutput) 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 3 with CamundaInputOutput

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");
}
Also used : CamundaOutputParameter(org.camunda.bpm.model.bpmn.instance.camunda.CamundaOutputParameter) CamundaConnector(org.camunda.bpm.model.bpmn.instance.camunda.CamundaConnector) CamundaConnectorId(org.camunda.bpm.model.bpmn.instance.camunda.CamundaConnectorId) CamundaInputOutput(org.camunda.bpm.model.bpmn.instance.camunda.CamundaInputOutput) CamundaInputParameter(org.camunda.bpm.model.bpmn.instance.camunda.CamundaInputParameter) Test(org.junit.Test)

Example 4 with CamundaInputOutput

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);
}
Also used : CamundaInputOutput(org.camunda.bpm.model.bpmn.instance.camunda.CamundaInputOutput) Test(org.junit.Test)

Example 5 with CamundaInputOutput

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");
}
Also used : CamundaOutputParameter(org.camunda.bpm.model.bpmn.instance.camunda.CamundaOutputParameter) CamundaInputOutput(org.camunda.bpm.model.bpmn.instance.camunda.CamundaInputOutput) ArrayList(java.util.ArrayList) CamundaInputParameter(org.camunda.bpm.model.bpmn.instance.camunda.CamundaInputParameter)

Aggregations

CamundaInputOutput (org.camunda.bpm.model.bpmn.instance.camunda.CamundaInputOutput)8 CamundaInputParameter (org.camunda.bpm.model.bpmn.instance.camunda.CamundaInputParameter)4 CamundaOutputParameter (org.camunda.bpm.model.bpmn.instance.camunda.CamundaOutputParameter)4 Test (org.junit.Test)2 ArrayList (java.util.ArrayList)1 CamundaConnector (org.camunda.bpm.model.bpmn.instance.camunda.CamundaConnector)1 CamundaConnectorId (org.camunda.bpm.model.bpmn.instance.camunda.CamundaConnectorId)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