﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-kxbin-文章分类-流程引擎</title><link>http://www.blogjava.net/kxbin/category/51680.html</link><description>创出一片天地</description><language>zh-cn</language><lastBuildDate>Sat, 19 May 2012 20:33:38 GMT</lastBuildDate><pubDate>Sat, 19 May 2012 20:33:38 GMT</pubDate><ttl>60</ttl><item><title>jbpm4.3标签的学习</title><link>http://www.blogjava.net/kxbin/articles/378451.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Thu, 17 May 2012 16:09:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/378451.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/378451.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/378451.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/378451.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/378451.html</trackback:ping><description><![CDATA[<div>活动标签</div><div></div><div>-控制流程的活动</div><div>-原子活动</div><div>&nbsp;</div><div>控制流程的活动</div><div>Start &nbsp; 开始节点，一个（主）流程只能有一个开始节点</div><div>End &nbsp; &nbsp; 结束节点，一个流程可以有多个结束节点</div><div>Decision 条件判断节点，当一个流程出现多个分支（情况），而分支排他时使用。</div><div>Fork &nbsp; &nbsp;分支节点，当一个流程出现多个分支，而分支并列执行时使用。</div><div>Join &nbsp; &nbsp;聚合/联合节点，通常与fork节点一起使用。</div><div>Sub-process 子流程（本人未曾使用过）</div><div>State &nbsp; 状态节点 &nbsp; &nbsp;一个暂停节点，当需要对流程的执行进行控制时使用。</div><div>Task &nbsp; &nbsp;任务节点，通常与form表单关联，主要是在流程实例经过活动时为某一人或</div><div></div><div>组指派任务</div><div>&nbsp;</div><div>原子活动</div><div>Java、Script、Sql、Hql、Email</div><div>&nbsp;</div><div>&nbsp;</div><div>下面介绍三个最常用的活动</div><div>state</div><div></div><div>一个强制流程暂停的节点，当需要对流程的执行进行控制时使用。该节点可能什么都</div><div></div><div>不需要做，也可能执行一些的操作。比如，路过银行，你拍怕裤兜，看看钱够还是不</div><div></div><div>够。如果钱还可以花一段时间，你就不会去取钱。如果钱不多了，你就会去银行取些</div><div></div><div>现金。或是钱本来就够花，但外面在下着雨，你想取避一避雨也不是不可以。State</div><div></div><div>要做的相当于带你路过银行，至于你取不取钱，取多少，还是为了别的什么，不是它</div><div></div><div>说了算，而是你自己的决定。</div><div>&nbsp;</div><div>第一种方式：无分支的State</div><div>Xml代码 &nbsp;</div><div>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &nbsp;</div><div>&nbsp;&nbsp;</div><div>&lt;process name="simpleState" xmlns="http://jbpm.org/4.3/jpdl"&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;start name="start1" g="368,117,48,48"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to state" to="state" g="-59,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/start&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;end name="end" g="372,396,48,48"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;state name="state" g="348,250,92,52"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to end" to="end" g="-47,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/state&gt; &nbsp;</div><div>&lt;/process&gt; &nbsp;</div><div>&nbsp;</div><div>测试代码如下：</div><div>Java代码 &nbsp;</div><div>ProcessInstance processInstance = &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; executionService.startProcessInstanceByKey("simpleState"); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("流程实例Id:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.getId()); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("流程定义Id:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.getProcessDefinitionId()); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("是否在 state节点:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isActive("state"));//true &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("判断流程是否结束:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isEnded());//false &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; processInstance = &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; executionService.signalExecutionById(processInstance.getId());&nbsp;</div><div></div><div>&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("是否在 state节点:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isActive("state"));//true &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("判断流程是否结束:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isEnded());//false &nbsp;</div><div>&nbsp;</div><div>执行结果如下：</div><div>Consult代码 &nbsp;</div><div>流程实例Id:simpleState.7 &nbsp;</div><div>流程定义Id:simpleState-1 &nbsp;</div><div>是否在 state节点:true &nbsp;</div><div>判断流程是否结束:false &nbsp;</div><div>************** &nbsp;</div><div>是否在 state节点:false &nbsp;</div><div>判断流程是否结束:true &nbsp;</div><div>&nbsp;</div><div>第二种方式：有分支的state</div><div>Xml代码 &nbsp;</div><div>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &nbsp;</div><div>&nbsp;&nbsp;</div><div>&lt;process name="compState" xmlns="http://jbpm.org/4.3/jpdl"&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;start name="start1" g="300,106,48,48"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to proot" to="proot" g="-59,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/start&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;end name="end" g="315,448,48,48"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;state name="proot" g="281,223,92,52"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to boy" to="boy" g="-59,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to girl" to="girl" g="-59,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/state&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;state name="boy" g="187,346,92,52"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to end" to="end" g="-47,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/state&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;state name="girl" g="383,342,92,52"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to end" to="end" g="-47,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/state&gt; &nbsp;</div><div>&lt;/process&gt; &nbsp;</div><div>&nbsp;</div><div>测试代码如下：</div><div>Java代码 &nbsp;</div><div>ProcessInstance processInstance = &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; executionService.startProcessInstanceByKey("compState"); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("是否在 proot节点:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isActive("proot"));//true &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("是否在 boy节点:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isActive("boy"));//false &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("是否在 girl节点:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isActive("girl"));//false &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("判断流程是否结束:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isEnded());//false &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; processInstance = &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; executionService.signalExecutionById(processInstance.getId</div><div></div><div>(),"to boy");//因为proot往下有多个分支，如果不指定流程转向，流程不会继续往</div><div></div><div>下执行 &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("是否在 proot节点:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isActive("proot"));//false &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("是否在 boy节点:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isActive("boy"));//true &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("是否在 girl节点:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isActive("girl"));//false &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("判断流程是否结束:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isEnded());//false &nbsp; &nbsp;</div><div>&nbsp;</div><div>executionService.signalExecutionById(processInstance.getId(),"to boy");</div><div>这句如果改为：</div><div>executionService.signalExecutionById(processInstance.getId());</div><div>则流程不会往下执行，流程继续停留在proot节点。</div><div>&nbsp;</div><div>decision &nbsp;</div><div></div><div>条件判断节点，当一个流程出现多个中情况而各种情况都排他时使用，相当于switch&nbsp;</div><div></div><div>case.</div><div>第一种方式：decision内置condition</div><div>&nbsp;</div><div>Xml代码 &nbsp;</div><div>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &nbsp;</div><div>&lt;process key="deci" name="deci" xmlns="http://jbpm.org/4.3/jpdl"&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;start g="358,77,48,48" name="start1"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition g="-83,-17" name="to exclusive1" to="exclusive1"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/start&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;end g="374,510,48,48" name="end"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;decision g="358,219,48,48" name="exclusive1"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition g="-59,-17" name="to 200" to="200"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;condition expr="#{errorcode == 200}"/&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;/transition&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition g="-59,-17" name="to 404" to="404"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;condition expr="#{errorcode == 404}"/&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;/transition&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition g="-59,-17" name="to 500" to="500"&gt; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;condition expr="#{errorcode == 500}"/&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;/transition&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/decision&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;state g="194,351,92,52" name="200"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition g="-47,-17" name="to end" to="end"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/state&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;state g="340,349,92,52" name="404"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition g="-47,-17" name="to end" to="end"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/state&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;state g="476,349,92,52" name="500"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition g="-47,-17" name="to end" to="end"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/state&gt; &nbsp;</div><div>&lt;/process&gt; &nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>测试代码如下：</div><div>Java代码 &nbsp;</div><div>Map&lt;String, String&gt; variables = new HashMap&lt;String, String&gt;(); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; variables.put("errorcode", "200"); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ProcessInstance processInstance = &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; executionService.startProcessInstanceByKey("deci", variables);&nbsp;</div><div></div><div>&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("200 isActive:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isActive("200"));//进入state 200,暂停 &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("processInstance isEnd:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isEnded()); //流程未结束，返回false &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;"); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; //该方法返回processInstance如果不接收，processInstance还是原来的对</div><div></div><div>象 &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; //如果不接收返回值，也不重新查询，则processInstance还是方法调前的</div><div></div><div>状态 &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; processInstance= &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; executionService.signalExecutionById(processInstance.getId());&nbsp;</div><div></div><div>&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("processInstance isEnd:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isEnded()); //流程结束，返回true &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;"); &nbsp;</div><div>&nbsp;</div><div>控制台输出结果如下：</div><div>Consult代码 &nbsp;</div><div>200 isActive:true &nbsp;</div><div>processInstance isEnd:false &nbsp;</div><div>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;</div><div>******** &nbsp;</div><div>processInstance isEnd:true &nbsp;</div><div>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;</div><div>&nbsp;</div><div>第二种方式：为decision活动设置expr</div><div>Xml代码 &nbsp;</div><div>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &nbsp;</div><div>&lt;process name="deciBaseExpr" xmlns="http://jbpm.org/4.3/jpdl"&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;start name="start1" g="407,65,48,48"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to exclusive1" to="exclusive1" g="-83,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/start&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;end name="end1" g="418,497,48,48"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;decision name="exclusive1" g="409,207,48,48" expr="#{whatcode}"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to 200" to="200" g="-59,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to 404" to="404" g="-59,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to 500" to="500" g="-59,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/decision&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;state name="200" g="251,344,92,52"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to end1" to="end1" g="-47,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/state&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;state name="404" g="389,342,92,52"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to end1" to="end1" g="-47,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/state&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;state name="500" g="516,341,92,52"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to end1" to="end1" g="-47,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/state&gt; &nbsp;</div><div>&lt;/process&gt; &nbsp;</div><div>&nbsp;</div><div>测试代码如下：</div><div>Java代码 &nbsp;</div><div>Map&lt;String, String&gt; variables = new HashMap&lt;String, String&gt;(); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; variables.put("whatcode", "to 404"); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ProcessInstance processInstance = &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; executionService.startProcessInstanceByKey("deciBaseExpr",&nbsp;</div><div></div><div>variables); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("200 isActive:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isActive("200"));//返回false &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("404 isActive:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isActive("404"));//返回true &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("500 isActive:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isActive("500"));//返回false &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("processInstance isEnd:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isEnded()); //流程未结束，返回false &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;"); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; //该方法返回processInstance如果不接收，processInstance还是原来的对</div><div></div><div>象 &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; //如果不接收返回值，也不重新查询，则processInstance还是方法调前的</div><div></div><div>状态 &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; processInstance= &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; executionService.signalExecutionById(processInstance.getId());&nbsp;</div><div></div><div>&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("processInstance isEnd:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isEnded()); //流程结束，返回true &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;"); &nbsp;</div><div>&nbsp;</div><div>控制台输出结果如下：</div><div>Consult代码 &nbsp;</div><div>200 isActive:false &nbsp;</div><div>404 isActive:true &nbsp;</div><div>500 isActive:false &nbsp;</div><div>processInstance isEnd:false &nbsp;</div><div>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;</div><div>*************** &nbsp;</div><div>processInstance isEnd:true &nbsp;</div><div>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;</div><div>&nbsp;</div><div>第三种方式：为decision配置handler</div><div>Xml代码 &nbsp;</div><div>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &nbsp;</div><div>&lt;process name="deciByHandler" key="deciByHandler"&nbsp;</div><div></div><div>xmlns="http://jbpm.org/4.3/jpdl"&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;start name="start1" g="341,55,48,48"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to exclusive1" to="exclusive1" g="-83,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/start&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;end name="end1" g="346,435,48,48"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;decision name="exclusive1" g="340,164,48,48"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;handler class="com.lihua.HandlerDecision"&gt;&lt;/handler&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to 200" to="200" g="-59,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to 404" to="404" g="-59,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to 500" to="500" g="-59,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/decision&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;state name="200" g="178,315,92,52"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to end1" to="end1" g="-47,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/state&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;state name="404" g="322,309,92,52"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to end1" to="end1" g="-47,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/state&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;state name="500" g="461,309,92,52"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to end1" to="end1" g="-47,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/state&gt; &nbsp;</div><div>&lt;/process&gt; &nbsp;</div><div>&nbsp;</div><div>Handler类：</div><div>&nbsp;</div><div>Java代码 &nbsp;</div><div>package com.lihua; &nbsp;</div><div>&nbsp;&nbsp;</div><div>import org.jbpm.api.jpdl.DecisionHandler; &nbsp;</div><div>import org.jbpm.api.model.OpenExecution; &nbsp;</div><div>&nbsp;&nbsp;</div><div>public class HandlerDecision implements DecisionHandler { &nbsp;</div><div>&nbsp;&nbsp;</div><div>&nbsp; &nbsp; private static final long serialVersionUID = -1639139174140348966L; &nbsp;</div><div>&nbsp;&nbsp;</div><div>&nbsp; &nbsp; @Override &nbsp;</div><div>&nbsp; &nbsp; public String decide(OpenExecution execution) { &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return (String) execution.getVariable("towhere"); &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; } &nbsp;</div><div>&nbsp;&nbsp;</div><div>} &nbsp;</div><div>&nbsp;</div><div>测试代码如下：</div><div>Java代码 &nbsp;</div><div>Map&lt;String, String&gt; variables = &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new HashMap&lt;String, String&gt;(); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; variables.put("towhere", "to 500"); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ProcessInstance processInstance = &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; executionService. &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; startProcessInstanceByKey("deciByHandler", variables); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("200 isActive:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isActive("200"));//返回 false &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("404 isActive:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isActive("404"));//返回 false &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("500 isActive:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isActive("500"));//返回 true &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("processInstance isEnd:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isEnded()); //流程未结束，返回false &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;"); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; //该方法返回processInstance如果不接收，processInstance还是原来的对</div><div></div><div>象 &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; //如果不接收返回值，也不重新查询，则processInstance还是方法调前的</div><div></div><div>状态 &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; processInstance= &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; executionService.signalExecutionById(processInstance.getId());&nbsp;</div><div></div><div>&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("processInstance isEnd:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isEnded()); //流程结束，返回true &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;"); &nbsp;</div><div>&nbsp;</div><div>控制台输出结果如下：</div><div>Consult代码 &nbsp;</div><div>200 isActive:false &nbsp;</div><div>404 isActive:false &nbsp;</div><div>500 isActive:true &nbsp;</div><div>processInstance isEnd:false &nbsp;</div><div>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;</div><div>************ &nbsp;</div><div>processInstance isEnd:true &nbsp;</div><div>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;</div><div>&nbsp;</div><div>以上三种方式差别都不是很大，第三中在程序中通过Handler进行复杂的处理。个人</div><div></div><div>觉得，如果对于逻辑不是很复杂的操作，前两种方式是比较可取的。但如果逻辑过于</div><div></div><div>复杂，或者还有其他的操作比如同步数据库中的其他信息等操作时，不妨选择第三种</div><div></div><div>方式。</div><div>这些代码代码比较简单，这里就不做过多的解释。</div><div>&nbsp;</div><div>Task</div><div></div><div>任务节点，通常与form表单关联，主要是在流程实例经过活动时为某一人或组指派任</div><div></div><div>务.</div><div>Task的assignee属性</div><div>&nbsp;</div><div>第一， assignee用来指示用户，负责完成任务的人。分配人是一个任务中的字符串</div><div></div><div>属性，引用一个用户。(直接指定一个字符串)</div><div>第二，这个属性默认会当做表达式来执行。(指定一个表达式,然后在代码里为该表达</div><div></div><div>式赋值) 如:在这里任务被分配给#{order.owner}。这意味着首先使用order这个名字</div><div></div><div>查找一个对象。 其中一个查找对象的地方是这个任务对应的流程变量。 然后</div><div></div><div>getOwner()方法会用来获得用户id， 引用的用户负责完成这个任务。</div><div>&nbsp;</div><div>Xml代码 &nbsp;</div><div>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &nbsp;</div><div>&nbsp;&nbsp;</div><div>&lt;process name="task" xmlns="http://jbpm.org/4.3/jpdl"&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;start name="start1" g="390,97,48,48"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to task" to="task" g="-53,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/start&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;end name="end1" g="391,362,48,48"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;task name="task" g="368,239,92,52" assignee="${taskAssignee}"&gt; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &lt;transition name="to end1" to="end1" g="-47,-17"/&gt; &nbsp;</div><div>&nbsp; &nbsp;&lt;/task&gt; &nbsp;</div><div>&lt;/process&gt; &nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>测试代码如下：</div><div>Java代码 &nbsp;</div><div>Map&lt;String,String&gt; map= &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new HashMap&lt;String, String&gt;(); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; map.put("taskAssignee", "lihua"); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ProcessInstance processInstance=null; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; 2; i++) { &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance=executionService. &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; startProcessInstanceByKey("task",map); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("流程是否处于task节点:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.isActive("task"));//true &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("流程实例Id:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processInstance.getId()); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; } &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; List&lt;Task&gt; list=taskService.findPersonalTasks("lihua"); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; for (Task task : list) { &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("任务活动名称:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; task.getActivityName()); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("流程实例Id:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; task.getExecutionId()); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("任务活动Id:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; task.getId()); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("任务活动创建时间:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; task.getCreateTime()); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("任务活动进度:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; task.getProgress()); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("任务活动分配给:"+ &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; task.getAssignee()); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;"); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; } &nbsp;</div><div>&nbsp;</div><div>控制台输出结果如下：</div><div>Consult代码 &nbsp;</div><div>流程是否处于task节点:true &nbsp;</div><div>流程实例Id:task.7 &nbsp;</div><div>************ &nbsp;</div><div>流程是否处于task节点:true &nbsp;</div><div>流程实例Id:task.11 &nbsp;</div><div>***************** &nbsp;</div><div>任务活动名称:task &nbsp;</div><div>流程实例Id:task.11 &nbsp;</div><div>任务活动Id:13 &nbsp;</div><div>任务活动创建时间:2012-02-16 15:48:50.406 &nbsp;</div><div>任务活动进度:null &nbsp;</div><div>任务活动分配给:lihua &nbsp;</div><div>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;</div><div>任务活动名称:task &nbsp;</div><div>流程实例Id:task.7 &nbsp;</div><div>任务活动Id:9 &nbsp;</div><div>任务活动创建时间:2012-02-16 15:48:50.375 &nbsp;</div><div>任务活动进度:null &nbsp;</div><div>任务活动分配给:lihua &nbsp;</div><div>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div>Tips代码 &nbsp;</div><div>1、在流程设置时如果出现乱码可在Eclipse.ini中添加如下配置： &nbsp;</div><div>-Dfile.encoding=UTF-8 &nbsp;</div><div>2、在jbpm中表达式$(),#()均可以成功解析。 &nbsp;</div><img src ="http://www.blogjava.net/kxbin/aggbug/378451.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-05-18 00:09 <a href="http://www.blogjava.net/kxbin/articles/378451.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>jbpm4.3 数据库使用MySql异常 could not delete: [org.jbpm.pvm.internal.model.ExecutionImpl#7]</title><link>http://www.blogjava.net/kxbin/articles/378450.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Thu, 17 May 2012 15:21:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/378450.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/378450.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/378450.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/378450.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/378450.html</trackback:ping><description><![CDATA[<p style="color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; ">解决方案：修改属性：jbpm.hibernate.cfg.xml &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;</p><p style="color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; ">&lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLInnoDBDialect&lt;/property&gt;&nbsp;</p><p style="color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; "><br /></p><p style="color: #333333; font-family: Arial; font-size: 14px; line-height: 26px; text-align: left; background-color: #ffffff; ">InnoDB 给 MySQL 提供了具有事务(commit)、回滚(rollback)和崩溃修复能力(crash recovery capabilities)、多版本并发控制(multi-versioned concurrency control)的事务安全(transaction-safe (ACID compliant))型表。InnoDB 提供了行级锁(locking on row level)，提供与 Oracle 类似的不加锁读取(non-locking read in SELECTs)。InnoDB锁定在行级并且也在SELECT语句提供一个Oracle风格一致的非锁定读。另外InnoDB是为处理巨大数据量时的最大性能设计。它的CPU效率可能是任何其它基于磁盘的关系数据库引擎所不能匹敌的。MySQLInnoDBDialect基于上也就有InnoDB相同的功能.</p><img src ="http://www.blogjava.net/kxbin/aggbug/378450.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-05-17 23:21 <a href="http://www.blogjava.net/kxbin/articles/378450.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>jbpm页面抛错el相关java.lang.ClassCastException: de.odysseus.el.ExpressionFactoryImpl的问题</title><link>http://www.blogjava.net/kxbin/articles/378309.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Wed, 16 May 2012 07:31:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/378309.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/378309.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/378309.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/378309.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/378309.html</trackback:ping><description><![CDATA[<span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">导入包是导入jbpm全体包</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">jbpm版本是</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">jbpm-4.3</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">---------------------------------------------------------------------------------------------------</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">严重: Servlet.service() for servlet jsp threw exception</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">java.lang.ClassCastException: de.odysseus.el.ExpressionFactoryImpl cannot be cast to javax.el.ExpressionFactory</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:180)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:107)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.jasper.compiler.PageInfo.&lt;init&gt;(PageInfo.java:78)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:109)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.jasper.compiler.Compiler.compile(Compiler.java:360)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:594)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:163)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:402)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:249)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:267)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:245)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:260)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)</span><br style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; " /><span style="font-family: simsun; font-size: 14px; line-height: 23px; text-align: left; background-color: #ffffff; ">at java.lang.Thread.run(Unknown Source)</span>&nbsp;<br /><br />jsp页面<br />&nbsp;&lt;%@ page language="java" contentType="text/html; charset=UTF-8"<div>&nbsp; &nbsp; pageEncoding="UTF-8"%&gt;</div><div>&lt;%@page import="java.util.*" &nbsp;%&gt;</div><div>&lt;%@page import="org.jbpm.api.*" &nbsp;%&gt;</div><div>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;</div><div>&lt;html&gt;</div><div>&lt;head&gt;</div><div>&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;</div><div>&lt;title&gt;Insert title here&lt;/title&gt;</div><div>&lt;/head&gt;</div><div>&lt;body&gt;</div><div>&lt;%</div><div><span style="white-space:pre">	</span>ProcessEngine processEngine = Configuration.getProcessEngine();</div><div><span style="white-space:pre">	</span>RepositoryService repositoryService = processEngine.getRepositoryService();</div><div><span style="white-space:pre">	</span>List&lt;ProcessDefinition&gt; list = repositoryService.createProcessDefinitionQuery().list();</div><div><span style="white-space:pre">	</span>//ExecutionService executionService = processEngine.getExecutionService();</div><div><span style="white-space:pre">	</span>//TaskService taskService = processEngine.getTaskService();</div><div><span style="white-space:pre">	</span>for(ProcessDefinition pd : list){</div><div>%&gt;</div><div>&lt;%=pd.getId() %&gt;,&lt;%=pd.getName() %&gt;,&lt;%=pd.getVersion() %&gt;</div><div>&lt;%</div><div><span style="white-space:pre">	</span>}</div><div>%&gt;</div><div></div><div>&lt;/body&gt;</div><div>&lt;/html&gt;<br /><br />解决方法：<br />删除jar,juel.jar</div><img src ="http://www.blogjava.net/kxbin/aggbug/378309.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-05-16 15:31 <a href="http://www.blogjava.net/kxbin/articles/378309.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Myeclipse 安装 JBPM</title><link>http://www.blogjava.net/kxbin/articles/377997.html</link><dc:creator>kxbin</dc:creator><author>kxbin</author><pubDate>Sat, 12 May 2012 08:18:00 GMT</pubDate><guid>http://www.blogjava.net/kxbin/articles/377997.html</guid><wfw:comment>http://www.blogjava.net/kxbin/comments/377997.html</wfw:comment><comments>http://www.blogjava.net/kxbin/articles/377997.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kxbin/comments/commentRss/377997.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kxbin/services/trackbacks/377997.html</trackback:ping><description><![CDATA[<span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; ">注意：JBPM 4.3 要Eclipse3.5 以上才可以安装插件，所以 Myeclipse 6.0的不可以安装JBPM 4.3的插件，需要7.5以上才可以安装&nbsp;</span><br style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; " /><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; ">1.到JBPM 官网下载 JBPM文件，下载地址&nbsp;</span><br style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; " /><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; ">http://nchc.dl.sourceforge.net/project/jbpm/jBPM%204/jbpm-4.3/jbpm-4.3.zip&nbsp;</span><br style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; " /><br style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; " /><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; ">2.解压jbpm-4.3.zip，再解压jbpm-4.3\jbpm-4.3\install\src\gpd 下的&nbsp;</span><br style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; " /><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; ">jbpm-gpd-site.zip，如果不解压而直接安装，有时会出现安装错误。&nbsp;</span><br style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; " /><br style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; " /><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; ">3.在Myeclipse 选择help-software updates-add/move software-add local-选择jbpm-gpd-site.zip 的解压文件夹，点确定。&nbsp;</span><br style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; " /><br style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; " /><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; ">4.勾选Personal Sites 下的 jBPM ，点击next&nbsp;</span><br style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; " /><br style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; " /><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; ">5.点击JBPM 4 Graphical Editor and Tools，再点击 Apply&nbsp;</span><br style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; " /><br style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; " /><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; ">6.显示安装 JBPM插件，点击 next，点击update&nbsp;</span><br style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; " /><br style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; " /><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: #ffffff; ">7.安装完成！&nbsp;</span>&nbsp;<img src ="http://www.blogjava.net/kxbin/aggbug/377997.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kxbin/" target="_blank">kxbin</a> 2012-05-12 16:18 <a href="http://www.blogjava.net/kxbin/articles/377997.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>