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