cancel
Showing results for 
Search instead for 
Did you mean: 

@EnableActiviti in 5.16.4

walterjs
Champ in-the-making
Champ in-the-making
Hi,

I just upgraded from 5.16.3 to 5.16.4 and noticed that the @EnableActiviti annotation is missing. I can't find anything in the docs related to this. Do I need to add a new dependency or is this annotation now not used anymore?

Thanks
Walter
5 REPLIES 5

jbarrez
Star Contributor
Star Contributor
We  (Josh and me) removed it cause it was quite incomplete.

How were you using it?

walterjs
Champ in-the-making
Champ in-the-making
I am using it in a prototype application and it was all working quite nicely for me. I will go back to the manual configuration for now since that is not onerous anyway.

When will it or another spring-boot alternative be reinstated?

jbarrez
Star Contributor
Star Contributor
Ok, i see. The EnableActiviti was written long time ago by Josh (from Spring) when Spring Boot was still in infancy…. but the idea was already there. When we did the Spring Boot overhaul a couple of weeks ago, this class was somewhere in the middle (plus it didn't offer that much: default datasoure + engine + transaction manager + services).

If you like the annotation, you can always clone the 5.16.3 source code and copy it (+the classes that actually handle the logic for it) to your own source, should be no problem.

andreor
Champ in-the-making
Champ in-the-making
Hi Joram, have the same issue.
I want use activiti on spring, without spring-boot.

But if i use activiti-spring:5.21.0 version, the @EnableActiviti annotation is missing like WalterJS said.

If i use activiti-spring:5.15, the class AbstractActivitiConfigurer is missing.

Today in 2016, which is the better way to initialize activiti in Java Configuration without xml.

————————————–
i try to use some like this…


@Bean
    public DataSource inMemoryDataSource() {
        BasicDataSource basicDataSource = new BasicDataSource();
        basicDataSource.setUsername("sa");
        basicDataSource.setUrl("jdbc:h2:mem:activiti");
        basicDataSource.setDefaultAutoCommit(false);
        basicDataSource.setDriverClassName(org.h2.Driver.class.getName());
        basicDataSource.setPassword("");
        return basicDataSource;
    }

    @Bean
    public AbstractActivitiConfigurer abstractActivitiConfigurer() {
     //public AbstractActivitiConfigurer abstractActivitiConfigurer(final EntityManagerFactory entityManagerFactoryBean, final PlatformTransactionManager jpaTransactionManager) {
        return new AbstractActivitiConfigurer() {
            @Override
            public void postProcessSpringProcessEngineConfiguration(SpringProcessEngineConfiguration engine) {
             engine.setDatabaseType("h2");
             engine.setDataSource(inMemoryDataSource());
                engine.setRepositoryService(repositoryService());
                engine.setTaskService(taskService());
                engine.setManagementService(managementService());
                engine.setRuntimeService(runtimeService());
                engine.setHistoryService(historyService());

                Resource[] processResources = new Resource[1] ;
                Resource underwritingQueueProcess = new ClassPathResource("processes/cl.bpmn20.xml");
                processResources[0]=underwritingQueueProcess;
                engine.setDeploymentResources(processResources);

                engine.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
            }
        };
    }

   @Bean
    public RepositoryServiceImpl repositoryService(){
     RepositoryServiceImpl repositoryService = new RepositoryServiceImpl();
     return repositoryService;
    }

    @Bean
    public TaskServiceImpl taskService(){
     TaskServiceImpl taskService = new TaskServiceImpl();
     return taskService;
    }

    @Bean
    public ManagementServiceImpl managementService(){
     ManagementServiceImpl managementService = new ManagementServiceImpl();
     return managementService;
    }

    @Bean
    public RuntimeServiceImpl runtimeService(){
     RuntimeServiceImpl runtimeService = new RuntimeServiceImpl();
     return runtimeService;
    }

    @Bean
    public HistoryServiceImpl historyService(){
     HistoryServiceImpl historyService = new HistoryServiceImpl();
     return historyService;
    }





jbarrez
Star Contributor
Star Contributor
Why do you need @EnableActiviti? I didn't do a lot, except prepping some beans.
You can add all Activiti beans (engine, config, services) in Java config or XML, whatever you fancy.
Add the activiti-spring dependency, and you're good to go. In fact, the REST app does exactly that: https://github.com/Activiti/Activiti/blob/master/modules/activiti-rest/src/test/java/org/activiti/re...
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.