Triggering a microservice from the endevent

Hi Team ,

I was able to write and publish a bpmn file with the below end event.But unfortunately when the workflow runs the rest end point given in the endevent is not being triggered .
Please help.

<endEvent id="step6" name="step6">
  <extensionElements>
    <camunda:connector>
      <camunda:connectorId>http-connector</camunda:connectorId>
      <camunda:inputOutput>
        <camunda:inputParameter name="url"/>
        <camunda:inputParameter name="method">http://10.185.53.144:8081/test/</camunda:inputParameter>
        <camunda:inputParameter name="headers">
          <camunda:map>
            <camunda:entry key="Accept">application/json</camunda:entry>
          </camunda:map>
        </camunda:inputParameter>
        <camunda:inputParameter name="payload">
          <camunda:script scriptFormat="Javascript">"{\"runId\":\""+execution.getVariable("runId")+"\"}"</camunda:script>
        </camunda:inputParameter>
      </camunda:inputOutput>
    </camunda:connector>
  </extensionElements>
  <incoming>step3_catch-step6</incoming>
  <incoming>step4_catch-step6</incoming>
  <incoming>step5_catch-step6</incoming>
  <incoming>step2_catch-step6</incoming>
</endEvent>

Hi @Albin_Chandy,

it is not possible to use a connector in a none end event. If you change the type to a message end event then it works.

Best regards,
Philipp

Hi @Philipp_Ossler ,
Do you have any examples from which I can refer.

Thanks and Regards,
Albin

Please have a look at the docs.

It should look like

<endEvent id="step6" name="step6">
  <messageEventDefinition>
    <extensionElements>
      <camunda:connector>
        <!-- ... -->
      </camunda:connector>
   </extensionElements>
  </messageEventDefinition>
</endEvent>
1 Like
<endEvent id="step3" name="step3">
  <incoming>step2_catch-step3</incoming>
  <messageEventDefinition id="messageEventDefinition_f8094ca2-2eec-4419-abad-34d6a1d5dc6c">
    <extensionElements>
      <camunda:connector>
        <camunda:connectorId>http-connector</camunda:connectorId>
        <camunda:inputOutput>
          <camunda:inputParameter name="url"/>
          <camunda:inputParameter name="method">http://10.185.53.144:8081/test/</camunda:inputParameter>
          <camunda:inputParameter name="headers">
            <camunda:map>
              <camunda:entry key="Accept">application/json</camunda:entry>
            </camunda:map>
          </camunda:inputParameter>
          <camunda:inputParameter name="payload">
            <camunda:script scriptFormat="Javascript">"{\"runId\":\""+execution.getVariable("runId")+"\"}"</camunda:script>
          </camunda:inputParameter>
        </camunda:inputOutput>
      </camunda:connector>
    </extensionElements>
  </messageEventDefinition>
</endEvent>

@Philipp_Ossler…I have done the same but it did not trigger the microservice at the end event.
Could you please advice

Thanks and Regards,
Albin

Can you provide a failing test case so that I can reproduce the behavior?

In my test, it works as expected.

1 Like