一:出错场景
BPM4执行taskService.completeTask(taskId,map)或taskService.completeTask(taskId) 操作时,出现如下异常:
2011-3-1 14:57:00 org.jbpm.internal.log.Jdk14Log info
信息: exception while executing command org.jbpm.pvm.internal.cmd.CompositeCmd@19d5db9
org.jbpm.api.JbpmException: No transition named '申请' was found.
No unnamed transitions were found for the task '申请'
这都是没有处理好Jbpm转移引起的问题。
No transition named '申请' was found
是由于一个名为‘申请’的流入转移(或者流出转移)没有定义。
仔细查看xml,是不是写错了。
<transition g="-5,-17" name="申请" to="部门领导审批"/>
No unnamed transitions were found for the task '申请'
是连接'申请'的task任务没有命名的转移被找到
二:问题解决
可以看到核稿,驳回等就是transtion,属于外向转移。
使用taskService.completeTask(taskId)
就会报错。
使用taskService.completeTask(taskId, "error_value")
也会报错。
如果流程走到办公核稿,
taskService.completeTask(taskId, "会签") ;
//or
taskService.completeTask(taskId, "驳回") ;
这才是正确的!
了解Transtion
那么什么Transtion呢?!
Transtion:转移负责将各个活动定义连接起来,组成流程定义。
转移可分为流入转移和流出转移
三:原理分析
如果一个任务拥有一个没用名称的外向转移:
//返回包含一个null值集合,。
taskService.getOutcomes()
//会使用这个外向转移。
taskService.completeTask(taskId)
//会使用这个外向转移。
taskService.completeTask(taskId, null)
//会抛出一个异常。
taskService.completeTask(taskId, "anyvalue")
如果一个任务拥有一个有名字的外向转移:
//返回包含这个转移名称的集合。
taskService.getOutcomes()
// 会使用这个单独的外向转移。
taskService.completeTask(taskId)
//会抛出一个异常(因为这里没有无名称的转移)。
taskService.completeTask(taskId, null)
//会抛出一个异常。
taskService.completeTask(taskId, "anyvalue")
// 会根据给定的名称使用转移。
taskService.completeTask(taskId, "myName")
如果一个任务拥有多个外向转移,其中一个转移没有名称,其他转移都有名称:
//返回包含一个null值和其他转移名称的集合。
taskService.getOutcomes()
//会使用没有名字的转移。
taskService.completeTask(taskId)
//会使用没有名字的转移。
taskService.completeTask(taskId, null)
//会抛出异常。
taskService.completeTask(taskId, "anyvalue")
//会使用名字为'myName'的转移。
taskService.completeTask(taskId, "myName")
如果一个任务拥有多个外向转移,每个转移都拥有唯一的名字:
//返回包含所有转移名称的集合
taskService.getOutcomes()
//会抛出异常,因为这里没有无名称的转移。
taskService.completeTask(taskId)
//会抛出异常,因为这里没有无名称的转移
taskService.completeTask(taskId, null)
//会抛出异常
taskService.completeTask(taskId, "anyvalue")
//会使用名字为'myName'的转移
taskService.completeTask(taskId, "myName")
解决方案:
根据以上分析,可得到解决方案:
1、只拥有一个外向转移时(对应上文所述1、2情况):
Map map = new HashMap();map.put("",……)
//各种参数
taskService.setVariables(taskId,map);
taskService.completeTask(taskId);
3、拥有多个外向转移时(上文3、4种情况):
Map map = new HashMap();map.put("",……)
//各种参数
taskService.setVariables(taskId,map);
//如想转移至有名称的外向转移:
taskService.completeTask(taskId,"外向转移名称");
//如想转移至无名称的外向转移:
taskService.completeTask(taskId);
分享到:
相关推荐
About the examples in this book..............................................................................................xxv Obtaining copies of the examples..........................................
2.4.4 Developing Kernel Applications for VSB Systems ..................................... 21 2.5 VxWorks Without Networking ..............................................................................
Unnamed.mod
unnamed.war
The main reason for making a virtual function inline is to place its definition in the class, either for convenience or to document its behavior, e.g., for accessors and mutators. The -inl.h Files...
About the NTFS Documentation ......................................................................... 1 3. Tables Legend .............................................................................
Unnamed Constructors ............................................................. 12 IDE: Build and Debug ............................................................... 12 Strings......................
A Pocket Guide to the Language, APIs, and Library What You Will Learn Discover what’s new in C# 7.3 and ... Use the new numeric literals found in C# 7.3 to improve readability for numeric constants
jdk 17需要 新增 配置 如下 jvm参数 --add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED --add-opens=java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED
人体关节DICOM原始数据
for (int i = 0; i ; i++) { if (infos[i] != null) { System.out.print(i); System.out.print(" = "); System.out.print(infos[i].getVerbose()); System.out.print(" = "); System.out.println(infos...
...\.......\package cache\unnamed package.dep2 ...\.......\package cache ...\.......\MyShip.class ...\.......\Sprite.class ...\.......\MyMissile.class ...\.......\UFO.class ...\.......
Supports font option for the Document Selector. * Supports 'Sort' button on the Window List. * Supports 'Copy Name' button on the Window List. * Search Document command could omit some words....
node myapp.js unnamed1 unnamed2 在您的代码中: var argv = require('named-argv'); console.log(argv.opts); // opts object contains all named parameters console.log(argv.params); // array, contains ...
Wordpress UnNameDone
073_unnamed.zip 074.jpg 074_imagination.zip 075.jpg 075_UrbanArtist1-0.zi 076.jpg 076_VectorLover1-0.zi 077.jpg 077_KeepItSimple1-0.z 078.jpg 078_FreshMedia1-0.zip 079.jpg 079_EliteCircle1-1.zi 080....
Unnamed-RPG项目的目标是为开发人员创建工具系统,以利用Rolemaster:trade_mark:风格的角色扮演指南的功能和复杂性来创建游戏或软件。
Discover all the new features and changes in Java 9, including module systems―JPMS or Project Jigsaw. This book covers the whole Java application development life cycle. You’ll review all the ...
org.objectweb.lomboz-R-3.2-200610201336