jpbm4.4之一个简单的流程(来自example的custom)
来源:互联网 发布:gs域名 编辑:程序博客网 时间:2024/05/22 10:29
1.
process.jpdl.xml(文件比寻以jpdl.xml结尾)
<?xml version="1.0" encoding="UTF-8"?>
<process name="Custom" xmlns="http://jbpm.org/4.4/jpdl">
<start g="20,20,48,48">
<transition to="print dots" />
</start>
<custom name="print dots"
class="org.jbpm.examples.custom.PrintDots"
g="96,16,100,52">
<transition to="mystate" name="to mystate"/>
</custom>
<state name="mystate" g="200,16,250,52">
<transition to="end" name="to end"/>
</state>
<end name="end" g="231,19,80,40"/>
</process>
public static void main(String[] args) {
ProcessEngine en=Configuration.getProcessEngine();RepositoryService rs=en.getRepositoryService();
ExecutionService executionService=en.getExecutionService();
//String deploymentId=rs.createDeployment().addResourceFromClasspath("com/zuowa/scpower/ivr/process.jpdl.xml").deploy();
//System.out.println("deploymentId"+deploymentId);
List<ProcessDefinition> definitions=rs.createProcessDefinitionQuery().list();//执行搜索
for (ProcessDefinition processDefinition : definitions) {
System.out.println(processDefinition.getId());
}
ProcessInstance processInstance = executionService.startProcessInstanceByKey("Custom"); //注意一启动就是print dots节点
System.out.println("流程实例Id:" + processInstance.getId()); //流程实例Id:Custom.340001
System.out.println("流程定义Id:" + processInstance.getProcessDefinitionId()); //流程定义Id:Custom-4
//
// // 判断当前是否位于state节点
System.out.println("是否位于print dots节点:" + processInstance.isActive("print dots")); //是否位于print dots节点:true
System.out.println("向下执行...");
Execution executionInPrintDots = processInstance.findActiveExecutionIn("print dots"); //先找到tockon流转到的节点,Execution 就是tockon
String executionId = executionInPrintDots.getId();
System.out.println("executionId=executionInPrintDots.getId():"+executionId+"\n executionInPrintDots"+executionInPrintDots); //executionId 就是流程实例Id:Custom.340001
System.out.println("当前流程是否位于mystate节点---->"+processInstanceMyState.isActive("mystate")); //当前流程是否位于mystate节点---->true
System.out.println("当前流程是否结束---->"+processInstanceMyState.isEnded()); //当前流程是否结束---->false
ProcessInstance endinstance=executionService.signalExecutionById(processInstanceMyState.getId()); ////在这里发信号,到了end就结束
System.out.println("当前流程是否结束---->"+endinstance.isEnded()); //当前流程是否结束---->true
print:
流程实例Id:Custom.340001
流程定义Id:Custom-4
是否位于print dots节点:true
向下执行...
executionId=executionInPrintDots.getId():Custom.340001
executionInPrintDotsexecution[Custom.340001]
当前流程是否位于mystate节点---->true
当前流程是否结束---->false
- jpbm4.4之一个简单的流程(来自example的custom)
- 实作一个简单自定义的View(一) -- A Simple Custom View Example (1)
- iphone 简单的 example -----
- Android开发之一个简单的通讯录实现(源码)
- Android之一个简单的NDK使用(一)
- Android之一个简单的NDK使用(二)
- javascript 之一个简单的画图demo
- kafka之一个简单的producer
- linux之一个简单的shell程序
- jsp之一个简单的计算器
- SpringMVC之一个简单的例子
- HTML5之一个简单的登录界面
- ABAP--Field Symbol 的Example(来自SAP的样例)
- ABAP--Field Symbol 的Example(来自SAP的样例)
- ABAP--Field Symbol 的Example(来自SAP的样例) .
- QBE Example 的简单使用
- OGRE中example程序的启动流程
- OSAL处理来自AF的数据包流程
- sql2005引用c#编写的程序集
- JQuery 无刷新查询
- linux 安装Nginx
- sharepoint 2007 隐藏左侧的导航栏
- Instagram 架构分析笔记
- jpbm4.4之一个简单的流程(来自example的custom)
- 第三章:Makefile 的规则
- c++强制类型转换
- 一些经典的计算机书籍
- Socket-Select
- linux下 合并优酷等网站视频
- layout-land资源文件夹无法识别
- /proc/sysrq-trigger文件的强大功能
- 异步套接字基础:select函数以及FD_ZERO、FD_SET、FD_CLR、FD_ISSET