AnsweredAssumed Answered

Activiti controlling the transactions

Question asked by on Dec 12, 2018
Latest reply on Dec 21, 2018 by pault



I am using Activiti as our Business process orchestrator and I am running into an issue with transaction management. Here is the scenario:


1. Using Activiti 6 with Spring Boot (2.1.0)

2. Starting the process by RunTimeService

3. Using Service Task to perform business logic (my service task class is implementing JavaDelegate interface)

4. Running the process in Asynchronous mode (first service task is configured as Asynchronous)

5. Configured two different databases for Activiti and my Transactional system

public class ActivitiConfiguration extends AbstractProcessEngineAutoConfiguration {
    @ConfigurationProperties(prefix = "activiti.datasource")
    public DataSource activitiDataSource() {
          DataSource datasource = DataSourceBuilder.create().build();
        return datasource;

    public SpringProcessEngineConfiguration springProcessEngineConfiguration(
            PlatformTransactionManager transactionManager,
            SpringAsyncExecutor springAsyncExecutor) throws IOException {

         SpringProcessEngineConfiguration config = baseSpringProcessEngineConfiguration(
        return config;


The issue I am facing is, the database operations I am performing in the Service Task classes (using Spring Data JPA) is not getting committed until the whole process is completed. Some times I am even not seeing the data committed to transnational database.


Following are the things I have tried but did not work:

1. Annotated the service method with @Transactional(propagation = Propagation.REQUIRES_NEW)


    private EntityManager entityManager;




Any help would be really appreciated.