Activiti6通过覆盖标准SessionFactory自定义身份管理不使用?

时间:2018-02-01 03:25:50

标签: java workflow activiti

当我使用activit6时,我是初学者,我按照下面的代码

<bean id="processEngineConfiguration" class="...SomeProcessEngineConfigurationClass">

...

<property name="customSessionFactories">
    <list>
        <bean class="com.mycompany.MyGroupManagerFactory"/>
        <bean class="com.mycompany.MyUserManagerFactory"/>
    </list>
</property>

...

public class MyCompanyGroupManager extends GroupEntityManager {

private static Logger log = LoggerFactory.getLogger(MyCompanyGroupManager.class);

@Override
public List<Group> findGroupsByUser(String userId) {
    log.debug("findGroupByUser called with userId: " + userId);
    return super.findGroupsByUser(userId);
}

@Override
public List<Group> findGroupByQueryCriteria(GroupQueryImpl query, Page page) {
    log.debug("findGroupByQueryCriteria called, query: " + query + " page: " + page);
    return super.findGroupByQueryCriteria(query, page);
}

@Override
public long findGroupCountByQueryCriteria(GroupQueryImpl query) {
    log.debug("findGroupCountByQueryCriteria called, query: " + query);
    return super.findGroupCountByQueryCriteria(query);
}

@Override
public Group createNewGroup(String groupId) {
    throw new UnsupportedOperationException();
}

@Override
public void deleteGroup(String groupId) {
    throw new UnsupportedOperationException();
}

}

但我发现某些API无效,例如GroupIdentityManager类不存在。除GroupEntityManager更新界面外,我应该如何实现自定义身份管理?非常感谢

1 个答案:

答案 0 :(得分:0)

我在github

中找到了答案

解决方案如下:

  1. 实施GroupDataManager界面。或者,扩展MybatisGroupDataManager.class

  2. ProcessEngineConfigurationImpl.setGroupDataManager(GroupDataManager groupDataManager)