《jbpm5简单小案例》--环境搭建好,建立新项目只需替换bpmn文件即可
2013-04-16 23:10
513 查看
<?xml version="1.0" encoding="UTF-8"?> <definitions id="Definition" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes" expressionLanguage="http://www.mvel.org/2.0" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" xmlns:g="http://www.jboss.org/drools/flow/gpd" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.jboss.org/drools"> <itemDefinition id="_strItem" structureRef="String" /> <itemDefinition id="_numItem" structureRef="Integer" /> <process processType="Private" isExecutable="true" id="com.sample.bpmn.hello" name="Hello World" > <extensionElements> <tns:import name="java.io.*" /> </extensionElements> <!-- process variables --> <property id="str" itemSubjectRef="_strItem"/> <property id="num" itemSubjectRef="_numItem"/> <!-- nodes --> <startEvent id="_1" name="StartProcess" /> <scriptTask id="_2" name="input" scriptFormat="http://www.java.com/java" > <script>System.out.println("please input str:"); BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); str = bf.readLine(); System.out.println(str); String numstr = bf.readLine(); num = Integer.parseInt(numstr); kcontext.setVariable("str", str); kcontext.setVariable("num", num); </script> </scriptTask> <endEvent id="_3" name="EndProcess" > <terminateEventDefinition/> </endEvent> <scriptTask id="_4" name="output" scriptFormat="http://www.java.com/java" > <script>System.out.println("your input is:" + str); System.out.println("your input is:" + num);</script> </scriptTask> <exclusiveGateway id="_5" name="Gateway" gatewayDirection="Diverging" /> <scriptTask id="_6" name="yes" scriptFormat="http://www.java.com/java" > <script>System.out.println("yyyyyyy");</script> </scriptTask> <scriptTask id="_7" name="no" scriptFormat="http://www.java.com/java" > <script>System.out.println("nnnnnnnnnnn");</script> </scriptTask> <exclusiveGateway id="_8" name="Gateway" gatewayDirection="Converging" /> <!-- connections --> <sequenceFlow id="_1-_2" sourceRef="_1" targetRef="_2" /> <sequenceFlow id="_4-_3" sourceRef="_4" targetRef="_3" /> <sequenceFlow id="_8-_4" sourceRef="_8" targetRef="_4" /> <sequenceFlow id="_2-_5" sourceRef="_2" targetRef="_5" /> <sequenceFlow id="_5-_6" sourceRef="_5" targetRef="_6" name="yes" > <conditionExpression xsi:type="tFormalExpression" language="http://www.java.com/java" >System.out.println("yes"); return num > 100;</conditionExpression> </sequenceFlow> <sequenceFlow id="_5-_7" sourceRef="_5" targetRef="_7" name="no" > <conditionExpression xsi:type="tFormalExpression" language="http://www.java.com/java" >System.out.println("no"); return num <= 100;</conditionExpression> </sequenceFlow> <sequenceFlow id="_6-_8" sourceRef="_6" targetRef="_8" /> <sequenceFlow id="_7-_8" sourceRef="_7" targetRef="_8" /> </process> <bpmndi:BPMNDiagram> <bpmndi:BPMNPlane bpmnElement="com.sample.bpmn.hello" > <bpmndi:BPMNShape bpmnElement="_1" > <dc:Bounds x="88" y="16" width="48" height="48" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="_2" > <dc:Bounds x="72" y="96" width="80" height="48" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="_3" > <dc:Bounds x="88" y="498" width="48" height="48" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="_4" > <dc:Bounds x="72" y="418" width="80" height="48" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="_5" > <dc:Bounds x="88" y="176" width="48" height="48" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="_6" > <dc:Bounds x="16" y="257" width="80" height="48" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="_7" > <dc:Bounds x="128" y="257" width="80" height="48" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="_8" > <dc:Bounds x="88" y="337" width="48" height="48" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge bpmnElement="_1-_2" > <di:waypoint x="112" y="40" /> <di:waypoint x="112" y="120" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="_4-_3" > <di:waypoint x="112" y="442" /> <di:waypoint x="112" y="522" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="_8-_4" > <di:waypoint x="112" y="361" /> <di:waypoint x="112" y="442" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="_2-_5" > <di:waypoint x="112" y="120" /> <di:waypoint x="112" y="200" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="_5-_6" > <di:waypoint x="112" y="200" /> <di:waypoint x="56" y="281" /> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="_5-_7" >
相关文章推荐
- Microsoft NLayerApp案例理论与实践 - 项目简“.NET研究”介与环境搭建
- 借助webview实现apk文件转换之环境部署与项目搭建
- nodejs+express搭建电影网站之二 -----具体项目结构 开发环境的建立 测试页面流程跑通
- 在vc++上简单搭建环境(包括文件引用)
- 一个简单的dubbo项目搭建案例
- Python学习1(环境搭建、文件格式与简单编程)
- django开发环境搭建和创建一个简单的django项目
- Activiti环境配置、项目搭建、与Spring集成、简单示例
- 区块链开源项目Ripple一、简单介绍与环境搭建,部署
- Activiti环境配置、项目搭建、与Spring集成、简单示例
- 简单的hibernate环境搭建、自动生成model/配置/hibernate.xml配置文件
- Aooms_基于SpringCloud的微服务基础开发平台实战_003_配置文件与简单的web环境搭建
- Android开发环境搭建和项目各文件介绍应用安装和启动过程
- eclipse+drools 6.5开发环境搭建,以及创建一个简单的drools项目
- rails学习之windows下环境搭建及项目创建(图文并茂,简单易懂)
- 在rhel6下搭建简单Nexus+svn项目管理环境
- SpringMVC学习使用一:搭建简单的SpringMVC开发项目环境并使用
- Android JNI(NDK)简单学习(环境搭建,创建一个JNI项目的基本流程)
- 64位WIN7下Android 开发环境搭建(SDK Manager闪退,无法更新sdk,建立新项目时无法正常自动生成Activity的问题解决)
- 项目建立ubuntu 搭建 Jekyll环境