06-13-2011 11:49 AM
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();
}
}
06-13-2011 12:37 PM
.enableDuplicateFiltering()
flag to the deployment builder?
06-14-2011 03:31 AM
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.