Search in sources :

Example 1 with CamundaConnector

use of org.camunda.bpm.model.bpmn.instance.camunda.CamundaConnector in project camunda-bpmn-model by camunda.

the class CamundaConnectorImpl method registerType.

public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaConnector.class, CAMUNDA_ELEMENT_CONNECTOR).namespaceUri(CAMUNDA_NS).instanceProvider(new ModelTypeInstanceProvider<CamundaConnector>() {

        public CamundaConnector newInstance(ModelTypeInstanceContext instanceContext) {
            return new CamundaConnectorImpl(instanceContext);
        }
    });
    SequenceBuilder sequenceBuilder = typeBuilder.sequence();
    camundaConnectorIdChild = sequenceBuilder.element(CamundaConnectorId.class).required().build();
    camundaInputOutputChild = sequenceBuilder.element(CamundaInputOutput.class).build();
    typeBuilder.build();
}
Also used : CamundaConnector(org.camunda.bpm.model.bpmn.instance.camunda.CamundaConnector) CamundaConnectorId(org.camunda.bpm.model.bpmn.instance.camunda.CamundaConnectorId) 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 2 with CamundaConnector

use of org.camunda.bpm.model.bpmn.instance.camunda.CamundaConnector 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)

Aggregations

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