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.
<br>ProcessEngineConfiguration processEngineConfiguration = new ProcessEngineConfiguration();<br>Map<Class< ? >, SessionFactory> sessionFactories = processEngineConfiguration.getSessionFactories();<br>sessionFactories.put(IdentitySession.class, new MyIdentitySessionFactory());<br>ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();<br>
<br>public class MyIdentitySessionFactory implements SessionFactory {<br><br> public Session openSession() {<br> return new MyIdentitySession();<br> }<br><br>}<br>
<br><bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration"> <br> <property name="dataSource" ref="dataSource" /><br> <property name="transactionManager" ref="transactionManager" /> <br> <property name="databaseSchemaUpdate" value="true" /> <br> <property name="jobExecutorActivate" value="false" /><br> <property name="dbCycleUsed" value="true" /><br> <property name="customSessionFactories"><br> <list><br> <bean class="de.hlux.activiti.custom.spring.CustomIdentitySessionFactory"></bean><br> </list><br> </property> <br> </bean><br>
<br>public class CustomIdentitySessionFactory implements SessionFactory {<br><br> public Session openSession() {<br> return (Session) new CustomIdentitySession();<br> }<br><br> public Class<?> getSessionType() {<br> return IdentitySession.class;<br> }<br><br>}<br>
<br>protected void initSqlSessionFactory() {<br> if (sqlSessionFactory==null) {<br> InputStream inputStream = null;<br> try {<br> inputStream = ReflectUtil.getResourceAsStream("org/activiti/db/ibatis/activiti.ibatis.mem.conf.xml");<br><br> // update the jdbc parameters to the configured ones…<br> Environment environment = new Environment("default", transactionFactory, dataSource);<br> Reader reader = new InputStreamReader(inputStream);<br> XMLConfigBuilder parser = new XMLConfigBuilder(reader);<br> Configuration configuration = parser.getConfiguration();<br> configuration.setEnvironment(environment);<br> configuration.getTypeHandlerRegistry().register(VariableType.class, JdbcType.VARCHAR, new IbatisVariableTypeHandler());<br> configuration = parser.parse();<br><br> sqlSessionFactory = new DefaultSqlSessionFactory(configuration);<br><br> } catch (Exception e) {<br> throw new ActivitiException("Error while building ibatis SqlSessionFactory: " + e.getMessage(), e);<br> } finally {<br> IoUtil.closeSilently(inputStream);<br> }<br> }<br> }<br>
<br> dbSqlSessionFactory = new DbSqlSessionFactory();<br> dbSqlSessionFactory.setDatabaseType(databaseType);<br> dbSqlSessionFactory.setIdGenerator(idGenerator);<br> dbSqlSessionFactory.setSqlSessionFactory(sqlSessionFactory);<br> dbSqlSessionFactory.setDbIdentityUsed(isDbIdentityUsed);<br> dbSqlSessionFactory.setDbHistoryUsed(isDbHistoryUsed);<br> dbSqlSessionFactory.setDbCycleUsed(isDbCycleUsed);<br> addSessionFactory(dbSqlSessionFactory);<br>
Is this link still available? I am trying to have a look at the post you linked in connection to this story.