Flex开发的JBPM流程展现器
---JBPM流程定义XML----
<?xml version="1.0" encoding="UTF-8"?>
<process name="IncidentProcess">
<start g="276,12,136,52" description="事件申报">
<transition to="evaluatePosition" />
</start>
<decision g="276,84,48,48" name="evaluatePosition" >
<transition g="-76,-22" name="toLeaderFirstApprove" to="leaderFirstApprove" description="职位<正科">
<condition expr="#{ownerDutyId>3}"/>
</transition>
<transition g="-88,-22" name="toTechAccept" to="techAccept" description="职位>=正科"/>
</decision>
<task assignee="#{leader}" g="462,135,86,52" name="leaderFirstApprove" description="科长审批">
<transition g="-88,-22" name="toTechAccept" to="techAccept" description="同意"/>
<transition g="-78,-22" name="toEndReject" to="endReject" description="退回"/>
</task>
<task candidate-groups="tech-dept" g="47,180,95,52" name="techAccept" description="技术科受理">
<transition g="-117,-22" name="toEvaluateExpense" to="evaluateExpense" description="费用预算"/>
</task>
<decision g="279,305,136,52" name="evaluateExpense">
<transition g="-76,-22" name="toLeaderSecondApprove" to="leaderSecondApprove" description="费用>0且职位<正科">
<condition expr="#{expense>0 && ownerDutyId>3}"/>
</transition>
<transition g="-93,-22" name="toTechLeaderApprove" to="techLeaderApprove" description="费用>0且职位>=正科">
<condition expr="#{expense>0 && ownerDutyId<3}"/>
</transition>
<transition g="-81,-22" name="toTechHandle" to="techHandle" description="费用=0"/>
</decision>
<task assignee="#{leader}" g="465,261,86,52" name="leaderSecondApprove" description="科长审批">
<transition g="88,22" name="toTechLeaderApprove" to="techLeaderApprove" description="同意"/>
<transition g="-78,-22" name="toEndReject" to="endReject" description="退回"/>
</task>
<task assignee="#{techLeader}" g="462,365,98,52" name="techLeaderApprove" description="技术科长审批">
<transition g="-93,-22" name="toFinanceLeaderApprove" to="financeLeaderApprove" description="同意"/>
<transition g="-78,-22" name="toEndReject" to="endReject" description="退回"/>
</task>
<task assignee="#{financeLeader}" g="465,485,98,52" name="financeLeaderApprove" description="计财科长审批">
<transition g="-142,-52" name="toEvaluateExpensive" to="evaluateExpensive" description="同意"/>
<transition g="-78,-22" name="toEndReject" to="endReject" description="退回"/>
</task>
<decision g="289,477,136,52" name="evaluateExpensive">
<transition g="-81,-22" name="toPresidentApprove" to="presidentApprove" description="费用>=500">
<condition expr="#{expense>=500}"/>
</transition>
<transition g="-81,-22" name="toTechHandle" to="techHandle" description="费用<500"/>
</decision>
<task assignee="#{president}" g="473,641,91,52" name="presidentApprove" description="检察长审批">
<transition g="-81,-22" name="toTechHandle" to="techHandle" description="同意"/>
<transition g="-78,-22" name="toEndReject" to="endReject" description="退回"/>
</task>
<task candidate-groups="tech-dept" g="42,480,101,52" name="techHandle" description="技术科处理">
<transition g="-81,-22" name="toApplyerConfirm" to="applyerConfirm" />
</task>
<task assignee="#{ownerUserid}" g="41,603,104,52" name="applyerConfirm" description="申请人确认" >
<transition g="-61,-22" name="toEndOK" to="endOK" description="结束"/>
</task>
<end g="70,718,136,52" name="endOK" description="结束(完成)"/>
<end g="680,320,136,52" name="endReject" description="结束(退回)"/>
</process>
---根据JBPM流程定义XML以及流程数据生成另一个XML----
<?xml version="1.0" encoding="utf-8"?>
<BusinessView>
<Nodes>
<Node id="start" name="事件申报" message="任务名称:事件申报<br>处理人:钟佩玲<br>处理时间:2011-05-28 16:33:20.0" type="start" image="/nms4/resource/image/config/start_event_empty.png" x="276" y="12" />
<Node id="evaluatePosition" type="decision" image="/nms4/resource/image/config/gateway_exclusive.png" x="276" y="84" />
<Node id="leaderFirstApprove" name="科长审批" message="任务名称:科长审批<br>处理人:吴敏华<br>处理时间:2011-05-28 16:35:19.0<br>处理结果:同意<br>处理意见:同意维修。" type="task" image="/nms4/resource/image/config/task_empty.png" x="462" y="135" />
<Node id="techAccept" name="技术科受理" message="任务名称:技术科受理<br>处理人:服务器管理员<br>处理时间:2011-05-28 16:46:06.0<br>处理结果:受理<br>处理意见:需要更换显示器。" type="task" image="/nms4/resource/image/config/task_empty.png" x="47" y="180" />
<Node id="evaluateExpense" type="decision" image="/nms4/resource/image/config/gateway_exclusive.png" x="279" y="305" />
<Node id="leaderSecondApprove" name="科长审批" message="任务名称:科长审批" type="task" image="/nms4/resource/image/config/task_active.gif" x="465" y="261" />
<Node id="techLeaderApprove" name="技术科长审批" message="任务名称:技术科长审批" type="task" image="/nms4/resource/image/config/task_empty.png" x="462" y="365" />
<Node id="financeLeaderApprove" name="计财科长审批" message="任务名称:计财科长审批" type="task" image="/nms4/resource/image/config/task_empty.png" x="465" y="485" />
<Node id="evaluateExpensive" type="decision" image="/nms4/resource/image/config/gateway_exclusive.png" x="289" y="477" />
<Node id="presidentApprove" name="检察长审批" message="任务名称:检察长审批" type="task" image="/nms4/resource/image/config/task_empty.png" x="473" y="641" />
<Node id="techHandle" name="技术科处理" message="任务名称:技术科处理" type="task" image="/nms4/resource/image/config/task_empty.png" x="42" y="480" />
<Node id="applyerConfirm" name="申请人确认" message="任务名称:申请人确认" type="task" image="/nms4/resource/image/config/task_empty.png" x="41" y="603" />
<Node id="endOK" name="结束(完成)" message="任务名称:结束(完成)" type="end" image="/nms4/resource/image/config/end_event_terminate.png" x="70" y="718" />
<Node id="endReject" name="结束(退回)" message="任务名称:结束(退回)" type="end" image="/nms4/resource/image/config/end_event_terminate.png" x="680" y="320" />
</Nodes>
<Lines>
<Line start="start" end="evaluatePosition" color="0xFF0000" />
<Line message="职位<正科" start="evaluatePosition" end="leaderFirstApprove" color="0xFF0000" />
<Line message="职位>=正科" start="evaluatePosition" end="techAccept" color="0x0000FF" />
<Line message="同意" start="leaderFirstApprove" end="techAccept" color="0xFF0000" />
<Line message="退回" start="leaderFirstApprove" end="endReject" color="0x0000FF" />
<Line message="费用预算" start="techAccept" end="evaluateExpense" color="0xFF0000" />
<Line message="费用>0且职位<正科" start="evaluateExpense" end="leaderSecondApprove" color="0xFF0000" />
<Line message="费用>0且职位>=正科" start="evaluateExpense" end="techLeaderApprove" color="0x0000FF" />
<Line message="费用=0" start="evaluateExpense" end="techHandle" color="0x0000FF" />
<Line message="同意" start="leaderSecondApprove" end="techLeaderApprove" color="0x0000FF" />
<Line message="退回" start="leaderSecondApprove" end="endReject" color="0x0000FF" />
<Line message="同意" start="techLeaderApprove" end="financeLeaderApprove" color="0x0000FF" />
<Line message="退回" start="techLeaderApprove" end="endReject" color="0x0000FF" />
<Line message="同意" start="financeLeaderApprove" end="evaluateExpensive" color="0x0000FF" />
<Line message="退回" start="financeLeaderApprove" end="endReject" color="0x0000FF" />
<Line message="费用>=500" start="evaluateExpensive" end="presidentApprove" color="0x0000FF" />
<Line message="费用<500" start="evaluateExpensive" end="techHandle" color="0x0000FF" />
<Line message="同意" start="presidentApprove" end="techHandle" color="0x0000FF" />
<Line message="退回" start="presidentApprove" end="endReject" color="0x0000FF" />
<Line start="techHandle" end="applyerConfirm" color="0x0000FF" />
<Line message="结束" start="applyerConfirm" end="endOK" color="0x0000FF" />
</Lines>
<Logs>
<Log taskId="start" taskName="事件申报" processor="钟佩玲" result="" opinion="显示器坏了" logTime="2011-05-28 16:33:20.0" />
<Log taskId="leaderFirstApprove" taskName="科长审批" processor="吴敏华" result="同意" opinion="同意维修。" logTime="2011-05-28 16:35:19.0" />
<Log taskId="techAccept" taskName="技术科受理" processor="服务器管理员" result="受理" opinion="需要更换显示器。" logTime="2011-05-28 16:46:06.0" />
</Logs>
<Tree name="resourceTree" root="true" icon="/nms4/resource/image/config/root.gif">
<node name="任务" root="true" icon="/nms4/resource/image/config/root.gif">
<node id="start" name="事件申报" icon="/nms4/resource/image/config/node.gif" />
<node id="leaderFirstApprove" name="科长审批" icon="/nms4/resource/image/config/node.gif" />
<node id="techAccept" name="技术科受理" icon="/nms4/resource/image/config/node.gif" />
<node id="leaderSecondApprove" name="科长审批" icon="/nms4/resource/image/config/node.gif" />
<node id="techLeaderApprove" name="技术科长审批" icon="/nms4/resource/image/config/node.gif" />
<node id="financeLeaderApprove" name="计财科长审批" icon="/nms4/resource/image/config/node.gif" />
<node id="presidentApprove" name="检察长审批" icon="/nms4/resource/image/config/node.gif" />
<node id="techHandle" name="技术科处理" icon="/nms4/resource/image/config/node.gif" />
<node id="applyerConfirm" name="申请人确认" icon="/nms4/resource/image/config/node.gif" />
<node id="endOK" name="结束(完成)" icon="/nms4/resource/image/config/node.gif" />
<node id="endReject" name="结束(退回)" icon="/nms4/resource/image/config/node.gif" />
</node>
</Tree>
</BusinessView>
Flex读这个XML生成流程图: