In a BPMN flow, when using REST/SOAP connectors, how should I handle preparing the API body beforehand and updating process variables from the API response?
What is the best practice for managing pre/post-processing steps? Should I:
Use a Call Activity to invoke a subprocess that handles both pre/post steps separately (Fig.1)?
Implement everything within a single Service Task (Fig.2)? (Note: In this approach, it’s not possible to use Camunda REST connectors.)
The limitation with using the Camunda REST connector (Fig.1.1) is that it doesn’t allow for pre-processing (preparing the API body) or post-processing (validating/updating variables from the response) within the same task. That’s why I need a setup like Fig.1.1 with separate steps.
How can I implement this logic inside a single task while still handling pre/post-processing effectively?
The best practice to maintain in regular service task and process through @Jobworker to avoid huge data flow within process and return the required data under output variable for next step payload.
Connector also have limitation on throw bpmn error or delegate the request task to another handler incase of exception.
In my opinion (and it’s just an opinion), this Call Activity is basically what a Connector does. If you’re doing the same type of formatting, calling, returning on a regular basis, then writing your own working and building the templates to make if a custom connector (I can’t remember if you can register custom connectors for SaaS, but the blog post suggests it’s possible)
This makes it easy for your modelers (eg. BA, Business Users) to use your specific company processes in the exact way you want them to