Search in sources :

Example 1 with CamundaConnectorId

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

the class CamundaConnectorIdImpl method registerType.

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

        public CamundaConnectorId newInstance(ModelTypeInstanceContext instanceContext) {
            return new CamundaConnectorIdImpl(instanceContext);
        }
    });
    typeBuilder.build();
}
Also used : CamundaConnectorId(org.camunda.bpm.model.bpmn.instance.camunda.CamundaConnectorId) ModelElementTypeBuilder(org.camunda.bpm.model.xml.type.ModelElementTypeBuilder) ModelTypeInstanceContext(org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)

Example 2 with CamundaConnectorId

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

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