2
無法創建組,錯誤這是我得到我的IdentityService變量的ident調試時:IdentityService jBPM的:在驗證
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-過程中,我有:
<?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不爲空,它包含空對象...
任何想法?
Dámaris。