AnsweredAssumed Answered

Invoke external non-transactional services

Question asked by smedina on May 7, 2012
Latest reply on May 7, 2012 by ronald.van.kuijk
Hi, i'm using Activiti v5.9 to implement a process with about 10 subprocess.

The process performs a lot of invocations to external services (non-transactional) that we would like to make asynchronously. We can use a service task with the option activiti:async="true" to commit the process status at the beggining of each invocation, but it starts a new transaction that remains open during the whole execution of the task. The invocation to these external services can take a long time in some cases, so we would like to implement the call with no transaction active.

The option we found to implement this, is to include for each invocation, a service task, that invokes an internal service that stores the invocation request to be processed in background, and a receive task to sleep the process until the invocation is complete.

This solution complicates the process definition by adding this invoke/wait tasks on each external invocation inside our subprocess. I would like to know if there is a way to "compose" these two activities (service task / receive task) in a new custom task, to simplify our process, avoiding the overhead of defining and calling a new subprocess to do this.

Thanks in advance,
Santiago Medina.

Outcomes