分享
 
 
 

JBPM-Getting Started

王朝java/jsp·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

Getting StartedThis page describes the fastest way to get jbpm up and running on your system, including the demo webapplication. Required softwarejBpm 2.0 is tested on a Windows XP machine with following software packages installed : 'J2SE SDK v 1.4.2_03', downloaded from http://java.sun.com/j2se/1.4.2/download.html 'Apache Ant version 1.6.1', downloaded from http://ant.apache.org/bindownload.cgi Optionally, you can deploy jbpm on the JBoss j2ee server. 'JBoss 3.2.5', download from http://prdownloads.sourceforge.net/jboss/jboss-3.2.5.zip?download, unzip and set the JBOSS_HOME environment variable

Getting jBpmThe easiest way to get the latest released sources is from the sourceforge download site.

To get the latest sources from cvs, provide this information to you cvs-client :

Connection type: pserver User: anonymous Password: Host: cvs.sourceforge.net Port: 2401 (which is the default) Repository path: /cvsroot/jbpm Label: :pserver:anonymous@cvs.sourceforge.net:/cvsroot/jbpm Then checkout module jbpm2.

Installationunzip jbpm to a folder of your choice update the configs in build.properties to your environment with your favorite text editor in directory ${jbpm.home} run 'ant configure.jboss.3.2.3+'. (the same task works for jboss-3.2.5) That creates a jbpm configuration ${jboss.home}/server/jbpm which is basically a copy of the 'all' configuration. The only difference is that 2 files are added to the deploy directory : jbpm-db-service.xml and jbpm-ds.xml start the jbpm configuration of jboss with '%JBOSS_HOME%/bin/run.bat -c jbpm'. in directory ${jbpm.home}/web run 'ant deploy'. This will build and deploy the web application to the jboss configuration that we've just created. in directory ${jbpm.home}/web run 'ant deploy.process.archives'. This deploys the demo payraise process to the jbpm database in jboss. Since this is normally your first jbpm access to the database, this will also create the jbpm tables automatically. surf to http://localhost:8080/jbpm The process archive inputNow you can take a look at the process archive that served as the input for jbpm. You can find the process archive at ${jbpm.home}/web/target/payraiseprocess.par. Open it with winzip or any other similar tool that knows how to open jar (java archive) files. + processdefinition.xml

+ forms.xml

+ forms

+ evaluating.form

+ request.form

+ treat.form

+ update.erp.form

+ payraise.gif

contents of the payraiseprocess.par processdefinition.xml contains the formal description of the process. in the jPdl xml language. That file is used by the core engine. All the other files are used by the webapplication to create a web interface for the process. forms.xml specifies the relation between the different states in the process and the forms. The forms contain the html for the forms.

Directory structureThe directory structure of the sub projects core, tools & ejb complies with the maven directory layout http://maven.apache.org/reference/dirlayout.html Note that only ant is used for the build process. We just use the same directory structure as in a maven project. The most important part is that in every subdir src/java contains the java source files that will be packaged and src/test/java contains all unit test related source files. core: is the sub module for the jbpm.core.jar package web: is the sub module for the jbpm.war package ejb: is the sub module for the jbpm.ejb.jar package doc: contains all the documentation available for jbpm lib: contains all the used libraries and their licenses example: contains a template project for developing processes Overview of the jBpm packagescoreproduced file : core/target/jbpm.core.jar is the complete jbpm workflow engine runnable in a J2SE environment accessible through an easy to use API libs required by jbpm.core.jar : lib/commons/*.jar lib/hibernate/*.jar database driver classes (e.g. lib/hsqldb/hsqldb.jar) webproduced files : web/target/jbpm.war and web/target/payraiseprocess.par is a web application that is created for 2 purposes : rapid prototyping : with a simple xml-file and a few form files in the process archive, you can create a webapplication for your processes as the basis for a custom web application : when you want to create a custom web application on top of your business processes, you can use the web submodule as a quickstart requires a servlet container ejbproduced file : ejb/target/jbpm.ejb.jar and ejb/target/jbpm.ejb.client.jar is an ejb module that contains a wrapper for the execution service of jbpm deployable on a (clustered) j2ee server (configuration instructions included) Running the ejb moduleAs a prerequisite, make sure you've unpacked a clean jboss-3.2.3 and configured it as described in Installation. start your jboss with '${jboss.home}/bin/run.bat -c jbpm' open a console in directory ${jbpm.home}/ejb deploy the webapp with 'ant deploy' deploy the process archive with 'ant deploy.process.archives' execute the test (50 process executions) with 'ant test'. if you run this test from within eclipse or another testrunner, be sure to add the ${jboss.home}/client/jbossall-client.jar into the classpath. Process development environmentThe ${jbpm.home}/build.xml ant script contains a target to build a process development environment from the example directory. The process development environment (pde) is a project directory structure with a build script for developing process archives. The pde does not include facilities to execute processes other then for testing purposes.

As you know, the input of jBpm is a set of formal descriptions of your business processes. These formal descriptions are called process archives. The process development environment is a template project for creating such process archives.

To create a project from the template, perform the operations

update the property jbpm.pde to the directory where you want to create the process archive project execute 'ant create.pde' in ${jbpm.home} Now, lets take a look at the contents of the generated project...

src/process/exampleprocess.xml : is an xml file that represent the basic structure of a process definition. This file, together with other files, is packed in a zip file (or jar file) and that file is called a process archive.

src/java/... : are java classes that can be added to a process archive. The classes can be packed as part of the process archive. jBpm has several interfaces that can be seen as extension points of process definitions. In jBpm this is called the delegation mechanism and the implementations are called delegation classes. Typically, the delegation classes are included a the process archive are

src/test/java/... : are the test classes based on JUnit. The example shows how standalone JUnit tests can be created where one test executes one scenario of a business process. By default, the tests are run against an in-memory hypersonic database. Each time the tests are executed, the jBpm database tables are created in the empty in-memory database. This mechanism makes it really easy to execute tests because you do not have to set up a database and initialise it with the proper data.

build.xml : is an ant script file that contains the necessary targets to build, test and deploy the process archives. To see the process development environment in action, open a console in the home directory of your ${jbpm.pde} and run the ant target 'test' with the command ant test. After that, open the file ${jbpm.pde}/target/test-results/index.html in your favorite browser. (on a windows machine, this should pop-up automatically).

To learn about how to write the process descriptions, see The jPdl reference manual. Another way to learn about writing processes and using jBpm is to look at the tests as examples : see core/src/test/resources/process/*.xml for the processdefinition.xmls and see core/src/test/java/org/jbpm/service/*Test.java for the java code that uses the processes.

To create a project in eclipse for the process development environment perform following operations :

in eclipse, File --> New --> Project... select Java, Java Project click Next> give the project a name (e.g. jbpm.pde) and optionally specify its location (e.g. C:\eclipse\workspace\jbpm.pde) click Next> In the tab 'Source', remove the folder jbpm.pde In the tab 'Source', add the folders jbpm.pde/src/java, jbpm.pde/src/test/java, jbpm.pde/src/config and jbpm.pde/src/process Set the default output folder to jbpm.pde/target/classes In tab 'Libraries', click 'Add JARs' In the 'JAR Selection' dialog box, open jbpm.pde/lib and select all libraries Then click 'Finish' To set up the junit testrunner in eclipse, perform the following operations :

If not already open, show view JUnit with Window --> Show View --> Other... --> Java --> JUnit Open the file src/test/java/org/jbpm/example/ExampleProcessTest.java in the editor In eclipse, Run --> Run... In the tree-window 'Configurations:" select the root 'JUnit' Click 'New' Click 'Run' Check the green bar in the JUnit window !

Ant targetscheck out the docs of the ant scripts with 'ant -p' in dirs ${jbpm.home}, ${jbpm.home}/core, ${jbpm.home}/ejb and ${jbpm.home}/web SupportOur preferred support mechanism is through the forums, *NOT* the mailing lists ! For more about support see the support page.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有