IdentityService jbpm:无法创建组,验证时出错
这是我在 IdentityService 变量 ident 上调试时得到的结果:
ident -> commandService = null
-> commandService = RetryInterceptor(id=68)
在我的 jbpm.cfg.xml 中,我有:
<jbpm-configuration>
...
<import resource="jbpm.identity.cfg.xml" />
...
</jbpm-configuration>
//I tried using my own IdentityService class, but it didn't work...
然后我有一个使用 IdentityService 的类,称为 simpleProcessService,带有 getter 和 setter。
public class SimpleProcessServiceImpl implements SimpleProcessService{
...
private IdentityService identityService;
...
public IdentityService getIdentityService()
{
return identityService;
}
public void setIdentityService(IdentityService identityService)
{
this.identityService = identityService;
}
...
}
在我的 applicationContext-process 中,我有:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
...>
<bean id="transactionManagerJbpm"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactoryJbpm" />
<property name="dataSource" ref="dataSourceJbpm" />
</bean>
<bean id="springHelper" class="org.jbpm.pvm.internal.processengine.SpringHelper">
<property name="jbpmCfg" value="jbpm.cfg.xml"/>
</bean>
<bean id="processEngine" factory-bean="springHelper" factory-method="createProcessEngine" />
<!-- <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />-->
<!-- <bean id="executionService" factory-bean="processEngine" factory-method="getExecutionService" />-->
<!-- <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />-->
<bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" />
....
<bean id="simpleProcessService"
class="com.playence.platform.services.jbpm.impl.SimpleProcessServiceImpl">
<property name="repositoryService" value="#{processEngine.repositoryService}"/>
<property name="executionService" value="#{processEngine.executionService}"/>
<property name="taskService" value="#{processEngine.taskService}"/>
<property name="identityService" value="#{processEngine.IdentityService}"/>
</bean>
...
</beans>
在我的测试文件中,我有:
public void testGroups()
{
SimpleProcessService simpleProcessService =(SimpleProcessService)ctx.getBean("simpleProcessService");
TaskService taskService = simpleProcessService.getTaskService();
IdentityService ident = simpleProcessService.getIdentityService();
final int nTasks = 1;
List<Map<String, Object>> vars= new ArrayList<Map<String, Object>>(nTasks);
System.out.println("executing process");
String processKey = "";
String internalURI = "";
Map<String,Object> x = new HashMap<String,Object>();
ProcessInstance processInstance =null;
List<String> processInstanceIds = new ArrayList<String>();
//Create nTasks for annotation
for(int i = 0; i <nTasks ; i++)
{
processKey = Long.toString(System.currentTimeMillis());
internalURI = "/videos/test"+i+".flv_" + processKey;
x = new HashMap<String,Object>();
x.put("internalURI", internalURI);
x.put("content", "good");
vars.add(i,x);
processInstance = simpleProcessService.startProcess("groups", vars.get(i), processKey);
processInstanceIds.add(processInstance.getId());
}
ident.createGroup("anotacion");
ident.createUser("silver", "johndoe", "John", "Doe");
ident.createMembership("silver", "anotacion");
ident.createUser("david", "joesmoe", "Joe", "Smoe");
ident.createMembership("david", "anotacion");
ident.createUser("blanca", "joesmoe", "Joe", "Smoe");
ident.createMembership("blanca", "anotacion");
....
}
当我尝试创建一个组时抛出异常,似乎虽然 ident 不为空,但它包含空对象...
有什么想法吗?
达马里斯。
This is what I get when debugging at my IdentityService variable ident:
ident -> commandService = null
-> commandService = RetryInterceptor(id=68)
In my jbpm.cfg.xml I have:
<jbpm-configuration>
...
<import resource="jbpm.identity.cfg.xml" />
...
</jbpm-configuration>
//I tried using my own IdentityService class, but it didn't work...
Then I have a class where I use IdentityService, called simpleProcessService, with getter and setter.
public class SimpleProcessServiceImpl implements SimpleProcessService{
...
private IdentityService identityService;
...
public IdentityService getIdentityService()
{
return identityService;
}
public void setIdentityService(IdentityService identityService)
{
this.identityService = identityService;
}
...
}
In my applicationContext-process I have:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
...>
<bean id="transactionManagerJbpm"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactoryJbpm" />
<property name="dataSource" ref="dataSourceJbpm" />
</bean>
<bean id="springHelper" class="org.jbpm.pvm.internal.processengine.SpringHelper">
<property name="jbpmCfg" value="jbpm.cfg.xml"/>
</bean>
<bean id="processEngine" factory-bean="springHelper" factory-method="createProcessEngine" />
<!-- <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />-->
<!-- <bean id="executionService" factory-bean="processEngine" factory-method="getExecutionService" />-->
<!-- <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />-->
<bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" />
....
<bean id="simpleProcessService"
class="com.playence.platform.services.jbpm.impl.SimpleProcessServiceImpl">
<property name="repositoryService" value="#{processEngine.repositoryService}"/>
<property name="executionService" value="#{processEngine.executionService}"/>
<property name="taskService" value="#{processEngine.taskService}"/>
<property name="identityService" value="#{processEngine.IdentityService}"/>
</bean>
...
</beans>
In my test file, I have:
public void testGroups()
{
SimpleProcessService simpleProcessService =(SimpleProcessService)ctx.getBean("simpleProcessService");
TaskService taskService = simpleProcessService.getTaskService();
IdentityService ident = simpleProcessService.getIdentityService();
final int nTasks = 1;
List<Map<String, Object>> vars= new ArrayList<Map<String, Object>>(nTasks);
System.out.println("executing process");
String processKey = "";
String internalURI = "";
Map<String,Object> x = new HashMap<String,Object>();
ProcessInstance processInstance =null;
List<String> processInstanceIds = new ArrayList<String>();
//Create nTasks for annotation
for(int i = 0; i <nTasks ; i++)
{
processKey = Long.toString(System.currentTimeMillis());
internalURI = "/videos/test"+i+".flv_" + processKey;
x = new HashMap<String,Object>();
x.put("internalURI", internalURI);
x.put("content", "good");
vars.add(i,x);
processInstance = simpleProcessService.startProcess("groups", vars.get(i), processKey);
processInstanceIds.add(processInstance.getId());
}
ident.createGroup("anotacion");
ident.createUser("silver", "johndoe", "John", "Doe");
ident.createMembership("silver", "anotacion");
ident.createUser("david", "joesmoe", "Joe", "Smoe");
ident.createMembership("david", "anotacion");
ident.createUser("blanca", "joesmoe", "Joe", "Smoe");
ident.createMembership("blanca", "anotacion");
....
}
The exception is thrown when I try to create a group, it seems that though ident is not null, it contains null objects...
Any ideas?
Dámaris.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我的测试类中,我像这样访问 IdentityService:
在我的 applicationContext-process 中包含此内容:
并实现了一个基本上调用 IdentityService 方法的类 IdentityServiceImpl:
}
在我的 cfg.jpdl.xml 中,我只有这个:
有帮助
我希望它对Dámaris 。
In my test class, I access IdentityService like this:
Having this in my applicationContext-process:
And having implemented a class IdentityServiceImpl that basically calls to IdentityService methods:
}
In my cfg.jpdl.xml I just have this:
I hope it helps
Dámaris.