- 浏览: 163613 次
- 性别:
- 来自: 北京
最新评论
-
pg_caolei:
楼主,刚才是为了测试一下提供的功能,不小心点提交了,见谅。呵呵 ...
吐一个泡泡 -
pg_caolei:
[b][/b][i][/i]引用[*][img][/img][ ...
吐一个泡泡 -
logcos:
看不明白。
jbpm 项目实践 1.2 (集成appfuse spring modules) -
flyffa:
sorry,应该是更符合Structured Synchron ...
jbpm 与 工作流模式 鉴别器(Discriminator) -
flyffa:
这个模式好像实现的有问题吧,按照workflow patter ...
jbpm 与 工作流模式 鉴别器(Discriminator)
工作流模式
本文以jdpl/jar/src/test/java jbpm3 关于workflow patterns 说明 jbpm 对 workflow patterns 的实现示例.
基本控制模式 (Basic Control Flow Patterns)
顺序 (sequence)
Description : An activity in a workow process is enabled after the completion of another
activity in the same process.
描述: : 同一个流程中, 一个活动在其他活动完成以后才能发生.
同义词 : Sequential routing, serial routing.
<process-definition><start-state name="start"><state name="a"><state name="b"><state name="c">流程定义文件如下
</state></state></state></start-state></process-definition>
<process-definition><start-state name="start"><state name="a"><state name="b"><state name="c">
本例中包括start , a , b ,c ,end 四个node. token.signal() 可以理解为流程中当前节点(token对应节点) 活动结束. 代码一目了然. 不需要过多解释.
并行分支(Parallet Split)
Description : A point in the workow process where a single thread of control splits into multiple threads of control which can be executed in parallel, thus allowing activities to be executed simultaneously or in any order.
描述 : 在分支点上,一个工作流程执行线程 分出多个执行线程同时并行执行, 多个分支线程可以同时以任意顺序执行.
同义词: AND-split, parallel routing, fork.
</state></state></state></start-state></process-definition>
流程定义文件:
节点流程 start --> and --> a
-- > b
本例中and --a , and --> b 一定回被执行. 所以判断如下
Token firstToken = root.getChild( "first" );
assertNotNull( firstToken );
并行分支 (AND-Split ) 多以 同步聚合((Synchronization) 结束.
同步聚合(Synchronization)
Description : A point in the workow process where multiple parallel subprocesses/activities converge into one single thread of control, thus synchronizing multiple threads. It is an assumption of this pattern that each incoming branch of a synchronizer is executed only once
描述: 一个汇聚点, 多路工作流成执行线程汇聚成单个工作流执行线程. 只有汇聚线程都执行完毕,改汇聚点聚合后的单一线程才会执行.
同义词: AND-join, rendezvous, synchronizer.
本文以jdpl/jar/src/test/java jbpm3 关于workflow patterns 说明 jbpm 对 workflow patterns 的实现示例.
基本控制模式 (Basic Control Flow Patterns)
顺序 (sequence)
Description : An activity in a workow process is enabled after the completion of another
activity in the same process.
描述: : 同一个流程中, 一个活动在其他活动完成以后才能发生.
同义词 : Sequential routing, serial routing.
java 代码
- /*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
- package org.jbpm.jpdl.patterns;
- import junit.framework.TestCase;
- import org.jbpm.graph.def.ProcessDefinition;
- import org.jbpm.graph.exe.ProcessInstance;
- import org.jbpm.graph.exe.Token;
- /**
- * http://is.tm.tue.nl/research/patterns/download/swf/pat_1.swf
- */
- public class Wfp01SequenceTest extends TestCase {
- public void testSequence() {
- // create a simple definition with 3 states in sequence
- ProcessDefinition pd = ProcessDefinition.parseXmlString(
- " <process-definition>"</process-definition> +
- " +
- " +
- " " +
- " +
- " +
- " " +
- " +
- " +
- " " +
- " +
- " +
- " " +
- " +
- ""
- );
- ProcessInstance pi = new ProcessInstance( pd );
- pi.signal();
- Token token = pi.getRootToken();
- assertSame( pd.getNode("a"), token.getNode() );
- token.signal();
- assertSame( pd.getNode("b"), token.getNode() );
- token.signal();
- assertSame( pd.getNode("c"), token.getNode() );
- token.signal();
- assertSame( pd.getNode("end"), token.getNode() );
- }
- }
<process-definition><start-state name="start"><state name="a"><state name="b"><state name="c">流程定义文件如下
</state></state></state></start-state></process-definition>
xml 代码
- <process-definition>
- <start-state name='start'>
- <transition to='a' />
- <!---->start-state>
- <state name='a'>
- <transition to='b' />
- <!---->state>
- <state name='b'>
- <transition to='c' />
- <!---->state>
- <state name='c'>
- <transition to='end' />
- <!---->state>
- <end-state name='end' />
- <!---->process-definition>
<process-definition><start-state name="start"><state name="a"><state name="b"><state name="c">
本例中包括start , a , b ,c ,end 四个node. token.signal() 可以理解为流程中当前节点(token对应节点) 活动结束. 代码一目了然. 不需要过多解释.
并行分支(Parallet Split)
Description : A point in the workow process where a single thread of control splits into multiple threads of control which can be executed in parallel, thus allowing activities to be executed simultaneously or in any order.
描述 : 在分支点上,一个工作流程执行线程 分出多个执行线程同时并行执行, 多个分支线程可以同时以任意顺序执行.
同义词: AND-split, parallel routing, fork.
</state></state></state></start-state></process-definition>
java 代码
- /*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
- package org.jbpm.jpdl.patterns;
- import junit.framework.TestCase;
- import org.jbpm.graph.def.ProcessDefinition;
- import org.jbpm.graph.exe.ProcessInstance;
- import org.jbpm.graph.exe.Token;
- /**
- * http://is.tm.tue.nl/research/patterns/download/swf/pat_2.swf
- */
- public class Wfp02ParallelSplitTest extends TestCase {
- public void testParallelSplit() {
- ProcessDefinition pd = ProcessDefinition.parseXmlString(
- " <process-definition>"</process-definition> +
- " +
- " +
- " " +
- " +
- " +
- " +
- " " +
- " +
- " +
- ""
- );
- ProcessInstance pi = new ProcessInstance( pd );
- pi.signal();
- Token root = pi.getRootToken();
- assertNotNull( root );
- Token firstToken = root.getChild( "first" );
- assertNotNull( firstToken );
- assertSame( pd.getNode("a"), firstToken.getNode() );
- Token secondToken = root.getChild( "second" );
- assertNotNull( secondToken );
- assertSame( pd.getNode("b"), secondToken.getNode() );
- }
- }
流程定义文件:
xml 代码
- <process-definition>
- <start-state name='start'>
- <transition to='and' />
- <!---->start-state>
- <fork name='and'>
- <transition name='first' to='a' />
- <transition name='second' to='b' />
- <!---->fork>
- <state name='a' />
- <state name='b' />
- <!---->process-definition>"
节点流程 start --> and --> a
-- > b
本例中and --a , and --> b 一定回被执行. 所以判断如下
Token firstToken = root.getChild( "first" );
assertNotNull( firstToken );
并行分支 (AND-Split ) 多以 同步聚合((Synchronization) 结束.
同步聚合(Synchronization)
Description : A point in the workow process where multiple parallel subprocesses/activities converge into one single thread of control, thus synchronizing multiple threads. It is an assumption of this pattern that each incoming branch of a synchronizer is executed only once
描述: 一个汇聚点, 多路工作流成执行线程汇聚成单个工作流执行线程. 只有汇聚线程都执行完毕,改汇聚点聚合后的单一线程才会执行.
同义词: AND-join, rendezvous, synchronizer.
java 代码
- /*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
- package org.jbpm.jpdl.patterns;
- import junit.framework.*;
- import org.jbpm.graph.def.*;
- import org.jbpm.graph.exe.*;
- /**
- * http://is.tm.tue.nl/research/patterns/download/swf/pat_3.swf
- */
- public class Wfp03SynchronizationTest extends TestCase {
- public ProcessDefinition createSynchronizationProcessDefinition() {
- ProcessDefinition pd = ProcessDefinition.parseXmlString(
- " <process-definition>"</process-definition> +
- " +
- " +
- " " +
- " +
- " +
- " +
- " " +
- " +
- " +
- " " +
- " +
- " +
- " " +
- " +
- " +
- " " +
- " +
- ""
- );
- return pd;
- }
- public void testSynchronizationFirstTokenFirst() {
- ProcessDefinition pd = createSynchronizationProcessDefinition();
- ProcessInstance pi = new ProcessInstance( pd );
- pi.signal();
- Token root = pi.getRootToken();
- Token firstToken = root.getChild( "first" );
- Token secondToken = root.getChild( "second" );
- // check that the two tokens are in the states one and two respectively
- assertSame( pd.getNode("fork"), root.getNode() );
- assertSame( pd.getNode("one"), firstToken.getNode() );
- assertSame( pd.getNode("two"), secondToken.getNode() );
- firstToken.signal();
- assertSame( pd.getNode("fork"), root.getNode() );
- assertSame( pd.getNode("join"), firstToken.getNode() );
- assertSame( pd.getNode("two"), secondToken.getNode() );
- secondToken.signal();
- assertSame( pd.getNode("end"), root.getNode() );
- assertSame( pd.getNode("join"), firstToken.getNode() );
- assertSame( pd.getNode("join"), secondToken.getNode() );
- }
- /**
- * variation of the pattern where the second token fires first.
- */
- public void testSynchronizationSecondTokenFirst() {
- ProcessDefinition pd = createSynchronizationProcessDefinition();
- ProcessInstance pi = new ProcessInstance( pd );
- pi.signal();
- Token root = pi.getRootToken();
- Token firstToken = root.getChild( "first" );
- Token secondToken = root.getChild( "second" );
- // check that the two tokens are in the states one and two respectively
- assertSame( pd.getNode("fork"), root.getNode() );
- assertSame( pd.getNode("one"), firstToken.getNode() );
- assertSame( pd.getNode("two"), secondToken.getNode() );
- secondToken.signal();
- assertSame( pd.getNode("fork"), root.getNode() );
- assertSame( pd.getNode("one"), firstToken.getNode() );
- assertSame( pd.getNode("join"), secondToken.getNode() );
- firstToken.signal();
- assertSame( pd.getNode("end"), root.getNode() );
- assertSame( pd.getNode("join"), firstToken.getNode() );
- assertSame( pd.getNode("join"), secondToken.getNode() );
- }
- /**
- * nested form of the synchronization pattern.
- */
- public ProcessDefinition createNestedSynchronizationProcessDefinition() {
- // tip : draw this visually if you want to understand it.
- ProcessDefinition pd = new ProcessDefinition(
- new String[]{"start-state start",
- "fork fork",
- "fork fork1",
- "fork fork2",
- "state state1.1",
- "state state1.2",
- "state state2.1",
- "state state2.2",
- "join join2",
- "join join1",
- "join join",
- "end-state end"},
- new String[]{"start --> fork",
- "fork --first--> fork1",
- "fork --second--> fork2",
- "fork1 --first--> state1.1",
- "fork1 --second--> state1.2",
- "fork2 --first--> state2.1",
- "fork2 --second--> state2.2",
- "state1.1 --> join1",
- "state1.2 --> join1",
- "state2.1 --> join2",
- "state2.2 --> join2",
- "join1 --> join",
- "join2 --> join",
- "join --> end"});
- return pd;
- }
- public void testSynchronizationNested() {
- ProcessDefinition pd = createNestedSynchronizationProcessDefinition();
- ProcessInstance pi = new ProcessInstance( pd );
- pi.signal();
- Token rootToken = pi.getRootToken();
- Token token1 = rootToken.getChild( "first" );
- Token token2 = rootToken.getChild( "second" );
- Token token11 = token1.getChild( "first" );
- Token token12 = token1.getChild( "second" );
- Token token21 = token2.getChild( "first" );
- Token token22 = token2.getChild( "second" );
- assertSame( pd.getNode("fork"), rootToken.getNode() );
- assertSame( pd.getNode("fork1"), token1.getNode() );
- assertSame( pd.getNode("fork2"), token2.getNode() );
- assertSame( pd.getNode("state1.1"), token11.getNode() );
- assertSame( pd.getNode("state1.2"), token12.getNode() );
- assertSame( pd.getNode("state2.1"), token21.getNode() );
- assertSame( pd.getNode("state2.2"), token22.getNode() );
- token11.signal();
- assertSame( pd.getNode("fork"), rootToken.getNode() );
- assertSame( pd.getNode("fork1"), token1.getNode() );
- assertSame( pd.getNode("fork2"), token2.getNode() );
- assertSame( pd.getNode("join1"), token11.getNode() );
- assertSame( pd.getNode("state1.2"), token12.getNode() );
- assertSame( pd.getNode("state2.1"), token21.getNode() );
- assertSame( pd.getNode("state2.2"), token22.getNode() );
- token12.signal();
- assertSame( pd.getNode("fork"), rootToken.getNode() );
- assertSame( pd.getNode("join"), token1.getNode() );
- assertSame( pd.getNode("fork2"), token2.getNode() );
- assertSame( pd.getNode("join1"), token11.getNode() );
- assertSame( pd.getNode("join1"), token12.getNode() );
- assertSame( pd.getNode("state2.1"), token21.getNode() );
- assertSame( pd.getNode("state2.2"), token22.getNode() );
- token21.signal();
- assertSame( pd.getNode("fork"), rootToken.getNode() );
- assertSame( pd.getNode("join"), token1.getNode() );
- assertSame( pd.getNode("fork2"), token2.getNode() );
- assertSame( pd.getNode("join1"), token11.getNode() );
- assertSame( pd.getNode("join1"), token12.getNode() );
- assertSame( pd.getNode("join2"), token21.getNode() );
- assertSame( pd.getNode("state2.2"), token22.getNode() );
- token22.signal();
- assertSame( pd.getNode("end"), rootToken.getNode() );
- assertSame( pd.getNode("join"), token1.getNode() );
- assertSame( pd.getNode("join"), token2.getNode() );
- assertSame( pd.getNode("join1"), token11.getNode() );
- assertSame( pd.getNode("join1"), token12.getNode() );
- assertSame( pd.getNode("join2"), token21.getNode() );
- assertSame( pd.getNode("join2"), token22.getNode() );
- }
- }
发表评论
-
for download
2008-03-18 20:25 3http://www.softii.com/downinfo/ ... -
文档地址
2008-03-07 09:24 23http://wiki.redsaga.com/conflue ... -
jbpm 与 工作流模式 鉴别器(Discriminator)
2006-11-30 18:04 4223鉴别器(Discriminator) Description ... -
jbpm 与工作流模式 多路聚合(Multiple Merge)
2006-11-27 14:06 2940多路聚合(Multiple Merge) Descripti ... -
jbpm与工作流模式 同步汇聚(Synchronizing Merge)
2006-11-24 18:56 2136同步汇聚(Synchronizing Me ... -
jbpm 使用日记10
2006-11-24 18:05 1463日期: 第五周. 第五天. 经过了近一个多月的努 ... -
jbpm 使用日记9
2006-11-21 16:24 2507日期: 第五周 第 ... -
jbpm 使用日记8
2006-11-20 15:59 1416jbpm 用户组织结构 日期: 第五周, 第一天 ... -
jbpm 与 工作流模式 多路选择(Multiple Choice)
2006-11-17 16:01 7948多路选择(Multiple Choice) Descript ... -
jbpm 与 工作流模式 基本控制模式(三)
2006-11-16 20:25 4309好像源代码功能有点问题. /* * JBoss, Home ... -
jbpm 与 工作流模式 基本控制模式(二)
2006-11-16 20:18 5591xml 代码 <process-defi ... -
jbpm 使用日记7
2006-11-15 18:26 1172日期: 第四周 第二天 继续了一天理论知识学 ... -
jbpm 使用日记6 理论知识学习.
2006-11-13 10:54 1560日期: 第四周.第一天 经过jbpm 的一段时间研 ... -
jbpm 使用日记5 一个简单会签示例
2006-11-10 15:52 10049经过3周的努力,终于看到点收获的希望. 基本实现目前项目 ... -
jbpm 使用日记4
2006-11-09 17:49 1561用了整整一天的时间, 实现了个比较简单的会签的功能. ... -
jbpm 使用日记3
2006-11-08 12:01 5479又用了3天,终于对jbpm 集成有了一个比较明确的思路. ... -
jbpm 使用日记2
2006-11-02 14:39 1809改写 jbpm 自带的 应用 jsf 遇到很多问题和工作量. ... -
jbpm 使用日记1
2006-11-01 10:56 2021进度. 1.使用 jbpm 3.1.2 build jbpm. ...
相关推荐
**JBPM工作流详解** JBPM(Java Business Process Management)是一个开源的工作流管理系统,它提供了一整套解决方案,用于设计、执行和管理业务流程。在本示例中,我们将深入探讨如何利用JBPM实现销售批复这一具体...
**jbpm工作流简介** jbpm(Java Business Process Management)是一个开源的工作流管理系统,它提供了一整套解决方案,用于设计、执行和管理业务流程。jbpm不仅支持BPMN(Business Process Model and Notation)...
【jbpm工作流引擎介绍】 工作流引擎是用于自动化业务流程的软件系统,它通过预定义的流程模版,管理并执行诸如请假、报销、审批等业务操作。工作流引擎的核心功能包括流程定义、执行、管理和监控。在业界,工作流...
在这个名为"企业OA 完整的jbpm工作流实例"的项目中,开发者使用了Java SSH框架来构建了一个集成jbpm的工作流系统,特别适合初学者了解和学习工作流的实现。 SSH框架是Struts、Spring、Hibernate三个开源项目的首...
### jBPM4工作流应用开发指南:深入解析工作流技术与企业现代化管理 #### 工作流概览 工作流技术,作为一种先进的自动化手段,旨在优化和加速业务流程的执行,通过计算机辅助或自动化的手段,确保业务过程在正确的...
【jbpm工作流引擎介绍】 工作流引擎是用于自动化业务流程的软件,它负责定义、执行和管理这些流程。在企业环境中,常见的业务流程包括请假、报销、公文审批等。工作流引擎通过内置的人工任务功能,确保在流程自动化...
jBPM 是一个开源的工作流和业务流程管理系统,它支持BPMN2标准,可以创建、执行和监控复杂的业务流程。在智能工作流系统中,jBPM 负责流程的设计、执行和管理。开发者可以通过jBPM 设计流程图,定义任务、事件和决策...
- **完成对JBPM工作流引擎的深入了解**,掌握其核心技术和应用方法。 - **实现一系列定制化的功能模块**,满足特定业务场景的需求。 - **构建一套完整的办公自动化系统**,有效提升工作效率和服务水平。 - **积累...
jBPM4.4是一种流行的工作流引擎,它提供了一个强大且灵活的工作流管理系统。本指南将详细介绍jBPM4.4的安装、部署、使用、开发和原理等方面的知识点。 一、开发环境搭建 要开发jBPM4.4工作流,需要安装以下软件: ...
在本实例中,我们将深入探讨如何使用JBPM构建一个OA(Office Automation)工作流系统,同时结合SSH(Spring、Struts和Hibernate)框架进行整合,以实现高效、灵活的业务流程管理。 首先,我们需要理解JBPM的核心...
将Jbpm工作流与SSH框架集成,可以实现业务逻辑和数据持久化的高效协同,为复杂的企业应用提供流畅的流程控制。 集成Jbpm工作流和SSH框架的过程主要包括以下几个步骤: 1. **环境准备**:首先,确保已下载并安装了...
流程调度控制是工作流引擎的核心,JBPM中的运行标记(token)代表流程实例的一次执行,维护着流程设计的结构。流程实例的每个步骤都由工作流引擎根据流程定义自动控制,确保流程按照预定规则顺畅运行。 此外,任务...
配置文件是JBPM工作流框架的重要组成部分,它定义了JBPM的运行环境,并决定了如何与数据库交互以及其他系统服务的集成方式。 - **配置文件的重要性**:配置文件对于JBPM而言至关重要,它是工作流组件的一个主要入口...
【jbpm4.4+s2sh请假流程例子】是一个典型的结合了jbpm4.4工作流引擎和Struts2、Spring、Hibernate(S2SH)框架的实战项目,旨在演示如何在企业级应用中实现一个完整的请假流程。在这个例子中,jbpm4.4作为流程管理的...
这个工作流可能涵盖了文章的提交、审核、审批和发布等一系列步骤,通过jBPM定义和控制这些步骤的顺序和条件。同时,Struts处理用户请求,Spring负责组件管理,Hibernate管理数据持久化,整个系统协同工作,实现智能...
jbpm-designer是一款基于J2EE的轻量级工作流管理系统,它专为设计和管理业务流程而构建。jbpm-designer提供了一种图形化的用户界面,使得非技术人员也能轻松地设计复杂的业务流程,从而降低了流程管理的门槛。在本文...
### JBPM工作流管理系统知识点详解 #### 一、基本流程概念与实例执行概念 JBPM(JBoss Business Process Management)是Red Hat旗下的一款开源工作流引擎,它支持BPMN 2.0标准,用于自动化业务流程。JBPM提供了...