JBPM4.4会签问题

ixujieyun 2010-12-28
现在又有了新的问题。我是用jbpm4.4建立会签任务,使用
taskService.completeTask(subtask.getId());无法结束子任务。
报错:
3:55:17,218 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.CompleteTaskCmd@19d12cc
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl#10012]
at org.hibernate.impl.SessionFactoryImpl$2.handleEntityNotFound(SessionFactoryImpl.java:409)
at org.hibernate.proxy.AbstractLazyInitializer.checkTargetState(AbstractLazyInitializer.java:108)
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:97)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:140)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190)
at org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl_$$_javassist_34.setEndTime(HistoryTaskInstanceImpl_$$_javassist_34.java)
at org.jbpm.pvm.internal.history.events.TaskComplete.process(TaskComplete.java:52)
at org.jbpm.pvm.internal.history.HistorySessionImpl.process(HistorySessionImpl.java:31)
at org.jbpm.pvm.internal.history.HistoryEvent.fire(HistoryEvent.java:67)
at org.jbpm.pvm.internal.task.TaskImpl.historyTaskComplete(TaskImpl.java:322)
at org.jbpm.pvm.internal.task.TaskImpl.complete(TaskImpl.java:192)
at org.jbpm.pvm.internal.task.TaskImpl.complete(TaskImpl.java:188)
at org.jbpm.pvm.internal.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:67)
at org.jbpm.pvm.internal.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:32)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:40)
at org.jbpm.pvm.internal.svc.TaskServiceImpl.completeTask(TaskServiceImpl.java:88)
at com.zhangrun.custom.Custom.signal(Custom.java:78)
at org.jbpm.pvm.internal.wire.usercode.UserCodeActivityBehaviour.signal(UserCodeActivityBehaviour.java:48)
at org.jbpm.pvm.internal.model.op.Signal.perform(Signal.java:70)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:672)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:632)
at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:430)
at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:61)
at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:35)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:50)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.signalExecutionById(ExecutionServiceImpl.java:97)
at test.develop.main(develop.java:35)
之前在jbpm4.3中是可以正常结束的。请问这是为什么?
sdyjmc 2010-12-30
关注,我也被这个问题困住了.
liufangzhaoly 2010-12-31
我的问题也是这个 不晓得能不能 有人给解答一下
liufangzhaoly 2010-12-31
这个问题 和你在创建这个SUBTASK的时候有关。。 可能是你设置subTask的某些属性时你设置了一些有限制的属性。。。 设成最少的属性后 这个subTask就可以提交了

但是提交后的信息不会被保存到历史实例中去
liufangzhaoly 2010-12-31
sdyjmc 写道
关注,我也被这个问题困住了.

你的报错信息 是什么样的?

我也是到这里提交不了 但是和LZ的报错信息不一样

我的是
13:21:11,203 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.CompleteTaskCmd@17361e2
java.lang.NullPointerException
	at org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl.setEndTime(HistoryActivityInstanceImpl.java:88)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
	at org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl_$$_javassist_34.setEndTime(HistoryTaskInstanceImpl_$$_javassist_34.java)
	at org.jbpm.pvm.internal.history.events.TaskComplete.process(TaskComplete.java:52)
	at org.jbpm.pvm.internal.history.HistorySessionImpl.process(HistorySessionImpl.java:31)
	at org.jbpm.pvm.internal.history.HistoryEvent.fire(HistoryEvent.java:67)
	at org.jbpm.pvm.internal.task.TaskImpl.historyTaskComplete(TaskImpl.java:322)
	at org.jbpm.pvm.internal.task.TaskImpl.complete(TaskImpl.java:192)
	at org.jbpm.pvm.internal.task.TaskImpl.complete(TaskImpl.java:188)
	at org.jbpm.pvm.internal.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:67)
	at org.jbpm.pvm.internal.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:32)
	at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
	at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:40)
	at org.jbpm.pvm.internal.svc.TaskServiceImpl.completeTask(TaskServiceImpl.java:88)
	at com.zhangrun.custom.CustomTest.signal(CustomTest.java:192)
	at org.jbpm.pvm.internal.wire.usercode.UserCodeActivityBehaviour.signal(UserCodeActivityBehaviour.java:48)
	at org.jbpm.pvm.internal.model.op.Signal.perform(Signal.java:70)
	at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:672)
	at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:632)
	at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:430)
	at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:61)
	at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:35)
	at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
	at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:50)
	at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
	at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
	at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)
	at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
	at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.signalExecutionById(ExecutionServiceImpl.java:97)
	at com.net.TestSgin.Sgin.testTake(Sgin.java:67)
	at com.net.TestSgin.Sgin.main(Sgin.java:81)
### EXCEPTION ###########################################
### EXCEPTION ###########################################
vtudiv 2010-12-31
4.4相比4.3在Custom节点execution后新加了对((ExecutionImpl) execution).historyAutomatic()的调用,这将在HistoryActivityInstance表中加一条class为aut的自动历史记录,会造成如果Custom节点产生了Task,则根据execution取得的HistoryTaskInstanceActivity是错误的,因此如果completeTask的参数为一个Custom节点产生的Tas,k需要在completeTask之前做如下操作:
Execution execution=this.getWfService().findExecutionById(task.getExecutionId());
ExecutionImpl executionImpl=(ExecutionImpl)execution;
executionImpl.setHistoryActivityInstanceDbid(executionImpl.getHistoryActivityInstanceDbid()-1);
this.getHibernateTemplate().update(executionImpl);
this.getHibernateTemplate().flush();
(详见UserCodeActivityBehaviour)
liufangzhaoly 2011-01-11
vtudiv 写道
4.4相比4.3在Custom节点execution后新加了对((ExecutionImpl) execution).historyAutomatic()的调用,这将在HistoryActivityInstance表中加一条class为aut的自动历史记录,会造成如果Custom节点产生了Task,则根据execution取得的HistoryTaskInstanceActivity是错误的,因此如果completeTask的参数为一个Custom节点产生的Tas,k需要在completeTask之前做如下操作:
Execution execution=this.getWfService().findExecutionById(task.getExecutionId());
ExecutionImpl executionImpl=(ExecutionImpl)execution;
executionImpl.setHistoryActivityInstanceDbid(executionImpl.getHistoryActivityInstanceDbid()-1);
this.getHibernateTemplate().update(executionImpl);
this.getHibernateTemplate().flush();
(详见UserCodeActivityBehaviour)



能具体说一下你 里面的THIS 代表的是什么 并且你用hibernate的Template 是自己重写的方法吗。。。。
vtudiv 2011-01-11
无所谓this是什么,只要能通过task查到ExecutionImpl;
无所谓hibernate的Template是不是自己重写的,只要把修改后的ExecutionImpl对象更新到数据库;
或者用任何你喜欢的方式在completeTask之前执行update jbpm4_execution set HISACTINST_ = HISACTINST_ - 1 where ID_ =  task.getExecutionId();
------------------------------
这里被complete的Task是Custom节点产生的,否则不需要这么做。
liufangzhaoly 2011-01-12
vtudiv 写道
无所谓this是什么,只要能通过task查到ExecutionImpl;
无所谓hibernate的Template是不是自己重写的,只要把修改后的ExecutionImpl对象更新到数据库;
或者用任何你喜欢的方式在completeTask之前执行update jbpm4_execution set HISACTINST_ = HISACTINST_ - 1 where ID_ =  task.getExecutionId();
------------------------------
这里被complete的Task是Custom节点产生的,否则不需要这么做。


如果我在custom节点上创建一个task任务 然后他下面有一个task1 之间有transition 而 task1 到 task2 有transition 而custom创建的task到task2没有transition,我创建了一个task到task2的transition,然后当我completeTask(task。getid(),task2.getName)的时候 发现它在数据库表里多了一条task2的完成记录,但是task2在代办任务列表里还有一条记录,并且custom创建的task任务没有完成 end的数值为空

而且task2带代办任务列表里还有条记录

求解。。。。。
vtudiv 2011-01-12
跑题了吧?
Global site tag (gtag.js) - Google Analytics