09-20-2011 05:11 AM
11-16-2011 03:55 PM
@Service
class CustomUserManagerFactory implements SessionFactory {
@Autowired
CustomUserManager customUserManager;
public Class<?> getSessionType() {
// original UserManager
return org.activiti.engine.impl.persistence.entity.UserManager.class;
}
public Session openSession() {
// Customized UserManger extended from org.activiti.engine.impl.persistence.entity.UserManager
return customUserManager;
}
}
@Component
public class CustomUserManager extends UserManager {
@Autowired
private UserService userService;
@Override
public UserEntity findUserById(String username) {
Assert.notNull(username, "username must not be null");
com.our.app.model.User user = getUserService().findUserByusername(username);
return toActivitiUser(user);
}
….
}
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="databaseType" value="${activiti.databaseType}" />
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="${activiti.databaseSchemaUpdate}" />
<property name="jobExecutorActivate" value="${activiti.jobExecutorActivate}" />
<property name="customSessionFactories">
<list>
<bean class="com.your.app.CustomUserManagerFactory" />
<bean class="com.your.app.CUstomGroupManagerFactory" />
</list>
</property>
</bean>
11-18-2011 03:20 AM
12-26-2011 11:10 PM
To answer the initial question:It's acceptable for me.
You can use activiti without the internal identity management. So assigning a user task to any "string" is fine and one of the intended ways to use activiti.
Plugging into activiti identity management (as the previous post shows) is necessary if you want users from an external source to be able to log into the activiti explorer.
But if you are just embedding the engine, this is not required.I am confused with the conclusion. So, could you show some sample ? Or more detail description?
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.