- 浏览: 3420853 次
- 性别:
- 来自: 珠海
文章分类
- 全部博客 (1633)
- Java (250)
- Android&HTML5 (111)
- Struts (10)
- Spring (236)
- Hibernate&MyBatis (115)
- SSH (49)
- jQuery插件收集 (55)
- Javascript (145)
- PHP (77)
- REST&WebService (18)
- BIRT (27)
- .NET (7)
- Database (105)
- 设计模式 (16)
- 自动化和测试 (19)
- Maven&Ant (43)
- 工作流 (36)
- 开源应用 (156)
- 其他 (16)
- 前台&美工 (119)
- 工作积累 (0)
- OS&Docker (83)
- Python&爬虫 (28)
- 工具软件 (157)
- 问题收集 (61)
- OFbiz (6)
- noSQL (12)
最新评论
-
HEZR曾嶸:
你好博主,这个不是很理解,能解释一下嘛//左边+1,上边+1, ...
java 两字符串相似度计算算法 -
天使建站:
写得不错,可以看这里,和这里的这篇文章一起看,有 ...
jquery 遍历对象、数组、集合 -
xue88ming:
很有用,谢谢
@PathVariable映射出现错误: Name for argument type -
jnjeC:
厉害,困扰了我很久
MyBatis排序时使用order by 动态参数时需要注意,用$而不是# -
TopLongMan:
非常好,很实用啊。。
PostgreSQL递归查询实现树状结构查询
http://atulkotwale.blogspot.com/2012/01/dynamic-process-creation-using-api-jbpm.html
Hi Friends,
As you guys all know jbpm has came up with new version. It has some beautiful features. In this post I will show you how can we make dyanamic process using JBPM 5 API. While it is recommended to define processes using the graphical editor or the underlying XML (to shield yourself from internal APIs) but sometime we come across such scenario where this feature would really helpful.
Using this API you can
Create process and set the attributes.
Create task and add to that process. Also you can set the task related attributes.
Establish connections between task.
Get the xml representation of process.
Last but not least we can validation the process and can get the list of errors which were found during validation.
Isn't it great!!!! Let see how can we do it.
Here I created simple process with human task .
As you can see in the example that we can create process using "createProcess" method if "RuleFlowProcessFactory" class. This class also provides method to set the attributes of the process. It provides method to create start, end node.you can see that these methods return a specific NodeFactory, that allows you to set the properties of that node. Once you have finished configuring that specific node, the done() method returns you to the current RuleFlowProcessFactory so you can add more nodes, if necessary. Using "connection" method we can establish connections between the task.
Using following code we can get xml presentation of the process.
Finally once you done with creation of the process, you can validate the process by validate() method.
We can add the process in to the knowledge base as BPMN2 process.
Please let me know your view and suggestion to make this post better !!!
Hi Friends,
As you guys all know jbpm has came up with new version. It has some beautiful features. In this post I will show you how can we make dyanamic process using JBPM 5 API. While it is recommended to define processes using the graphical editor or the underlying XML (to shield yourself from internal APIs) but sometime we come across such scenario where this feature would really helpful.
Using this API you can
Create process and set the attributes.
Create task and add to that process. Also you can set the task related attributes.
Establish connections between task.
Get the xml representation of process.
Last but not least we can validation the process and can get the list of errors which were found during validation.
Isn't it great!!!! Let see how can we do it.
Here I created simple process with human task .
package com.sample; import org.drools.KnowledgeBase; import org.drools.builder.KnowledgeBuilder; import org.drools.builder.KnowledgeBuilderFactory; import org.drools.builder.ResourceType; import org.drools.io.ResourceFactory; import org.drools.runtime.StatefulKnowledgeSession; import org.jbpm.bpmn2.xml.XmlBPMNProcessDumper; import org.jbpm.process.workitem.wsht.WSHumanTaskHandler; import org.jbpm.ruleflow.core.RuleFlowProcessFactory; import org.jbpm.ruleflow.core.factory.HumanTaskNodeFactory; /** * This is a sample file to launch a process. */ public class ProcessTest { public static final void main(String[] args) { try { RuleFlowProcessFactory factory = RuleFlowProcessFactory.createProcess("org.jbpm.createLetter"); //creating process dynamically factory = factory.name("LetterCreation").version("1.0") .packageName("org.atul"); // adding start node factory.startNode(1).name("start").done(); // adding human task HumanTaskNodeFactory nodefactory = factory.humanTaskNode(2); nodefactory.name("atul").actorId("department").done(); // adding end node factory.endNode(3).name("end").done(); // making connections factory.connection(1, 2); factory.connection(2, 3); System.out.println("id is:-" + factory.validate().getProcess().getId()); // We can get xml for the process using following code. String asXml = XmlBPMNProcessDumper.INSTANCE.dump( factory.getProcess(), XmlBPMNProcessDumper.NO_META_DATA); System.out.println(asXml); //adding to the knowledge base KnowledgeBuilder kbuilder = KnowledgeBuilderFactory .newKnowledgeBuilder(); kbuilder.add(ResourceFactory .newByteArrayResource(XmlBPMNProcessDumper.INSTANCE.dump( factory.getProcess()).getBytes()), ResourceType.BPMN2); StatefulKnowledgeSession ksession = kbuilder.newKnowledgeBase() .newStatefulKnowledgeSession(); ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new WSHumanTaskHandler()); // start a new process instance ksession.startProcess("org.jbpm.createLetter"); } catch (Throwable t) { t.printStackTrace(); } } }
As you can see in the example that we can create process using "createProcess" method if "RuleFlowProcessFactory" class. This class also provides method to set the attributes of the process. It provides method to create start, end node.you can see that these methods return a specific NodeFactory, that allows you to set the properties of that node. Once you have finished configuring that specific node, the done() method returns you to the current RuleFlowProcessFactory so you can add more nodes, if necessary. Using "connection" method we can establish connections between the task.
Using following code we can get xml presentation of the process.
String asXml = XmlBPMNProcessDumper.INSTANCE.dump( factory.getProcess(), XmlBPMNProcessDumper.NO_META_DATA);
Finally once you done with creation of the process, you can validate the process by validate() method.
We can add the process in to the knowledge base as BPMN2 process.
kbuilder.add(ResourceFactory .newByteArrayResource(XmlBPMNProcessDumper.INSTANCE.dump( factory.getProcess()).getBytes()), ResourceType.BPMN2);
Please let me know your view and suggestion to make this post better !!!
发表评论
-
drools 规则文件 —— 语法
2014-06-09 21:53 3415原文:http://liureying.blog.163.co ... -
使用eclipse创建bpmn2文件的一些问题
2014-06-07 15:18 1728使用bpmn2 diagram Editor编辑器的问题 1 ... -
JBPM6入门资料: Spring4 + Hibernate4 + JBPM6整合
2014-05-21 19:39 18772参考资料: =============== ... -
我的Activiti例子
2013-09-21 15:01 6897Spring 与Activiti的入门整合 http://ww ... -
各种状态的任务查询以及和业务对象关联
2013-09-21 14:26 1942http://www.kafeitu.me/activiti/ ... -
Activiti: 三种部署方式和几种启动方式
2013-09-20 00:24 4715三种部署: 1.自动部署: <property name ... -
Activiti modeler 国际化要点
2013-09-18 15:33 25401. 界面文本:src/main/resources/sten ... -
两篇整合Activiti Modeler到业务系统
2013-09-17 14:29 8694整合Activiti Modeler到业务系统(或BPM平台) ... -
Activiti5.12共22张表
2013-09-17 14:10 1959(1)用户管理表 ACT_ID_GROUP; ... -
Activiti: 关于表单的一些接口
2013-09-17 09:31 2480获得流程启动的时候的表单信息 ProcessInstance ... -
Activiti5: TaskQuery查询API
2013-09-16 13:34 3464http://blog.csdn.net/iflow/arti ... -
第一个Activiti5.13 + Spring3.x例子
2013-09-16 13:24 2355参考: http://www.iteye.com/topic/ ... -
kft-activiti-demo: 部署记录
2013-09-13 17:36 20082.SpringMvc + Activiti + Hibern ... -
SSH 整合 Activiti
2013-09-09 14:45 2015原文:http://blog.chinaunix.net/ui ... -
Activiti BPM Platform工作流的一些资料
2013-09-03 16:07 2925Activiti官方: http://www.activiti ... -
JBPM5.4发送email
2013-05-29 15:57 2073JBPM5.4配置参考: http://panyongzhen ... -
Spring3.1 + Hibernate4.2.1 + JBPM5.4 + Ehache整合例子
2013-05-29 11:17 9471pom.xml ----------------------- ... -
JBPM5 Designer 2.3源码问题
2013-05-24 09:50 2336最新本2.4发布,但是里面是使用Maven的module方式来 ... -
Spring 3 & jBPM 5 & LocalTaskService
2013-05-24 09:52 1819帖子地址:https://community.jboss.or ... -
JBPM Designer 部署
2013-05-24 09:53 1627版本:2.4 把war放到tomcat下面之后,进入的url是 ...
相关推荐
jbpm5.1是Java Business Process Management(Java业务流程管理)的一个版本,它是一个开源的工作流管理系统,由JBoss社区开发并维护。该系统基于Drools,一个强大的规则引擎,使得jbpm5.1在处理业务流程时具有灵活...
5. **持久化**:jbpm5.1利用JPA(Java Persistence API)实现数据持久化,确保流程实例和历史数据的安全存储。 **三、学习资源介绍** 1. **jBPM5_用户手册-中文版.doc**:这是一份中文版的用户手册,详细介绍了jbpm...
- jBPM (Java Business Process Model) 是一款高度灵活的业务流程管理 (BPM) 套件,旨在为业务分析师与开发人员之间搭建一座桥梁。 - 与传统 BPM 引擎相比,jBPM 不仅仅关注技术层面,同时也重视非技术人员的使用...
### jBPM 5.1 入门手册详解 #### 一、jBPM 概述 jBPM 是一款灵活且强大的业务流程管理(BPM)解决方案,它旨在搭建起业务分析师与软件开发者之间的桥梁。传统的 BPM 引擎往往侧重于技术细节,对非技术人员不够友好...
官方指南加+API文档,手工下载,手工打包CHM
3. **流程定义与执行**:书中详细阐述了如何使用JBoss jBPM定义业务流程,并解释了如何通过API调用来启动和管理这些流程实例。此外,还涉及到了任务分配、消息传递等高级功能,帮助读者深入理解jBPM的工作原理。 4....
《Business Process Management with JBoss jBPM》一书由Matt Cumberlidge撰写,旨在为业务分析师提供实用指南,教授如何利用JBoss jBPM平台构建高效的业务流程。 #### 二、业务流程管理(BPM)概述 业务流程管理...
jbpm(Java Business Process Management)是一款开源的工作流管理系统,它允许开发者设计、执行和管理业务流程。这个API文档是开发者理解和使用jbpm进行流程自动化开发的重要参考资料。 在jbpm 5.4.0.Final版本中...
### jBPM4.4 API 详解:工作流自动化的核心技术 #### 一、工作流基础知识 工作流,作为业务过程的部分或整体自动化,旨在通过计算机应用环境实现文档、信息或任务在多个参与者间的自动传递,以达到预期的业务目标...
jbPM 5.1是其一个版本,提供了一套完整的工具集,包括流程建模、部署、执行以及监控等功能。以下是jbPM 5.1的一些关键知识点: 1. **jbPM 下载与安装**: - 可从SourceForge.net下载jbPM的二进制文件、源码、...
**JBPM 6.0.1 API:流程自动化与业务规则管理详解** JBPM,全称为JBoss Business Process Management,是Red Hat公司提供的一款开源的工作流管理系统,它为企业的业务流程自动化提供了强大的支持。JBPM 6.0.1 API是...
JBPM(Java Business Process Management)是一个开源的工作流和业务流程管理系统,它允许开发者设计、执行、管理和监控复杂的业务流程。这个压缩包“JBPM工作流程API和Jar.zip”包含的是JBPM的相关API文档和必要的...
【JBPM4.4 API】是Java Business Process Management(JBPM)系统的一个版本,它提供了一个全面的工作流和业务流程管理框架。JBPM是一个开源项目,由Red Hat维护,广泛应用于企业级应用中,用于管理和执行业务流程。...
**JBPM5.3 API+USERGUID** JBPM5.3是Java Business Process Management(Java工作流管理系统)的一个重要版本,它提供了一整套用于设计、执行和管理业务流程的框架和服务。API(应用程序编程接口)是软件开发的核心...
jbpm(Java Business Process Management)是一款开源的工作流管理系统,专为业务流程自动化设计,提供了强大的工作流引擎和API,用于实现复杂的业务流程管理。jbpm3.1版本是其早期的一个重要版本,尽管现在jbpm已经...