欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

用JBPM做OA工作流时抛异常

程序员文章站 2022-05-31 11:31:37
...
今天在用JBPM做OA工作流,提交文档时抛org.jbpm.JbpmException: can't signal token 'null' (4): it is suspended
at org.jbpm.graph.exe.Token.signal(Token.java:181)
at org.jbpm.graph.exe.Token.signal(Token.java:139)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$5cbb31cd.signal(<generated>)
at Jbmp_SubmitDocument5.testSubmitDocument(Jbmp_SubmitDocument5.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

异常,看下数据库JBPM_TOKEN表中的ISSUSPENDED字段的值是TRUE,修改该字段值为FALSE便不报错了,但当把流跳到下一结点时又遇到一样的问题,有什么办法解决?求大神帮助

还有一个问题是获取某个用户的任务列表时获取不到,我又根据Hibernate 发的sql语句查找对应数据库,JBPM_TASKINSTANCE表中无数据,我明明已经将公文和流程互相绑定了,为什么没往数据库中插入数据,互绑的代码如下:
//创建流程实例,并与公文互相绑定
public class Jbpm_CreateProcessInstance4 extends TestCase {
static JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
public void testCreateProcessInstance(){
JbpmContext context = jbpmConfiguration.createJbpmContext();
//获取流程定义
ProcessDefinition definition = (ProcessDefinition) context.getGraphSession().findLatestProcessDefinition("测试流程");

//通过流程定义来创建一个流程实例
ProcessInstance processInstance = new ProcessInstance(definition);
//保存流程实例
context.save(processInstance);

Document doc = (Document)context.getSession().load(Document.class, 1);
System.err.println("document is:"+doc.getCreator());
//绑定流程到公文
processInstance.getContextInstance().createVariable("document", doc.getId());
//绑定公文到流程
doc.setProcessInstanceId(processInstance.getId());


context.close();
}
}

在线等,求大神解救,万分感谢!

相关标签: JBPM OA 工作流