As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
public class ProcessEnginesServletContextListener implements ServletContextListener { private static final String CONFIG_FILE = "activiti.cfg.xml"; @Override public void contextInitialized(ServletContextEvent arg0) { try { ProcessEngines.init(); } catch(Exception ex) { throw new RuntimeException("Could not initialize process engine in context.", ex); } try { //loads the appropriate workflow process. ProcessEngine processEngine = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource(CONFIG_FILE).buildProcessEngine(); RepositoryService repositoryService = processEngine.getRepositoryService(); final String process01 = "com/bnp/application/wfe/diagrams/newhire.bpmn20.xml"; final String process02 = "com/bnp/application/wfe/diagrams/extendstaff.bpmn20.xml"; DeploymentBuilder deploymentBuilder = repositoryService.createDeployment(); deploymentBuilder.addClasspathResource(process01); deploymentBuilder.addClasspathResource(process02); Deployment deployment = deploymentBuilder.deploy(); } catch(Exception ex) { throw new RuntimeException("Could not load workflow process.", ex); } } @Override public void contextDestroyed(ServletContextEvent arg0) { ProcessEngines.destroy(); } }
.enableDuplicateFiltering()