??xml version="1.0" encoding="utf-8" standalone="yes"?>成人毛片免费,中文精品久久,天天射综合网站http://www.aygfsteel.com/Ericzhang5231/category/29308.htmlzh-cnMon, 04 Feb 2008 08:38:13 GMTMon, 04 Feb 2008 08:38:13 GMT60Chapter 1. Introductionhttp://www.aygfsteel.com/Ericzhang5231/articles/JBPMJPDL.htmlEric5231Eric5231Sun, 03 Feb 2008 06:33:00 GMThttp://www.aygfsteel.com/Ericzhang5231/articles/JBPMJPDL.htmlhttp://www.aygfsteel.com/Ericzhang5231/comments/179150.htmlhttp://www.aygfsteel.com/Ericzhang5231/articles/JBPMJPDL.html#Feedback0http://www.aygfsteel.com/Ericzhang5231/comments/commentRss/179150.htmlhttp://www.aygfsteel.com/Ericzhang5231/services/trackbacks/179150.html1.Overview
    JBoss jBPM is a flexible, extensible framework for process languages.
    jPDL is one process language that is build on top of that common framework. It has serval advantages:
        1.It is an intuitive process language to express business processes graphically in terms of tasks, wait states for asynchronous communication, timers, automated actions,... To         bind these operations together;
        2.jPDL has minimal dependencies and can be used as easy as using a java library;
        3.it can also be used in environments where extreme throughput is crucial by deploying it on a J2EE clustered application server;

2.The jPDL Kits

   

The starter kit is a download that contains all the jBPM components bundled in one easy download. The download includes:

  • runtime, the core jbpm component including the libs and this userguide.
  • server, a preconfigured jboss application server.
  • designer, the eclipse plugin for authoring jBPM processes graphically.
  • db, the jBPM database compatibility package (see below).
  • bpel, a reference to the JBoss jBPM BPEL extension.


3. Advantages of JBOSS JBPM

    3.1   The JBOSS jBPM has a graphical process designer, which can as a n eclipse plugin;
    3.2   The JBOSS jBPM core componet is based on J2SE, so it can be used in any java environment like e.g. a webapplication, a swing application, an EJB, a                 
            webservice...;
    3.3   The JBOSS jBPM console web application supplys a central user interface for interacting with runtime tasks generated by the process executions, and
            administration and monitoring console to inspect and manipulate runtime instance;
    3.4   The JBoss jBPM identity component;
    3.5   The JBoss jBPM scheduler monitors and executes timers that are scheduled during process executions(Configuring the scheduler servlet to spawn the monitoring thread or Starting up a separate JVM with the scheduler main);
    3.6   The JBoss jBPM database compatibility package;
    3.7   The JBoss jBPM BPEL extension is a separatly packaged extension that extends jBPM with support for BPEL;


Eric5231 2008-02-03 14:33 发表评论
]]>
jBPM开发入门指?2)(?http://www.aygfsteel.com/Ericzhang5231/articles/178808.htmlEric5231Eric5231Fri, 01 Feb 2008 03:47:00 GMThttp://www.aygfsteel.com/Ericzhang5231/articles/178808.htmlhttp://www.aygfsteel.com/Ericzhang5231/comments/178808.htmlhttp://www.aygfsteel.com/Ericzhang5231/articles/178808.html#Feedback0http://www.aygfsteel.com/Ericzhang5231/comments/commentRss/178808.htmlhttp://www.aygfsteel.com/Ericzhang5231/services/trackbacks/178808.html jBPM开发入门指?2)

4 数据库初始化

jBPM 需要数据库支持Q?/span> jBPM ?x)把自己的一个初始化数据存储到数据库Q同时工作流的数据也是存储到数据库中的?/span> jBPM 使用 Hibernate 来做q存储层,因此只要?/span> Hibernate 支持的数据库Q?/span> jBPM 也就支持?/span>

 

本文先以 MySQL ZQ然后再?/span> Oracle ZQ来谈谈 jBPM 的数据库初始化操作?/span>

 

注:(x)在上面的 JBoss 自带的示例中Qƈ没有讄数据库,那是因ؓ(f) jBPM 默认使用的是内存数据?/span> hsqldb ?/span>

4.1  MySQL

 

1 、首先安?/span> MySQL ?/span>

MySQL 的安装比较简单,|上也有很多文章Q本文不再赘q。本指南所?/span> MySQL 版本?/span> MySQL 4.1 Q?/span> for windows Q。再找一?/span> MySQL 客户端,目的是方便查看数据库中的数据Q本文推荐?/span> MySQL |站上免Ҏ(gu)供的“ MySQL Query Brower ”Q当然你用其他的客户端也行,比如 MySQL-Front ?/span>

 

2 、徏?/span>

MySQL 中创Z个库Q库名:(x) jbpm

 

3 、生成徏表的 SQL 语句q徏?/span>

?/span> jbpm-starters-kit-3.1.1 下的子目?/span> jbpm 改名?/span> jbpm.3 Q否则在执行下面?/span> ant 命o(h)时会(x)报如 jbpm.3 目录不存在的错误Q?/span>

D:\jbpm-starters-kit-3.1.1\jbpm-db\build.xml:361: The following error occurred while executing this line:

D:\jbpm-starters-kit-3.1.1\jbpm-db\build.xml:68: Basedir D:\jbpm-starters-kit-3.1.1\jbpm.3 does not exist

 

?/span> DOS H下Q进?/span> D:\jbpm-starters-kit-3.1.1\jbpm-db 目录Q执行如下命令:(x)

ant mysql.scripts

 

执行成功后,?/span> D:\jbpm-starters-kit-3.1.1\jbpm-db\build\mysql\scripts 目录里生成了四个 sql 文gQ它们做什么用的一看名字就知道了。在 MySQL 客户端中执行“ mysql.create.sql ”脚本Q这样将?/span> jbpm 库中创徏一个个的数据表?/span>

 

 

4.2  Oracle

先安装好 Oracle 服务器。我们公司有现存?/span> Oracle 服务器,也提供给了我一个属于我自己的用户名Q一d可以Q意在我的库之下创了。所以这一步就省了Q没有的自个先装好吧?/span>

讉K Oracle 推荐?#8220; PLSQL Developer ”。不q要q接 Oracle q要在本Z装上 Oracle 自己的客L(fng)E序Q里面提供了 JDBC 包和一些配|。要q接服务器还得配|一下,我一般都是不?/span> GUI 而直接改 tnsnames.ora 文gQ在我的?sh)脑里此文g的目录地址是:(x) D:\oracle\ora92\network\ADMIN\tnsnames.ora Q内容如?/span> ( 两面有两个配|了 ) Q?/span>

# TNSNAMES.ORA Network Configuration File: E:\oracle\ora92\network\admin\tnsnames.ora

# Generated by Oracle configuration tools.

 

WXXRDB_192.168.3.2 =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.3.2)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SID = wxxrDB)

      (SERVER = DEDICATED)

    )

  )

 

WXXRDB_192.168.4.2 =

  (DESCRIPTION =

    (ADDRESS_LIST =

      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.4.2)(PORT = 1521))

    )

    (CONNECT_DATA =

      (SID = wxxrDB)

      (SERVER = DEDICATED)

    )

  )

 

前面都是 Oracle 的一些知识,不会(x)?/span> Google 一下吧。最后配|好后,?/span> PLSQL Developer 输入你的用户名和密码联接?/span> Oracle Q就?/span> OK 了?/span>

 

参考上?/span> MySQL 的步骤,基本一P(x)

Q?Q?span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">       ?/span> jbpm 改名?/span> jbpm.3

Q?Q?span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">       再执?/span> ant oracle.scripts

Q?Q?span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">       ?/span> jbpm-db\build\oracle\scripts 目录?/span> oracle.create.sql 脚本Q在 Oracle 中生?/span> jBPM 的所有表。在“ PLSQL Developer ”中可以新Z?/span> Command Windows H口然后输入命o(h)Q?/span> @D:\jbpm-starters-kit-3.1.1\jbpm-db\build\oracle\scripts\oracle.create.sql



Eric5231 2008-02-01 11:47 发表评论
]]>
jBPM开发入门指?1)(?http://www.aygfsteel.com/Ericzhang5231/articles/178806.htmlEric5231Eric5231Fri, 01 Feb 2008 03:43:00 GMThttp://www.aygfsteel.com/Ericzhang5231/articles/178806.htmlhttp://www.aygfsteel.com/Ericzhang5231/comments/178806.htmlhttp://www.aygfsteel.com/Ericzhang5231/articles/178806.html#Feedback0http://www.aygfsteel.com/Ericzhang5231/comments/commentRss/178806.htmlhttp://www.aygfsteel.com/Ericzhang5231/services/trackbacks/178806.html jBPM开发入门指?1)

工作虽然还在不成熟的发展阶D,甚至q没有一个公认的规范标准。但其应用却已经在快速展开Q这说明市场对工作流框架的需求是急迫而巨大的?/span>


jBPM 的正处在不断发展中,做ؓ(f)开源Y件的特点Q其设计变化往往很大。所以一些过ȝ资料可能已经不适用了。于是作者根据自q使用l验Q重新整理出q䆾文档Q以备学?fn)参考?/span>

注:(x)本文使用?/span> jBPM 版本?/span> 3.1.1

环境准备

1、安?span lang="EN-US">JDK

所?/span> JAVA 开发第一个需要安装的Q没什么好说的。记得把pȝ变量 JAVA_HOME 设上?/span>

2、安?span lang="EN-US">Ant

Ant 是?/span> jBPM 必须的一个工兗?/span> jBPM 中的很多操作都要用到 Ant ?/span>

安装Ҏ(gu)Q?/span>

Q?/span> 1 Q先下蝲Q?/span> http://archive.apache.org/dist/ant/binaries/ Q选一个如Q?/span> apache-ant-1.6.5-bin.zip ?/span>

Q?/span> 2 Q解压到 D:\ant Q当然其他目录也可以Q?/span>

Q?/span> 3 Q设|如下系l变量:(x) ANT_HOME=d:\ant ?/span>

Q?/span> 4 Q把 %ANT_HOME%\bin 加入到系l变?/span> PATH 中?/span>

3、安?span lang="EN-US">Eclipse

Eclipse 不是开?/span> jBPM 必须的工P但它是对 jBPM 开发很有帮助的工具Q特别是 jBPM 提供了一?/span> Eclipse 插g用来辅助开?/span> jBPM 。关?/span> Eclipse 的安装不赘述了,本文用的版本是:(x) Eclipse3.2

 

安装 jBPM

jBPM 的下载地址Q?/span> http://www.jboss.com/products/jbpm/downloads  

l           JBoss jBPM ?/span> jBPM 的Y件包

l           JBoss jBPM Starters Kit  是一个综合包Q它包括?/span> jBPM 软g包、开发插件、一个配|好了的Z JBoss ?/span> jBPM CZ、一些数据库配置文gCZ?/span>

l           JBoss jBPM Process Designer Plugin  是辅助开?/span> jBPM ?/span> Eclipse 插g?/span>

l           JBoss jBPM BPEL Extension jBPM 关于 BPEL 的扩展包

本指南选择下蝲Q?/span> JBoss jBPM Starters Kit 。下载后解压?/span> D:\jbpm-starters-kit-3.1 Q目录下含有五个子目录:(x)

l           jbpm   jBPM 的Y件包

l           jbpm-bpel 只含有一个网?/span>

l           jbpm-db 各种数据?/span> hibernate 配置文gCZQ有些还包含了相应的 jdbc 驱动E序?/span>

l           jbpm-designer  辅助开?/span> jBPM ?/span> Eclipse 插gQ具体在 jbpm-gpd-feature 子目录中

l           jbpm-server  一个已l配|好了的Z JBoss ?/span> jBPM CZ .

 

感觉下工作流

前面我们说了Q在 JBoss jBPM Starters Kit ?/span> jbpm-server 目录是一个已l配|好的了 jBPM CZQ那么让我们来感觉一?/span> jBPM 做出的东西吧?/span>

 

双击 jbpm-server 目录下的 start.bat 文gQ启?/span> JBoss 服务。这时会(x)打开一?/span> DOS H口Q启动完成后Q日志会(x)不断输出Q其中最后一句是“ 13:55:39,937 DEBUG [StaticNotifier] going to wait for (CMD_EXECUTOR, java.lang.Object@1df59bd) ”Q这表示 jBPM 在开始工作了Q它不断q行轮询?/span>

打开|页Q?/span> http://localhost:8080/jbpm/  得到如下画面

q是一个已l用 jBPM 开发好的用户定单流E,h下单、审核、估L(fng)程。它所用的数据库是一个内|的数据库?/span>

?/span> cookie monster 用户dQ选择“ create new web sale order ”可以创徏一个定单。如下图所C,在图左边是填写的定单情况Q右边一整个定货程的示意图Q红色框表示程q行到哪一步了。填写好定单好,选择“ Save and Close Task ”Q完成定单提交?/span>

选择右上角的“ Login as another user ”以另外一个用户名 ernie d。这时可以看?/span> ernie 用户的Q务列表中多了一V?/span>

点进dQ显C如下画面。这个示例对中文的支持不好,全都昄成了 unicode 码了。不这什么多Q反正知道是q么回事p了。在 comment 填写意见,?/span> OK 按钮Q进入到下一步。如果选择 more info needed 按钮Q则打回l?/span> cookie monster 用户修改定单?/span>

下面的流E,q里׃再赘qC。在q个很标准的工作示例中Q我们基本可以看?/span> jBPM 的应用范围还是比较广的。而且从这个示例,我们是看不出?/span> jBPM 的,也就是说 jBPM 在后台v着作用?/span>

从这个例子,q看不出 jBPM 的优ѝ不q,如果在一个流E不定Q经帔R要变动的目中, jBPM 的好处将?x)显然出来。应?/span> jBPM 后,改变?gu)程只需改变?gu)程描述文gQ这在后面的内Ҏ(gu)到?/span>

q是一个已做好的示例,接下来我们将仉K这个实例来开发一个请假流E?/span>



Eric5231 2008-02-01 11:43 发表评论
]]>
JBoss jBPM 2.0 Tutorialhttp://www.aygfsteel.com/Ericzhang5231/articles/JBPM.htmlEric5231Eric5231Fri, 01 Feb 2008 03:37:00 GMThttp://www.aygfsteel.com/Ericzhang5231/articles/JBPM.htmlhttp://www.aygfsteel.com/Ericzhang5231/comments/178804.htmlhttp://www.aygfsteel.com/Ericzhang5231/articles/JBPM.html#Feedback0http://www.aygfsteel.com/Ericzhang5231/comments/commentRss/178804.htmlhttp://www.aygfsteel.com/Ericzhang5231/services/trackbacks/178804.html
Since the term workflow mangament system has a complete different meaning to different people, I will explain the core responsabilities of a workflow management system in four layers. A more detailed description of the 4 layers can be found in the article The State of Workflow.

jBpm takes process archives as input. A process archive is a formal description of a business process. After a process archive is deployed, jBpm can manage the executions of this process. 'Managing the executions' means keeping track of the state of a process (State layer), storing information associated with a process execution (Context layer), integrating custom programming logic like e.g. sending emails, interacting with an ERP, ... (Programming logic layer) and optionally allow users to complete tasks by submitting forms (User interfaces layer).

Main responsibility

The main responsibility of a WFMS is to maintain the state of process executions. The state model of jBpm is based on a graph with nodes and transitions. Nodes and transitions are the main ingredients of a process definition. A state is an example of a node.


Runtime interaction

The 2 most important interactions with jBpm are : starting one instance (=one execution) of a process definition and signalling the end of a state. As a result of both these interactions jBpm will calculate the next state of the process instance.


Actions

The state graph, provides the structure of the process. Actions are pieces of programming logic that can be executed upon events in the process. There are three types of events : entering a node, leaving a node and taking a transition. While jBpm is calculating the next state, a number of these events will fire.

Process archives

The main file in a process archive is processdefinition.xml. That file contains the formal description of the process. The act of parsing the processdefinition.xml and storing it in the database is called deploying a process. All other files in a process archive are stored as attachments with the process definition (either in the database or as files on the filesystem).


Example

Create a process archive

We have modelled the following process for requesting a pay raise...

The payraise process This process is expressed as xml like this:
 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <!DOCTYPE process-definition PUBLIC
 3     "-//jBpm/jBpm Mapping DTD 2.0//EN"
 4     "http://jbpm.org/dtd/processdefinition-2.0.dtd">
 5 
 6 <process-definition name="pay raise process"> 
 7   
 8   <!-- START-STATE -->
 9   <start-state name="request a payraise" >
10     <transition to="evaluating"/>
11   </start-state>
12 
13   <!-- NODES -->
14   <state name="evaluating">
15     
16     <transition name="approve"     to="fork"/>
17     <transition name="disapprove"  to="done"/>
18   </state>
19   
20   <fork name="fork">
21     <transition to="updating erp asynchronously" />
22     <transition to="treating collegues on cake and pie" />
23   </fork>
24 
25   <state name="updating erp asynchronously">
26     
27     <transition to="join" />
28   </state>
29 
30   <state name="treating collegues on cake and pie">
31     
32     <transition to="join" />
33   </state>
34   
35   <join name="join">
36     <transition to="done" />
37   </join>
38 
39   <!-- END-STATE -->
40   <end-state name="done" />
41 
42 </process-definition>
snippet of the processdefinition.xml

Deploy process archive

jBpm store its process definitions in the database. So deploying a process into jbpm actually means parsing the processdefinition.xml and store it in the jbpm database. This can be done in one of 2 ways:

  1. the jbpm ant-tasks par and deploypar. par lets you create a process archive from a set of files. deploypar deploys a process archive to the database. The deploypar takes a jbpm.properties file as an attribute. That file specifies the jbpm configurations including the database to which the process archive has to be deployed. For more information about the properties, see configuration.
  2. programmatically like this:

 1 // create a process archive input stream
 2 String resource = "payraise/processdefinition.xml";
 3 InputStream is = PayRaiseTest
 4                    .class
 5                    .getClassLoader()
 6                    .getResourceAsStream(resource);
 7 ArchiveBuilder ab = new ArchiveBuilder(is);
 8 JarInputStream jis = ab.getJarInputStream();
 9       
10 // deploy the process
11 DefinitionService ds = JbpmServiceFactory
12                          .getInstance()
13                          .openDefinitionService();
14 ds.deployProcessArchive(jis);
15 ds.close();
code to deploy a process archive
Note that also this code uses the jbpm.properties for its configuration, including the database to which the process archive is deployed.

Note that the jbpm default configurations points to an hypersonic in-memory database. That is ideal for testing. But this is of little use when using the ant task to deploy your process. In that case, your database will live in the runtime memory of the ant-task so you'll not be able to access it after the ant-task has completed.

Start process instance

After packing and deploying this process to the jBpm database, the next code example shows how to start a process instance.

1 ExecutionService executionService = 
2     JbpmServiceFactory.getInstance().openExecutionService("AlbertEinstein");
3 executionService.startProcessInstance( "payraise" );
4 executionService.close();
code to start a process instance

Getting a task list

A token is a pointer to a state. In jbpm, every token can point to one actor, thereby creating a relation between a state and an actor. The idea behind this state-actor relation in a token. is the following : when workflow engine enters a state, that means that the workflow engine will be waiting for some external trigger. If the process definition is equipped with a calculation that determines *who* it is waiting for, this calculation is executed when the token enters the state. So the task list will be a collection of tokens that refer to a given actor. Actors in jBpm are always referenced by their id : actorId (java.lang.String).
1 // get an execution service for user Carl Gauss (cg)
2 ExecutionService executionService = JbpmServiceFactory.getInstance().openExecutionService("cg");
3 // get the task list for Carl Gauss (cg)
4 Collection tasks = executionService.getTaskList("cg");
5 executionService.close();
code to get a tasklist

Signal the end of a state

When the process instances was started, jBpm calculated that the next state is 'evaluating' and that user CarlGauss is responsible for this task. This resulted in the token of the process being assigned to 'CarlGauss'. The next snippet asks jBpm all the tokens that are waiting for CarlGauss. In this example we assume that the first task is the one we started above. When CarlGauss has made his decision, he informs jBpm by means of the endOfState method call. Note that in this example we explicitly provide the name of the leaving transition to indicate the choice made by the user.

1 ExecutionService executionService = 
2     JbpmServiceFactory.getInstance().openExecutionService("CarlGauss");
3 Collection tasks = executionService.getTaskList("CarlGauss");
4 Token token = (Token) tasks.iterator().next();
5 executionService.endOfState( token.getId(), "approve" );
6 executionService.close();

code to signal an end of state



Eric5231 2008-02-01 11:37 发表评论
]]>
վ֩ģ壺 ʯ| | Ͼ| Һ| ɳ| | °Ͷ| | | | | ƽ˳| İ| Ϫ| | | | ʡ| | | ٳ| ѽ| | | | Т| ɽ| Դ| Դ| | Ͳ| | | | | ̷| ֵ| | | | |