AnsweredAssumed Answered

Deployment Strategy

Question asked by rafaelduqueestrada on Jun 10, 2015
Latest reply on Jun 19, 2015 by rafaelduqueestrada
Hi everyone,
I'm using activiti with spring and I have a dought about which is the best strategy for deployment process definitions.
Currently I'm using automatic deployment like:


@Configuration
public class ActivitiConfiguration {

    @Bean
    public SpringProcessEngineConfiguration processEngineConfiguration(DataSource dataSource,
                                                                       PlatformTransactionManager transactionManager,
                                                                       EntityManagerFactory entityManagerFactory) {
        SpringProcessEngineConfiguration engineConfiguration = new SpringProcessEngineConfiguration();
        engineConfiguration.setDataSource(dataSource);
        engineConfiguration.setTransactionManager(transactionManager);
        engineConfiguration.setJpaEntityManagerFactory(entityManagerFactory);
        engineConfiguration.setHistory(HistoryLevel.FULL.getKey());
        engineConfiguration.setDeploymentResources(deploymentResources());
        engineConfiguration.setDeploymentMode("single-resource");

        return engineConfiguration;
    }

    private Resource[] deploymentResources() {
        Resource[] processResource = new Resource[1];
        processResource[0] = new ClassPathResource("bpm/activiti/XPTOProcess.bpmn20.xml");
        return  processResource;
    }

    @Bean
    public ProcessEngine processEngine(SpringProcessEngineConfiguration springProcessEngineConfiguration,
                                       ApplicationContext applicationContext) throws Exception {
        ProcessEngineFactoryBean processEngineFactoryBean = new ProcessEngineFactoryBean();
        processEngineFactoryBean.setProcessEngineConfiguration(springProcessEngineConfiguration);
        processEngineFactoryBean.setApplicationContext(applicationContext);
        return processEngineFactoryBean.getObject();
    }
}

Every time I run the app in jboss a new version of definition process is created, even if any changes in XPTOProcess.bpmn20.xml.

How the activiti engine works with the differences between versions of definition process? (there is nothing about this in the user guide section 6.3)

Outcomes