Combine a Service Task and a Receive Task into a single connector or component

In my BPMN diagrams, I often use the combination of a Service Task and Receive Task. Along with the Service Task, I have a JobWorker on Spring Boot where I run an asynchronous task. After this, control immediately passes to the Receive Task, which waits for a message that arrives once the asynchronous task completes.

I’m considering optimizing this process and potentially combining the Service Task and Receive Task both visually and functionally into my domain-specific Camunda Connector or something similar. This way, instead of having two elements on the BPMN diagram, I would only have one element with a properties panel. Could you please advise if this is possible in Camunda 8, and if so, how to correctly combine the Service Task and Receive Task into a single Camunda Connector? Thanks

Hey @Alex3,

First, thanks for your question I hope I can help :slight_smile:

Connectors do not support Receive Task for now, but it’s in our roadmap. I can’t tell you when it’ll be done, but hopefully soon enough.

So, currently, I think you can’t do what you explained.

Feel free to ask if it’s not clear enough,
Jonathan

Hi @jroques Thank you for your response! If not a Connector, are there any other options to achieve this in the current Camunda implementation? Perhaps I can achieve this by implementing a custom UI component in JS BPMN.io or in some other way?

May I ask why you introduced the service task + receive task combo in the first place?
I feel that what you are trying to accomplish is to have a synchronous service task, correct? Why don’t you wait for the message in the worker in that case?

Great question, thank you! Honestly, I don’t know. I was just thinking that blocking a JobWorker, for example, with an infinite loop or until the timeout expires, isn’t good practice in Camunda. That’s why I used a combination of Service Task and Receive Task. My thought was to stay waiting for a certain amount of time(for a week or a month for example) in the JobWorker until the message arrives, but I wasn’t sure if it’s a good practice.