首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

jBPM4工作流引擎 网络知识点收拾汇总 提升

2012-06-29 
jBPM4工作流引擎 网络知识点整理汇总 提升public class MyDecisionHandler implements DecisionHandler{@O

jBPM4工作流引擎 网络知识点整理汇总 提升
public class MyDecisionHandler implements DecisionHandler{@Overridepublic String decide(OpenExecution execution) {Integer age = (Integer) execution.getVariable("age");if (age>=20){return "yes";}else{return "no";}}}?ProcessEngine processEngine = Configuration.getProcessEngine();TaskService taskService = processEngine.getTaskService();taskService.takeTask(“task的id”, “领取task的人员");?ProcessEngine processEngine = Configuration.getProcessEngine();IdentityService identityService = processEngine.getIdentityService(); identityService.createGroup("sales");identityService.createUser(“zhang", “zhang", “san");identityService.createUser(“li", “li", “si"); identityService.createMembership(“zhang", "sales");identityService.createMembership(“li", "sales");?public class MyAssignmentHandler implements AssignmentHandler{private String name;public String getName() {return name;}public void setName(String name) { this.name = name; } public void assign(Assignable assignable, OpenExecution execution) throws Exception {assignable.setAssignee(name);}}?相应的配置示例: <task name="task1" g="339,146,92,52"> <assignment-handler name="code">public class MyJava {private String user1;private String user2;…user1和user2的setterpublic String sayHello(String arg1,String arg2){ System.out.println("user1=="+user1);System.out.println("user2=="+user2);System.out.println("arg1=="+arg1);System.out.println("arg2=="+arg2); return “Hello";}}? <java g="246,135,92,52" name="java1" method="sayHello" var="manager"> <field name="user1"><object expr=“#{user1}”/></field> <field name="user2"><string value="user2“/></field> <arg><string value="xyz“/></arg> <arg><object expr="#{abc}“/></arg> <transition to="task1"/> </java>?<sql g="192,438,92,52" name="sql1" unique="true" var="sqlV"><query>select * from tbl_user where uuid=:uuid</query><parameters><object name="uuid" expr="#{uuid}"></object></parameters> <transition to="hql1"/></sql>?<hql name="hql1" g="404,457,92,52" unique="true" var="hqlV"><query>select o from Parent o where o.id=:id</query><parameters><string name="id" value="22"/></parameters> <transition to="task2"/></hql>?<foreach name="foreach1" in="D1,D2,D3" var="nowDep"><transition to="task5"/></foreach><task name="task5"><transition to="join1"/></task><join name="join1" multiplicity="3"><transition to="task6"/></join>?那么当流程运行到foreach1的时候,会转移到task5活动3次,也就是会生成3个task5的实例。 <rules name="rule1"><fact var="um"></fact><transition to="exclusive2"/> </rules><decision name="exclusive2"><transition name="toT7" to="task7"><condition expr="#{um.canDrink}"/></transition><transition name="toT8" to="task8"><condition expr="#{!um.canDrink}"/></transition></decision>?? when ??? um : cn.javass.jbpm4.hello.UserModel( age > 18,uuid=="11") ? then ??? um.setCanDrink( true ); end Map map = new HashMap();UserModel um = new UserModel();um.setUuid("11");um.setAge(50);map.put("um", um);exe.startProcessInstanceByKey("h2",map);?public class MyEventListener implements EventListener{public void notify(EventListenerExecution exection) throws Exception {System.out.println("走出Decistion");}}<?xml version="1.0" encoding="UTF-8"?> <process name="test9" xmlns="http://jBPM.org/4.4/jpdl"> <on event="start"> <event-listener g="84,115,48,48"> <transition to="task1"/> </start> <end name="end1" g="778,120,48,48"/><task name="task1" g="358,124,92,52" assignee="wang"> <on event="start"> <event-listener to="end1" g="-47,-17"> <event-listener to="task2" g="-53,-17"/> </task> <task name="task2" g="536,218,92,52" assignee="zhang"> <transition to="end1"/> </task></process> ?

热点排行