AnsweredAssumed Answered


Question asked by luisalves00 on Apr 13, 2011
Latest reply on Apr 15, 2011 by luisalves00

Trying to integrate Activiti engine on a webapp.

Init the engine - ok
Deployment - getting new version every time I start the server even tough the process is the same.

do you check if the process was modified? or just with Spring?

Spring integration also has a special feature for deploying resources. In the process engine configuration, you can specify a set of resources. When the process engine is created, all those resources will be scanned and deployed. There is filtering in place that prevents duplicate deployments. Only when the resources actually have changed, will new deployments be deployed to the Activiti DB. This makes sense in a lot of use case, where the Spring container is rebooted often (eg testing).

Here is the code…

public final class ContextListener
        implements ServletContextListener {

    private static final Logger logger = Logger.getLogger(ContextListener.class);

    public void contextInitialized(ServletContextEvent event) {
        //context = event.getServletContext();
        try {
            Deployment deployment = ProcessEngines.getDefaultProcessEngine().getRepositoryService().createDeployment().addClasspathResource("org/me/gae/activiti/bpmn/simpleApprove.bpmn20.xml").enableDuplicateFiltering().name("simpleApprove").deploy();
                    "Deployment ID:" + deployment.getId() + " - " + deployment.getName() + " @"  + deployment.getDeploymentTime());
        } catch (Exception e) {
            logger.log(Priority.FATAL, "Couldn't initialize Activiti Engine ", e);

got 8 version so far.

best regards,