[JBoss jBPM] - problem loading a persisted processInstance. The data obtein
by martin84
hi, i have a problem with jbpm when i am trying to load a workflow which is persisted in the db (postgres).
When I obtain from the database the processInstance that I want to continue executing, inside of the rootToken atribute, all the atributes are null.
In fact, when execute the signal method to this state, an error listed in the button of the message is obtained.
this code is the method where the processInstance is persisted on the db
| public ProcessInstance saveProcessInstance(String workFlowId, long dProcessInstance,ContextSolver context) {
| try{ if (jbpmContext!= null && jbpmContext.getSession().isOpen())
| jbpmContext.close();
| }catch (Exception e)
| { e.printStackTrace(); }
| jbpmConfiguration = JbpmConfiguration.getInstance();
| jbpmContext = jbpmConfiguration.createJbpmContext();
| ProcessDefinition processDefinition = repository.getWorkflows().get(workFlowId).getProcessDefinition();
| try {
| GraphSession graphSession = jbpmContext.getGraphSession();
| processDefinition = graphSession.findLatestProcessDefinition(workFlowId);
|
| if (processDefinition==null){
| processDefinition=repository.getWorkflows().get(workFlowId).getProcessDefinition();
| jbpmContext.deployProcessDefinition(processDefinition);
| }
|
| Map mapa=processDefinition.getDefinitions();
| ProcessInstance processInstance=jbpmContext.newProcessInstance(processDefinition.getName());
| //add the context variables processInstance.getContextInstance().addVariables(context.getVariables());
|
|
| processInstance.getTaskMgmtInstance().createTaskInstance();
|
|
| long processInstanceId = processInstance.getId();
|
|
|
| if (processDefinition != null){
| processInstance = jbpmContext.loadProcessInstance(processInstanceId);
| }
|
|
| return processInstance;
| } finally {
| jbpmContext.close();
| }
| }
|
|
|
this code is the method where i get the persisted workflow of the db
|
| public FBActionResult reloadPending(long id_instance,String workFlowId,String layout,String coreResultCode,FBSessionInfo sessionInfo){
| try {
| if (jbpmContext!= null && jbpmContext.getSession().isOpen())
| jbpmContext.close(); }
| catch (Exception e) {
| e.printStackTrace(); }
|
|
| ProcessDefinition processDefinition;
| jbpmConfiguration = JbpmConfiguration.getInstance();
| jbpmContext = jbpmConfiguration.createJbpmContext();
|
| try {
| GraphSession graphSession = jbpmContext.getGraphSession();
| processDefinition = graphSession.findLatestProcessDefinition(workFlowId);
|
| ProcessInstance processInstance = jbpmContext.getProcessInstance(id_instance);
| this.processInstance=processInstance;
|
|
| this.processInstance.setProcessDefinition(processDefinition);
| Map result =processInstance.getContextInstance().getVariables();
|
| ContextSolver context = new ContextSolver(result);
|
| State estado = getRepository().getWorkflowOnDemand(workFlowId).getState(layout);
|
|
| String nextLayoutId;
| nextLayoutId = estado.getLayout();
|
| WorkFlowState nextWorkFlowState = new WorkFlowState(workFlowId,
| nextLayoutId, nextLayoutId);
|
| return new FBActionResult(coreResultCode, context.getVariables(), nextWorkFlowState);
|
| } finally {
|
| jbpmContext.close();
| }
| }
|
When i execute processInstance.signal(estado); over the process instance obtained in reloadPending method, where estado is a transition of the corresponding state, the following error is displayed:
|
| org.jbpm.JbpmException: couldn't signal token 'Token(/)' : node 'StartState(start)' doesn't have a transition 'nextState'
| at org.jbpm.graph.exe.Token.signal(Token.java:139)
| at org.jbpm.graph.exe.Token$$FastClassByCGLIB$$74df1c6e.invoke(<generated>)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:161)
| at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$6080eb93.signal(<generated>)
| at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:229)
| at com.modhelus.fastbranch.server.FBServer.executeAction(FBServer.java:426)
| at com.modhelus.fastbranch.server.socketserver.ExecuteActionFBCommandResolver.execute(ExecuteActionFBCommandResolver.java:36)
| at com.modhelus.fastbranch.server.socketserver.FBServerSession.processRequest(FBServerSession.java:190)
| at com.modhelus.fastbranch.server.socketserver.FBServerSession.run(FBServerSession.java:136)
| at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
| at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
| at java.lang.Thread.run(Thread.java:595)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136417#4136417
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136417
18 years, 1 month
[JBossCache] - TreeMap
by tfranconville
What about TreeMap and Jboss cache
I use JBoss 4.2.1 GA.
I would like to share a TreeMap between node of a jboss cluster.
What can I do to have that kind of use ?
* an other version of Jboss Cache than the 1.4.1
* doing an aop wrapper on treemap
* using terracotta
Here is the error that I obtain using the subMap method:
| Caused by: java.lang.RuntimeException: CollectionInterceptorUtil.invoke(): targetObject is null. Can't invoke public java.util.SortedMap AOPClassProxy$3.subMap(java.lang.Object,java.lang.Object)
| at org.jboss.cache.aop.collection.CollectionInterceptorUtil.invoke(CollectionInterceptorUtil.java:136)
| at org.jboss.cache.aop.collection.CachedMapInterceptor.invoke(CachedMapInterceptor.java:117)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at AOPClassProxy$3.subMap(AOPClassProxy$3.java)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136404#4136404
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136404
18 years, 1 month