jbpm方面,我是一个新手,最近老报Cannot find property manager 这个异常,可是程序中,我没有定义manager这个属性,还希望各位大侠帮帮忙。谢谢。。。。
jpdl.xml代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<process key="leave" name="leave" xmlns="http://jbpm.org/4.3/jpdl">
<start g="201,14,48,48" name="开始">
<transition g="-42,-10" name="请假" to="填写请假单"/>
</start>
<task assignee="writerForm" g="178,87,92,52" name="填写请假单">
<transition g="-97,2" name="判断是不是经理" to="是不是经理"/>
</task>
<decision expr="#{isorno}" g="204,158,48,48" name="是不是经理">
<transition g="-23,-11" name="否" to="经理审核"/>
<transition g="14,-11" name="是" to="老板审批"/>
</decision>
<task assignee="#{username}" g="103,252,92,52" name="经理审核">
<transition g="150,450:10,-21" name="经理批准" to="结束"/>
<transition g="-22,-22" name="请假天数>5" to="老板审批"/>
<transition g="-61,-1" name="经理不批准" to="终止"/>
<transition g="149,114:-55,82" name="经理驳回" to="填写请假单"/>
</task>
<!-- 这里只有一个老板,所以写死了,如果有多个老板,写法同上,业务就会改变 -->
<task assignee="张杰" g="278,251,92,52" name="老板审批">
<transition g="326,450:-58,-24" name="老板批准" to="结束"/>
<transition g="7,0" name="老板不批准" to="终止"/>
<transition g="323,114:13,61" name="老板驳回" to="填写请假单"/>
</task>
<end g="219,429,48,48" name="结束" state="confirm"/>
<end g="220,360,48,48" name="终止" state="dissent"/>
</process>
//红色部分,为报错的地方
public void applyLeave(String leaveId, String position) {
Map<String, Object> variables = new HashMap<String, Object>();//流程中要用到的变量信息
variables.put("leaveId",leaveId);//存放该实例的请假单
if("0".equals(position)){//如果是员工请假
variables.put("isorno", "否");
variables.put("username","胡杰");//指定一个经理进行审批,
}else if("1".equals(position)){//如果是经理请假
variables.put("isorno", "是");
variables.put("username", "张杰");
//只有一个boos,所以在xml中指定了,在此就不用指定了
}
//此时就获取到了该请假单的id
//通过该leaveId来绑定一个流程实例
ProcessInstance processInstance = jbpmTemplate.addProcessInstance("leave",variables, leaveId);
//该表单到时候是在web页面进行申请时填写好的
System.out.println("请假单已填写:" + processInstance.isActive("填写请假单"));
String taskId = jbpmTemplate.findPersonalTasks("writerForm").get(0).getId();
//让任务向下流转,提交任务
jbpmTemplate.completeTask(taskId);
//修改请假单的状态
Leave leave = leaveDao.findbyIdLeave(leaveId);
leave.setStatus("审核中");
leaveDao.update(leave);
}
//报错
Struts Problem Report
Struts has detected an unhandled exception:
Messages: Cannot find property manager
javax.el.PropertyNotFoundException: Cannot find property manager
script evaluation error: javax.el.PropertyNotFoundException: Cannot find property manager
File: de/odysseus/el/util/SimpleResolver.java
Line number: 106
--------------------------------------------------------------------------------
Stacktraces
org.jbpm.api.JbpmException: script evaluation error: javax.el.PropertyNotFoundException: Cannot find property manager
org.jbpm.pvm.internal.script.ScriptManager.evaluate(ScriptManager.java:130)
org.jbpm.pvm.internal.script.ScriptManager.evaluate(ScriptManager.java:118)
org.jbpm.pvm.internal.script.ScriptManager.evaluateExpression(ScriptManager.java:90)
org.jbpm.jpdl.internal.activity.DecisionExpressionActivity.execute(DecisionExpressionActivity.java:50)
org.jbpm.jpdl.internal.activity.DecisionExpressionActivity.execute(DecisionExpressionActivity.java:42)
org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:656)
org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:616)
org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:417)
org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:403)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)