package com.sample;
import junit.framework.TestCase;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
public class SimpleProcessTest extends TestCase {
public void testSimpleProcess() throws Exception {
// Extract a process definition from the processdefinition.xml file.
ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("simple/processdefinition.xml");
assertNotNull("Definition should not be null", processDefinition);
// Create an instance of the process definition.
ProcessInstance instance = new ProcessInstance(processDefinition);
assertEquals(
"Instance is in start state",
instance.getRootToken().getNode().getName(),
"start");
assertNull(
"Message variable should not exist yet",
instance.getContextInstance().getVariable("message"));
// Move the process instance from its start state to the first state.
// The configured action should execute and the appropriate message
// should appear in the message process variable.
instance.signal();
assertEquals(
"Instance is in first state",
instance.getRootToken().getNode().getName(),
"first");
assertEquals(
"Message variable contains message",
instance.getContextInstance().getVariable("message"),
"Going to the first state!");
// Move the process instance to the end state. The configured action
// should execute again. The message variable contains a new value.
instance.signal();
assertEquals(
"Instance is in end state",
instance.getRootToken().getNode().getName(),
"end");
assertTrue("Instance has ended", instance.hasEnded());
assertEquals(
"Message variable is changed",
instance.getContextInstance().getVariable("message"),
"About to finish!");
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
李腾飞jbpm.rar (96个子文件)
jbpm_test01
bin
jbpm.mail.templates.xml 759B
simple
gpd.xml 478B
processdefinition.xml 702B
processimage.jpg 18KB
test01
gpd.xml 813B
processdefinition.xml 899B
processimage.jpg 23KB
log4j.properties 1KB
com
sample
action
MessageActionHandler.class 935B
SimpleProcessTest.class 2KB
bjsxt
jbpm
Jbpm_02_DeployProcessDefinition.class 1KB
Document.class 1KB
Jbpm_06_SearchMyTaskList.class 3KB
Jbpm_07_NextNode.class 3KB
Jbpm_03_CreateDocument.class 2KB
Jbpm_04_SubmitDocument.class 2KB
Jbpm_01_CreateTable.class 519B
Jbpm_05_CurrentNode.class 2KB
Document.hbm.xml 574B
jbpm.cfg.xml 299B
hibernate.cfg.xml 10KB
src
test
java
com
sample
SimpleProcessTest.java 2KB
main
config
jbpm.mail.templates.xml 759B
log4j.properties 1KB
jbpm.cfg.xml 299B
hibernate.cfg.xml 10KB
jpdl
simple
gpd.xml 478B
processdefinition.xml 702B
processimage.jpg 18KB
test01
gpd.xml 813B
processdefinition.xml 899B
processimage.jpg 23KB
java
com
sample
action
MessageActionHandler.java 702B
bjsxt
jbpm
Jbpm_07_NextNode.java 2KB
Jbpm_04_SubmitDocument.java 1KB
Document.java 705B
Jbpm_05_CurrentNode.java 1KB
Jbpm_02_DeployProcessDefinition.java 952B
Jbpm_01_CreateTable.java 279B
Jbpm_06_SearchMyTaskList.java 1KB
Jbpm_03_CreateDocument.java 2KB
Document.hbm.xml 574B
.project 387B
.classpath 528B
jbpm_test02
bin
test02
gpd.xml 1KB
processdefinition.xml 1KB
processimage.jpg 26KB
jbpm.mail.templates.xml 759B
simple
gpd.xml 478B
processdefinition.xml 702B
processimage.jpg 18KB
test01
gpd.xml 813B
processdefinition.xml 899B
processimage.jpg 23KB
log4j.properties 1KB
com
sample
action
MessageActionHandler.class 935B
SimpleProcessTest.class 2KB
bjsxt
jbpm
Persistence.class 2KB
Jbpm_02_DeployProcessDefinition.class 2KB
Document.class 1KB
Jbpm_06_SearchMyTaskList.class 3KB
Jbpm_07_NextNode.class 3KB
Jbpm_03_CreateDocument.class 3KB
Jbpm_04_SubmitDocument.class 2KB
Jbpm_01_CreateTable.class 519B
Jbpm_05_CurrentNode.class 2KB
Document.hbm.xml 574B
jbpm.cfg.xml 299B
hibernate.cfg.xml 10KB
src
test
java
com
sample
SimpleProcessTest.java 2KB
main
config
jbpm.mail.templates.xml 759B
log4j.properties 1KB
jbpm.cfg.xml 299B
hibernate.cfg.xml 10KB
jpdl
test02
gpd.xml 1KB
processdefinition.xml 1KB
processimage.jpg 26KB
simple
gpd.xml 478B
processdefinition.xml 702B
processimage.jpg 18KB
test01
gpd.xml 813B
processdefinition.xml 899B
processimage.jpg 23KB
java
com
sample
action
MessageActionHandler.java 702B
bjsxt
jbpm
Jbpm_07_NextNode.java 2KB
Jbpm_04_SubmitDocument.java 1KB
Document.java 705B
Jbpm_05_CurrentNode.java 1KB
Jbpm_02_DeployProcessDefinition.java 1KB
Jbpm_01_CreateTable.java 279B
Jbpm_06_SearchMyTaskList.java 1KB
Persistence.java 1KB
Jbpm_03_CreateDocument.java 2KB
Document.hbm.xml 574B
.project 387B
.classpath 528B
共 96 条
- 1
资源评论
- orientjava2012-09-24还行,test02有错误,获取系统临时目录为tmp而不是tem
huyqcq
- 粉丝: 2
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- QuestionTwo.java
- QuestionOne.java
- OA办公自动化管理系统(Struts1.2+Hibernate3.0+Spring2+DWR).rar
- 简历-求职简历-word-文件-简历模版免费分享-应届生-高颜值简历模版-个人简历模版-简约大气-大学生在校生-求职-实习
- 南京邮电大学数学实验:熟练掌握 Matlab 软件的基本命令和操作
- 简历-求职简历-word-文件-简历模版免费分享-应届生-高颜值简历模版-个人简历模版-简约大气-大学生在校生-求职-实习
- 2017校招真题校园招聘真题算法题(37道)Python源码.zip
- 基于单片机protues仿真的多功能自动饮水机系统设计(仿真图、源代码、演示视频)
- 论文《一种修复流程挖掘事件日志中缺失活动标签的深度学习方法》翻译
- 智慧电厂相关资料发电控制的方式
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功