@Before public void setUp() { ds1 = new PoolingDataSource(); ds1.setClassName("bitronix.tm.resource.jdbc.lrc.LrcXADataSource"); ds1.setUniqueName("jdbc/testDS1"); ds1.setMaxPoolSize(5); ds1.setAllowLocalTransactions(true); ds1.getDriverProperties().setProperty("driverClassName", "org.h2.Driver"); ds1.getDriverProperties().setProperty("url", "jdbc:h2:tcp://localhost/JPADroolsFlow"); ds1.getDriverProperties().setProperty("user", "sa"); ds1.getDriverProperties().setProperty("password", ""); // ds1.setUniqueName( "jdbc/testDS1" ); // ds1.setClassName( "org.h2.Driver" ); // ds1.setMaxPoolSize( 3 ); // ds1.setAllowLocalTransactions( true ); // ds1.getDriverProperties().put( "user", // "sa" ); // ds1.getDriverProperties().put( "password", // "" ); // ds1.getDriverProperties().put( "URL", // "jdbc:h2:tcp://localhost/JPADroolsFlow" ); ds1.init(); emf = Persistence.createEntityManagerFactory("org.drools.persistence.jpa"); }
@Before public void setUp() throws Exception { ds1 = new PoolingDataSource(); ds1.setUniqueName("jdbc/testDS1"); ds1.setClassName("org.h2.jdbcx.JdbcDataSource"); ds1.setMaxPoolSize(3); ds1.setAllowLocalTransactions(true); ds1.getDriverProperties().put("user", "sa"); ds1.getDriverProperties().put("password", "sasa"); ds1.getDriverProperties().put("URL", "jdbc:h2:mem:mydb"); ds1.init(); emf = Persistence.createEntityManagerFactory("org.drools.persistence.jpa"); }
protected PoolingDataSource setupPoolingDataSource() { PoolingDataSource pds = new PoolingDataSource(); pds.setUniqueName("jdbc/jbpm-ds"); pds.setClassName("bitronix.tm.resource.jdbc.lrc.LrcXADataSource"); pds.setMaxPoolSize(5); pds.setAllowLocalTransactions(true); pds.getDriverProperties().put("user", "sa"); pds.getDriverProperties().put("password", ""); pds.getDriverProperties().put("url", "jdbc:h2:mem:jbpm-db;MVCC=true"); pds.getDriverProperties().put("driverClassName", "org.h2.Driver"); pds.init(); return pds; }
private void setupDataSource() { if (null != pds) return; pds = new PoolingDataSource(); pds.setUniqueName("java:/accounts-ds"); pds.setClassName("bitronix.tm.resource.jdbc.lrc.LrcXADataSource"); pds.setMaxPoolSize(5); pds.setAllowLocalTransactions(true); pds.getDriverProperties().put("user", "sa"); pds.getDriverProperties().put("password", "sa"); pds.getDriverProperties().put("url", "jdbc:h2:mem://localhost/~/test"); pds.getDriverProperties().put("driverClassName", "org.h2.Driver"); pds.init(); }
@BeforeClass public static void setUp() { ds = new PoolingDataSource(); ds.setUniqueName("jdbc/testDS1"); // NON XA CONFIGS ds.setClassName("org.h2.jdbcx.JdbcDataSource"); ds.setMaxPoolSize(3); ds.setAllowLocalTransactions(true); ds.getDriverProperties().put("user", "sa"); ds.getDriverProperties().put("password", "sasa"); ds.getDriverProperties().put("URL", "jdbc:h2:mem:mydb"); ds.init(); }
@Before public void setup() { Properties dsProps = loadDataSourceProperties(); pds = new PoolingDataSource(); pds.setUniqueName("jdbc/jbpm-ds"); pds.setClassName(dsProps.getProperty("className")); pds.setMaxPoolSize(Integer.parseInt(dsProps.getProperty("maxPoolSize"))); pds.setAllowLocalTransactions( Boolean.parseBoolean(dsProps.getProperty("allowLocalTransactions"))); for (String propertyName : new String[] {"user", "password"}) { pds.getDriverProperties().put(propertyName, dsProps.getProperty(propertyName)); } setDatabaseSpecificDataSourceProperties(pds, dsProps); pds.init(); prepareDb(); props = new Properties(); props.setProperty(DBUserGroupCallbackImpl.DS_JNDI_NAME, "jdbc/jbpm-ds"); props.setProperty( DBUserGroupCallbackImpl.PRINCIPAL_QUERY, "select userId from Users where userId = ?"); props.setProperty( DBUserGroupCallbackImpl.ROLES_QUERY, "select groupId from Groups where groupId = ?"); props.setProperty( DBUserGroupCallbackImpl.USER_ROLES_QUERY, "select groupId from Groups where userId = ?"); }
/** * This method does all of the setup for the test and returns a HashMap containing the persistence * objects that the test might need. * * @param persistenceUnitName The name of the persistence unit used by the test. * @return HashMap<String Object> with persistence objects, such as the EntityManagerFactory and * DataSource */ public static HashMap<String, Object> setupWithPoolingDataSource( final String persistenceUnitName, String dataSourceName, final boolean testMarshalling) { HashMap<String, Object> context = new HashMap<String, Object>(); // set the right jdbc url Properties dsProps = getDatasourceProperties(); String jdbcUrl = dsProps.getProperty("url"); String driverClass = dsProps.getProperty("driverClassName"); determineTestMarshalling(dsProps, testMarshalling); if (TEST_MARSHALLING) { Class<?> testClass = null; StackTraceElement[] ste = Thread.currentThread().getStackTrace(); int i = 1; do { try { testClass = Class.forName(ste[i++].getClassName()); } catch (ClassNotFoundException e) { // do nothing.. } } while (PersistenceUtil.class.equals(testClass) && i < ste.length); assertNotNull("Unable to resolve test class!", testClass); jdbcUrl = initializeTestDb(dsProps, testClass); } boolean startH2TcpServer = false; if (jdbcUrl.matches("jdbc:h2:tcp:.*")) { startH2TcpServer = true; } // Setup the datasource PoolingDataSource ds1 = setupPoolingDataSource(dsProps, dataSourceName, startH2TcpServer); if (driverClass.startsWith("org.h2")) { ds1.getDriverProperties().setProperty("url", jdbcUrl); } ds1.init(); context.put(DATASOURCE, ds1); // Setup persistence EntityManagerFactory emf; if (TEST_MARSHALLING) { Properties overrideProperties = new Properties(); overrideProperties.setProperty("hibernate.connection.url", jdbcUrl); EntityManagerFactory realEmf = Persistence.createEntityManagerFactory(persistenceUnitName, overrideProperties); emf = (EntityManagerFactory) EntityManagerFactoryProxy.newInstance(realEmf); UserTransaction ut = (UserTransaction) UserTransactionProxy.newInstance(realEmf); context.put(TRANSACTION, ut); } else { emf = Persistence.createEntityManagerFactory(persistenceUnitName); } context.put(ENTITY_MANAGER_FACTORY, emf); return context; }
private void loadConfiguration() { InputStream is = null; FileInputStream fis = null; try { fis = new FileInputStream(System.getProperty("user.dir") + "/conf/bpm.properties"); is = new BufferedInputStream(fis); Properties dbProps = new Properties(); dbProps.load(is); guvnorRoot = dbProps.getProperty("guvnor.address"); localBPMPath = dbProps.getProperty("bpmn.path"); String jbpmDs = dbProps.getProperty("jbpm5.ds"); String jbpmClassName = dbProps.getProperty("jbpm5.classname"); int jbpmPoolSize = Integer.parseInt(dbProps.getProperty("jbpm5.poolsize")); boolean jbpmAllowLocalTransactions = "true".equals(dbProps.getProperty("jbpm5.localtransactions")); String jbpmUserName = dbProps.getProperty("jbpm5.user"); String jbpmPassword = dbProps.getProperty("jbpm5.password"); String jbpmURL = dbProps.getProperty("jbpm5.url"); PoolingDataSource jbpmDataSource = new PoolingDataSource(); jbpmDataSource.setUniqueName(jbpmDs); jbpmDataSource.setClassName(jbpmClassName); jbpmDataSource.setMaxPoolSize(jbpmPoolSize); jbpmDataSource.setAllowLocalTransactions(jbpmAllowLocalTransactions); jbpmDataSource.getDriverProperties().put("user", jbpmUserName); jbpmDataSource.getDriverProperties().put("password", jbpmPassword); jbpmDataSource.getDriverProperties().put("URL", jbpmURL); jbpmDataSource.init(); // 配置服务器本地知识库资源 } catch (Exception e) { e.printStackTrace(); } finally { try { if (fis != null) fis.close(); if (is != null) is.close(); } catch (Exception e) { e.printStackTrace(); } } }
protected void onSetUp() throws Exception { ServiceReference kbuilderRef = bundleContext.getServiceReference(KnowledgeBuilderFactoryService.class.getName()); Thread.currentThread() .setContextClassLoader(bundleContext.getService(kbuilderRef).getClass().getClassLoader()); // -- Properties conf = new Properties(); conf.setProperty("mail.smtp.host", "localhost"); conf.setProperty("mail.smtp.port", "2345"); conf.setProperty("from", "*****@*****.**"); conf.setProperty("replyTo", "*****@*****.**"); conf.setProperty("defaultLanguage", "en-UK"); SendIcal.initInstance(conf); if (useJTA) { ds = new PoolingDataSource(); ds.setUniqueName("jdbc/taskDS"); ds.setClassName("bitronix.tm.resource.jdbc.lrc.LrcXADataSource"); ds.setMaxPoolSize(3); ds.setAllowLocalTransactions(true); ds.getDriverProperties().put("user", "sa"); ds.getDriverProperties().put("password", "sasa"); ds.getDriverProperties().put("url", "jdbc:h2:mem:taskDb"); ds.getDriverProperties().put("driverClassName", "org.h2.Driver"); ds.init(); } // Use persistence.xml configuration emfTaskJPA = createEntityManagerFactory(); taskService = new TaskService(emfTaskJPA, SystemEventListenerFactory.getSystemEventListener()); MockUserInfo userInfo = new MockUserInfo(); taskService.setUserinfo(userInfo); users = fillUsersOrGroups("LoadUsers.mvel"); groups = fillUsersOrGroups("LoadGroups.mvel"); taskService.addUsersAndGroups(users, groups); disableUserGroupCallback(); logger = LoggerFactory.getLogger(getClass()); taskSession = taskService.createSession(); }
public void testObjectProperties() throws Exception { pds.close(); pds = new PoolingDataSource(); pds.setUniqueName("pds"); pds.setClassName(MockitoXADataSource.class.getName()); pds.setMinPoolSize(1); pds.setMaxPoolSize(1); pds.getDriverProperties().put("uselessThing", new Object()); pds.init(); }
public static PoolingDataSource setupDataSource() { Properties properties = getProperties(); // create data source PoolingDataSource pds = new PoolingDataSource(); pds.setUniqueName(properties.getProperty("persistence.datasource.name", "jdbc/jbpm-ds")); pds.setClassName("bitronix.tm.resource.jdbc.lrc.LrcXADataSource"); pds.setMaxPoolSize(5); pds.setAllowLocalTransactions(true); pds.getDriverProperties() .put("user", properties.getProperty("persistence.datasource.user", "sa")); pds.getDriverProperties() .put("password", properties.getProperty("persistence.datasource.password", "")); pds.getDriverProperties() .put( "url", properties.getProperty( "persistence.datasource.url", "jdbc:h2:tcp://localhost/~/jbpm-db;MVCC=TRUE")); pds.getDriverProperties() .put( "driverClassName", properties.getProperty("persistence.datasource.driverClassName", "org.h2.Driver")); pds.init(); return pds; }
protected void setUp() throws Exception { Properties conf = new Properties(); conf.setProperty("mail.smtp.host", "localhost"); conf.setProperty("mail.smtp.port", "2345"); conf.setProperty("from", "*****@*****.**"); conf.setProperty("replyTo", "*****@*****.**"); conf.setProperty("defaultLanguage", "en-UK"); SendIcal.initInstance(conf); Properties dsProps = loadDataSourceProperties(); String txType = dsProps.getProperty("txType", "RESOURCE_LOCAL"); if ("RESOURCE_LOCAL".equals(txType)) { useJTA = false; } else if ("JTA".equals(txType)) { useJTA = true; } if (useJTA) { pds = new PoolingDataSource(); pds.setUniqueName("jdbc/taskDS"); pds.setClassName(dsProps.getProperty("className")); pds.setMaxPoolSize(Integer.parseInt(dsProps.getProperty("maxPoolSize"))); pds.setAllowLocalTransactions( Boolean.parseBoolean(dsProps.getProperty("allowLocalTransactions"))); for (String propertyName : new String[] {"user", "password"}) { pds.getDriverProperties().put(propertyName, dsProps.getProperty(propertyName)); } setDatabaseSpecificDataSourceProperties(pds, dsProps); pds.init(); } // Use persistence.xml configuration emf = createEntityManagerFactory(); taskService = new TaskService(emf, SystemEventListenerFactory.getSystemEventListener()); MockUserInfo userInfo = new MockUserInfo(); taskService.setUserinfo(userInfo); users = fillUsersOrGroups("LoadUsers.mvel"); groups = fillUsersOrGroups("LoadGroups.mvel"); taskService.addUsersAndGroups(users, groups); disableUserGroupCallback(); logger = LoggerFactory.getLogger(getClass()); taskSession = taskService.createSession(); }
private static void configureJdbcPool( Map<String, PoolingDataSource> dataSources, Set<ResourceBean> started, Configuration config) throws ConfigurationException { PoolingDataSource ds = new PoolingDataSource(); final String uniqueName = confgureResourceBean(ds, config); for (Configuration child : config.getChildren()) { switch (child.getName()) { case "testQuery": ds.setTestQuery(child.getValue()); break; case "enableJdbc4ConnectionTest": ds.setEnableJdbc4ConnectionTest(child.getValueAsBoolean()); break; case "preparedStatementCacheSize": ds.setPreparedStatementCacheSize(child.getValueAsInteger()); break; case "isolationLevel": ds.setIsolationLevel(child.getValue()); break; case "cursorHoldability": ds.setCursorHoldability(child.getValue()); break; case "localAutoCommit": ds.setLocalAutoCommit(child.getValue()); break; case "driverProperties": configureDriverProperties(ds.getDriverProperties(), child); break; default: if (!RESOURCE_BEAN_PROPERTIES.contains(child.getName())) { throw new ConfigurationException( "unsupported element " + child.getName(), child.getPath(), child.getLocation()); } } } if (config.getAttributeAsBoolean("eager", false)) { ds.init(); started.add(ds); } dataSources.put(uniqueName, ds); }
public static void configure( Map<String, PoolingDataSource> dataSources, String dsName, String dsClass, Properties dsProperties) { bitronix.tm.Configuration btm = TransactionManagerServices.getConfiguration(); setDefaults(btm); btm.setServerId("default"); btm.setLogPart1Filename("target/btm1.tlog"); btm.setLogPart2Filename("target/btm2.tlog"); btm.setDisableJmx(true); PoolingDataSource ds = new PoolingDataSource(); ds.setUniqueName(dsName); ds.setClassName(dsClass); ds.setAllowLocalTransactions(true); ds.setShareTransactionConnections(true); ds.setLocalAutoCommit("false"); ds.setMaxPoolSize(10); ds.getDriverProperties().putAll(dsProperties); dataSources.put(dsName, ds); }
@Before public void setUp() throws Exception { ds = new PoolingDataSource(); ds.setUniqueName("jdbc/testDS1"); // NON XA CONFIGS ds.setClassName("org.h2.jdbcx.JdbcDataSource"); ds.setMaxPoolSize(3); ds.setAllowLocalTransactions(true); ds.getDriverProperties().put("user", "sa"); ds.getDriverProperties().put("password", "sasa"); ds.getDriverProperties().put("URL", "jdbc:h2:mem:mydb"); ds.init(); IOService ioService = new IOServiceNio2WrapperImpl(); EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.domain"); EntityManager em = emf.createEntityManager(); Logger logger = LogManager.getLogManager().getLogger(""); JbpmServicesTransactionManager jbpmJTATransactionManager = new JbpmJTATransactionManager(); JbpmServicesPersistenceManager pm = new JbpmServicesPersistenceManagerImpl(); ((JbpmServicesPersistenceManagerImpl) pm).setEm(em); ((JbpmServicesPersistenceManagerImpl) pm).setTransactionManager(jbpmJTATransactionManager); this.fs = new TestVFSFileServiceImpl(); fs.init(); MVELWorkItemHandlerProducer workItemProducer = new MVELWorkItemHandlerProducer(); workItemProducer.setFs(fs); TestIdentityProvider identityProvider = new TestIdentityProvider(); ServicesAwareAuditEventBuilder auditEventBuilder = new ServicesAwareAuditEventBuilder(); auditEventBuilder.setIdentityProvider(identityProvider); adminDataService = new KnowledgeAdminDataServiceImpl(); ((KnowledgeAdminDataServiceImpl) adminDataService).setPm(pm); bpmn2Service = new BPMN2DataServiceImpl(); ProcessDescriptionRepository repo = new ProcessDescriptionRepository(); ((BPMN2DataServiceImpl) bpmn2Service).setRepository(repo); BPMN2DataServiceSemanticModule semanticModule = new BPMN2DataServiceSemanticModule(); ProcessGetInformationHandler processHandler = new ProcessGetInformationHandler(); processHandler.setRepository(repo); semanticModule.setProcessHandler(processHandler); ProcessGetInputHandler inputHandler = new ProcessGetInputHandler(); inputHandler.setRepository(repo); semanticModule.setProcessInputHandler(inputHandler); GetReusableSubProcessesHandler subProcessHandler = new GetReusableSubProcessesHandler(); subProcessHandler.setRepository(repo); semanticModule.setReusableSubprocessHandler(subProcessHandler); HumanTaskGetInformationHandler taskHandler = new HumanTaskGetInformationHandler(); taskHandler.setRepository(repo); semanticModule.setTaskHandler(taskHandler); semanticModule.init(); ((BPMN2DataServiceImpl) bpmn2Service).setSemanticModule(semanticModule); ((BPMN2DataServiceImpl) bpmn2Service).init(); HumanTaskServiceFactory.setEntityManagerFactory(emf); HumanTaskServiceFactory.setJbpmServicesTransactionManager(jbpmJTATransactionManager); taskService = HumanTaskServiceFactory.newTaskService(); deploymentService = new VFSDeploymentService(); ((VFSDeploymentService) deploymentService).setBpmn2Service(bpmn2Service); ((VFSDeploymentService) deploymentService).setEmf(emf); ((VFSDeploymentService) deploymentService).setFs(fs); ((VFSDeploymentService) deploymentService).setIdentityProvider(identityProvider); ((VFSDeploymentService) deploymentService).setManagerFactory(new RuntimeManagerFactoryImpl()); ((VFSDeploymentService) deploymentService).setPm(pm); }
/** * This sets up a Bitronix PoolingDataSource. * * @return PoolingDataSource that has been set up but _not_ initialized. */ public static PoolingDataSource setupPoolingDataSource( Properties dsProps, String datasourceName, boolean startServer) { PoolingDataSource pds = new PoolingDataSource(); // The name must match what's in the persistence.xml! pds.setUniqueName(datasourceName); pds.setClassName(dsProps.getProperty("className")); pds.setMaxPoolSize(Integer.parseInt(dsProps.getProperty("maxPoolSize"))); pds.setAllowLocalTransactions( Boolean.parseBoolean(dsProps.getProperty("allowLocalTransactions"))); for (String propertyName : new String[] {"user", "password"}) { pds.getDriverProperties().put(propertyName, dsProps.getProperty(propertyName)); } String driverClass = dsProps.getProperty("driverClassName"); if (driverClass.startsWith("org.h2")) { if (startServer) { h2Server.start(); } for (String propertyName : new String[] {"url", "driverClassName"}) { pds.getDriverProperties().put(propertyName, dsProps.getProperty(propertyName)); } } else { pds.setClassName(dsProps.getProperty("className")); if (driverClass.startsWith("oracle")) { pds.getDriverProperties().put("driverType", "thin"); pds.getDriverProperties().put("URL", dsProps.getProperty("url")); } else if (driverClass.startsWith("com.ibm.db2")) { // http://docs.codehaus.org/display/BTM/JdbcXaSupportEvaluation#JdbcXaSupportEvaluation-IBMDB2 pds.getDriverProperties().put("databaseName", dsProps.getProperty("databaseName")); pds.getDriverProperties().put("driverType", "4"); pds.getDriverProperties().put("serverName", dsProps.getProperty("serverName")); pds.getDriverProperties().put("portNumber", dsProps.getProperty("portNumber")); } else if (driverClass.startsWith("com.microsoft")) { for (String propertyName : new String[] {"serverName", "portNumber", "databaseName"}) { pds.getDriverProperties().put(propertyName, dsProps.getProperty(propertyName)); } pds.getDriverProperties().put("URL", dsProps.getProperty("url")); pds.getDriverProperties().put("selectMethod", "cursor"); pds.getDriverProperties().put("InstanceName", "MSSQL01"); } else if (driverClass.startsWith("com.mysql")) { for (String propertyName : new String[] {"databaseName", "serverName", "portNumber", "url"}) { pds.getDriverProperties().put(propertyName, dsProps.getProperty(propertyName)); } } else if (driverClass.startsWith("com.sybase")) { for (String propertyName : new String[] {"databaseName", "portNumber", "serverName"}) { pds.getDriverProperties().put(propertyName, dsProps.getProperty(propertyName)); } pds.getDriverProperties().put("REQUEST_HA_SESSION", "false"); pds.getDriverProperties().put("networkProtocol", "Tds"); } else if (driverClass.startsWith("org.postgresql")) { for (String propertyName : new String[] {"databaseName", "portNumber", "serverName"}) { pds.getDriverProperties().put(propertyName, dsProps.getProperty(propertyName)); } } else { throw new RuntimeException("Unknown driver class: " + driverClass); } } return pds; }
private void setDatabaseSpecificDataSourceProperties(PoolingDataSource pds, Properties dsProps) { String driverClass = dsProps.getProperty("driverClassName"); if (driverClass.startsWith("org.h2")) { for (String propertyName : new String[] {"url", "driverClassName"}) { pds.getDriverProperties().put(propertyName, dsProps.getProperty(propertyName)); } } else { if (driverClass.startsWith("oracle")) { pds.getDriverProperties().put("driverType", "thin"); pds.getDriverProperties().put("URL", dsProps.getProperty("url")); } else if (driverClass.startsWith("com.ibm.db2")) { for (String propertyName : new String[] {"databaseName", "portNumber", "serverName"}) { pds.getDriverProperties().put(propertyName, dsProps.getProperty(propertyName)); } pds.getDriverProperties().put("driverType", "4"); pds.getDriverProperties().put("currentSchema", dsProps.getProperty("defaultSchema")); } else if (driverClass.startsWith("com.microsoft")) { for (String propertyName : new String[] {"serverName", "portNumber", "databaseName"}) { pds.getDriverProperties().put(propertyName, dsProps.getProperty(propertyName)); } pds.getDriverProperties().put("URL", dsProps.getProperty("url")); pds.getDriverProperties().put("selectMethod", "cursor"); pds.getDriverProperties().put("InstanceName", "MSSQL01"); } else if (driverClass.startsWith("com.mysql")) { for (String propertyName : new String[] {"databaseName", "serverName", "portNumber", "url"}) { pds.getDriverProperties().put(propertyName, dsProps.getProperty(propertyName)); } } else if (driverClass.startsWith("com.sybase")) { for (String propertyName : new String[] {"databaseName", "portNumber", "serverName"}) { pds.getDriverProperties().put(propertyName, dsProps.getProperty(propertyName)); } pds.getDriverProperties().put("REQUEST_HA_SESSION", "false"); pds.getDriverProperties().put("networkProtocol", "Tds"); // com.edb is Postgres Plus. } else if (driverClass.startsWith("org.postgresql") || driverClass.startsWith("com.edb")) { for (String propertyName : new String[] {"databaseName", "portNumber", "serverName"}) { pds.getDriverProperties().put(propertyName, dsProps.getProperty(propertyName)); } } else { throw new RuntimeException("Unknown driver class: " + driverClass); } } }
@Before public void setUp() throws Exception { ds = new PoolingDataSource(); ds.setUniqueName("jdbc/testDS1"); // NON XA CONFIGS ds.setClassName("org.h2.jdbcx.JdbcDataSource"); ds.setMaxPoolSize(3); ds.setAllowLocalTransactions(true); ds.getDriverProperties().put("user", "sa"); ds.getDriverProperties().put("password", "sasa"); ds.getDriverProperties().put("URL", "jdbc:h2:mem:mydb"); ds.init(); // Persistence Manager Start Up emf = Persistence.createEntityManagerFactory("org.jbpm.domain"); Logger logger = LogManager.getLogManager().getLogger(""); JbpmServicesTransactionManager jbpmJTATransactionManager = new JbpmJTATransactionManager(); JbpmServicesPersistenceManager pm = new JbpmServicesPersistenceManagerImpl(); // Task Service Start up HumanTaskServiceFactory.setEntityManagerFactory(emf); HumanTaskServiceFactory.setJbpmServicesTransactionManager(jbpmJTATransactionManager); taskService = HumanTaskServiceFactory.newTaskService(); ExternalTaskEventListener externalTaskEventListener = new ExternalTaskEventListener(); externalTaskEventListener.setTaskService(taskService); externalTaskEventListener.setLogger(logger); // Session Manager Start up sessionManager = new SessionManagerImpl(); ((SessionManagerImpl) sessionManager).setPm(pm); BPMN2DataService bpmn2DataService = new BPMN2DataServiceImpl(); ProcessDescriptionRepository repo = new ProcessDescriptionRepository(); ((BPMN2DataServiceImpl) bpmn2DataService).setRepository(repo); BPMN2DataServiceSemanticModule semanticModule = new BPMN2DataServiceSemanticModule(); ProcessGetInformationHandler processHandler = new ProcessGetInformationHandler(); processHandler.setRepository(repo); semanticModule.setProcessHandler(processHandler); ProcessGetInputHandler inputHandler = new ProcessGetInputHandler(); inputHandler.setRepository(repo); semanticModule.setProcessInputHandler(inputHandler); GetReusableSubProcessesHandler subProcessHandler = new GetReusableSubProcessesHandler(); subProcessHandler.setRepository(repo); semanticModule.setReusableSubprocessHandler(subProcessHandler); HumanTaskGetInformationHandler taskHandler = new HumanTaskGetInformationHandler(); taskHandler.setRepository(repo); semanticModule.setTaskHandler(taskHandler); semanticModule.init(); ((BPMN2DataServiceImpl) bpmn2DataService).setSemanticModule(semanticModule); ((BPMN2DataServiceImpl) bpmn2DataService).init(); ((SessionManagerImpl) sessionManager).setBpmn2Service(bpmn2DataService); htWorkItemHandler = new LocalHTWorkItemHandler(); htWorkItemHandler.setSessionManager(sessionManager); htWorkItemHandler.setTaskService(taskService); htWorkItemHandler.setTaskEventListener(externalTaskEventListener); htWorkItemHandler.addSession(ksession); ((SessionManagerImpl) sessionManager).setHTWorkItemHandler(htWorkItemHandler); TestIdentityProvider identityProvider = new TestIdentityProvider(); IdentityAwareAuditEventBuilder auditEventBuilder = new IdentityAwareAuditEventBuilder(); auditEventBuilder.setIdentityProvider(identityProvider); ((SessionManagerImpl) sessionManager).setAuditEventBuilder(auditEventBuilder); CDIRuleAwareProcessEventListener ruleAwareEventListener = new CDIRuleAwareProcessEventListener(); ((SessionManagerImpl) sessionManager).setProcessFactsListener(ruleAwareEventListener); ((SessionManagerImpl) sessionManager).init(); // TEST Start up setTaskService(taskService); setSessionManager(sessionManager); setHandler(htWorkItemHandler); }