cancel
Showing results for 
Search instead for 
Did you mean: 

Changes from 5.0rc1 to 5.0

matias
Champ in-the-making
Champ in-the-making
I was using in 5.0rc1 this code to provide activiti with my implementation of the identity session factory…


ProcessEngineConfiguration conf = new ProcessEngineConfiguration();
Map<Class<?>, SessionFactory> sessionFactories = conf.getSessionFactories();
sessionFactories.put(IdentitySession.class, new MyIdentitySessionFactory());
conf.set…
engine = conf.buildProcessEngine();
return engine;

But I updated to 5.0 and it doesn't work anymore. In 5.0 ProcessEngineConfiguration has no getSessionFactories() method.

How should I implement this functionality?

Thanks!
6 REPLIES 6

matias
Champ in-the-making
Champ in-the-making
I fixed it changing it to

ProcessEngineConfigurationImpl conf = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();

and calling conf.buildProcessEngine() before conf.getSessionFactories().

Hope this is the right way

frederikherema1
Star Contributor
Star Contributor
Mattias,

The ProcessEngineConfiguration allows you to add custom session factories, before it is built:


    ProcessEngineConfigurationImpl configuration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();
   
    // Add your custom session factory
    SessionFactory myFactory = new CustomSessionFactory();
    configuration.setCustomSessionFactories(Arrays.asList(myFactory));
   
    ProcessEngine engine = configuration.buildProcessEngine();

limcheekin
Champ on-the-rise
Champ on-the-rise
Hi there,

I try to integrate Activiti and Spring Security by implement the custom SpringProcessEngineConfiguration and Session Factory. Please see the following code:


package org.grails.activiti.springsecurity;

import org.activiti.spring.SpringProcessEngineConfiguration;
import org.activiti.engine.ProcessEngine;
import java.util.ArrayList;

class SpringSecurityProcessEngineConfiguration extends SpringProcessEngineConfiguration {
public ProcessEngine buildProcessEngine() {
  ArrayList customSessionFactories = new ArrayList(1);
  customSessionFactories.add(new SpringSecurityIdentitySessionFactory());
  setCustomSessionFactories(customSessionFactories);
  return super.buildProcessEngine();
}
}


package org.grails.activiti.springsecurity;

import org.activiti.engine.impl.interceptor.Session;
import org.activiti.engine.impl.interceptor.SessionFactory;

class SpringSecurityIdentitySessionFactory implements SessionFactory {
  
public Class<?> getSessionType() {
  return SpringSecurityIdentitySession.class;
}

public Session openSession() {
  return new SpringSecurityIdentitySession();
}

}

Then, I configure org.grails.activiti.springsecurity.SpringSecurityProcessEngineConfiguration in spring application context to initialize Activiti process engine. Everything seems working fine without any error. But when I run the integration tests of Activiti's identityService, no invocation route to custom SpringSecurityIdentitySession class. Did I missed anything?

Fyi, I am using Activiti 5.3.

Thanks in advance. Wish to hear from you soon!

Best regards,
Chee Kin

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Please post in a new topic…

limcheekin
Champ on-the-rise
Champ on-the-rise
Noted.

Please see the new post here http://forums.activiti.org/en/viewtopic.php?f=6&t=1261

Regards,
Chee Kin

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Thanks Smiley Very Happy
Getting started

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.