Use camunda between two services

Hi,
I have a job service and an approval service and I want to use camunda in between this service. I have an approval workflow BPMN whenever a job is created it needs approval from the respected user and this approval is done in approval service based on this we basically decide whether the approval is completed or not.

I am new to camunda I just don’t how to get the approval from the approval service through camunda and then move the process ahead.

Also I am using python external library to get this things done. I have also attached the Approval BPMN for better understanding.

Could you please help me this.approval_workflow

@shankar_mahato your bpmn model serves your use case. Since you’re using python external library make sure that “Approval Task” has the configurations like below:

<bpmn:serviceTask id="Activity_1qettgq" name="Approval Task" camunda:asyncBefore="true" camunda:type="external" camunda:topic="jobService">
      <bpmn:incoming>Flow_0sqw7m2</bpmn:incoming>
      <bpmn:outgoing>Flow_0gnuk9s</bpmn:outgoing>
</bpmn:serviceTask>
  1. From python external library you can subscribe to the topic, fetch the task and complete the task.

     externalTaskService.complete(externalTask, variables);
    
  2. From approval service, you can use a rest api to approve the user task:

    POST /task/{id}/complete
    

    https://docs.camunda.org/manual/7.13/reference/rest/task/post-complete/

<dependency>
  <groupId>org.camunda.bpm.springboot</groupId>
  <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
  <version>{project-version}</version>
</dependency>
1 Like

Thanks, @aravindhrs for the quick response.
Is there any other way through which this thing can be achieved.

@shankar_mahato based on the workload on the service task you can decide whether to use delegate or external pattern in service task. Orchestrating microservices using workflow for just 2 microservices is not a better solution unless if it has its reasonable number of activities or serves the purpose of the requirement

Thanks @aravindhrs