M
M
MaxLich2018-10-30 11:18:32
Java
MaxLich, 2018-10-30 11:18:32

Why don't timer boundary events work for me in Alfresco's Activiti 6?

Hello. Our company uses Alfresco's Activiti 6, and we need to add timer boundary events to the bpm-scheme. I've tried everything, and I can't seem to get it to work. An example of my bpm-scheme:
5bd813357d036479837095.png
If I put something after the timer, then the process goes along its usual route. If I do not put anything, it goes along the branch coming from the timer. At the same time, it doesn’t matter what time interval the timer has: the process goes along one or the other branch immediately.
To create objects to work with the Activity engine, I use Spring 5. Here is part of my configuration class:

@Bean
        SpringProcessEngineConfiguration processEngineConfiguration(@Qualifier("dataSourceForActiviti") DataSource dataSourceForActiviti,
                                                                    @Qualifier("transactionManagerForActiviti") PlatformTransactionManager transactionManagerForActiviti) {
            SpringProcessEngineConfiguration processEngineConfiguration = new SpringProcessEngineConfiguration();
            processEngineConfiguration.setTransactionManager(transactionManagerForActiviti);
    
            processEngineConfiguration.setDataSource(dataSourceForActiviti)
                    .setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE)
                    .setAsyncExecutorActivate(true)
            ;
    
            processEngineConfiguration.setDeploymentResources(new Resource[]{
                    new ClassPathResource("bpm/LicensingProcess.bpmn20.xml"),
                    new ClassPathResource("bpm/ReissuanceLicenseProcess.bpmn20.xml"),
                    new ClassPathResource("bpm/IssueOfDuplicateProcess.bpmn20.xml"),
                    new ClassPathResource("bpm/IssuanceOfCopyProcess.bpmn20.xml"),
                    new ClassPathResource("bpm/TerminationOfLicenseProcess.bpmn20.xml"),
                    new ClassPathResource("bpm/ExtractFromRegisterOfLicensesProcess.bpmn20.xml")
            });
    
    
            return processEngineConfiguration;
        }
    
        @Bean
        ProcessEngineFactoryBean processEngineFactoryBean(SpringProcessEngineConfiguration processEngineConfiguration) {
            ProcessEngineFactoryBean processEngineFactoryBean = new ProcessEngineFactoryBean();
            processEngineFactoryBean.setProcessEngineConfiguration(processEngineConfiguration);
            return processEngineFactoryBean;
        }
    
        @Bean
        RepositoryService repositoryService(ProcessEngineFactoryBean processEngineFactoryBean) throws Exception {
            return processEngineFactoryBean.getObject().getRepositoryService();
        }
    
        @Bean
        RuntimeService runtimeService(ProcessEngineFactoryBean processEngineFactoryBean) throws Exception {
            return processEngineFactoryBean.getObject().getRuntimeService();
        }
    
        @Bean
        TaskService taskService(ProcessEngineFactoryBean processEngineFactoryBean) throws Exception {
            return processEngineFactoryBean.getObject().getTaskService();
        }

The documentation says that timers only work if asyncExecutorActivateset to true. And I found a method setAsyncExecutorActivatein ProcessEngineConfiguration. But using this method does nothing.
Also found this solution on the net:
// Async Job Executor
    final DefaultAsyncJobExecutor asyncExecutor = new DefaultAsyncJobExecutor();
    asyncExecutor.setMaxPoolSize(50);
    asyncExecutor.setQueueSize(100);
    processEngineConfiguration.setAsyncExecutor(asyncExecutor);

But it doesn’t help me either, although asyncExecutorafter that it doesn’t anymore null.
PSS At the same time, this scheme works great in Activiti Modeler. And I can't figure it out yet, that's why it works well there and doesn't work for me.
PSSS Wrote a simple application without a spring (on a swing). Used the class StandaloneProcessEngineConfiguration, did not use the ProcessEngineBeanFactoryBean. And everything worked too. But only so far after the boundary timer there is no script task or service task. It does not work with them (the first one does not find the groove engine, the second one does not see the specified class (and I indicate the full name of the class, and it is definitely there)). If after the boundary timer there is a user task or a manual task, then everything works fine. Why it doesn’t work with script task and service task, I still don’t understand. It remains to try with classes SpringProcessEngineConfigurationandProcessEngineBeanFactoryBean, and with a container of spring beans.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question