Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2566665
  • 博文数量: 245
  • 博客积分: 4125
  • 博客等级: 上校
  • 技术积分: 3113
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-25 23:56
文章分类

全部博文(245)

文章存档

2015年(2)

2014年(26)

2013年(41)

2012年(40)

2011年(134)

2010年(2)

分类: Java

2011-08-12 15:34:20

Installation

This guide will assist you in installing and running a demo setup of the various components of the jBPM project.

安装:

这是一个帮助你安装和运行一个demo设置jBPM的各种组件的教程。

Prerequisites

This script assumes you have Java JDK 1.5+ (set as JAVA_HOME), and Ant 1.7+ installed.
If you don't, use the following links to download and install them:
Java:

Ant:

 

前提条件:

假设你已经有Java JDK 1.5+ (set as JAVA_HOME), and Ant 1.7+

 

Download the installer

First of all, you need to download the installer:
jbpm-{version}-installer.zip

You can for example find the latest snapshot release .

下载安装程序

首先你需要下载安装程序:jbpm-{version}-installer.zip

Demo setup

The easiest way to get started is to simply run the installation script to install the demo setup. Simply go into the install folder and run:

ant install.demo

This will:

  • Download JBoss AS
  • Download Eclipse
  • Install Drools Guvnor into JBoss AS
  • Install Oryx Designer into JBoss AS
  • Install the jBPM Console into JBoss AS
  • Install the jBPM Eclipse plugin
  • Install the Drools Eclipse plugin

示例安装:

最简单的安装方法就是运行安装脚本安装示例安装。首先切换到安装目录,
然后运行
ant install.demo

这将会:

下载JBoss(注意:可以自己下载一个JBoss放在jbpm-xxx.installer\lib目录下)

下载Eclipse(注意:可以自己下载一个Eclipse放在jbpm-xxx.installer\lib目录下)

 


Once the demo setup has finished, you can start playing with the various components by starting the demo setup:

ant start.demo

This will:

  • Start the H2 database
  • Start the JBoss AS
  • Start Eclipse
  • Start the jBPM Human Task Service

Once everything is started, you can start playing with the Eclipse tooling, Guvnor and jBPM console, as explained in the next three sections.

demo安装完成后,你可以启动各种组件通过运行:

Ant start.demo

当全部启动后,你就可以使用这些工具啦!!

 

在启动时,遇到一些问题:

C:\java\jbpm-5.1.0.installer>ant start.demo

Buildfile: C:\java\jbpm-5.1.0.installer\build.xml

 

download.h2.check:

     [echo] Checking h2 download ...

 

download.h2:

 

start.h2:

 

start.jboss:

 

start.eclipse:

 

start.human.task:

    [mkdir] Created dir: C:\java\jbpm-5.1.0.installer\task-service\target

    [javac] C:\java\jbpm-5.1.0.installer\build.xml:500: warning: 'includeantrunt

ime' was not set, defaulting to build.sysclasspath=last; set to false for repeat

able builds

    [javac] Compiling 1 source file to C:\java\jbpm-5.1.0.installer\task-service

\target

    [javac] C:\java\jbpm-5.1.0.installer\task-service\src\org\jbpm\DemoTaskServi

ce.java:49: 警告:[unchecked] 未经检查的类型使用

    [javac] 找到: java.lang.Object

    [javac] 需要: java.util.Map

    [javac]         Map users = ( Map ) eval( reader

, vars );

    [javac]                                                             ^

    [javac] C:\java\jbpm-5.1.0.installer\task-service\src\org\jbpm\DemoTaskServi

ce.java:54: 警告:[unchecked] 未经检查的类型使用

    [javac] 找到: java.lang.Object

    [javac] 需要: java.util.Map

    [javac]         Map groups = ( Map ) eval( rea

der, vars );

    [javac]                                                                ^

    [javac] 注意:C:\java\jbpm-5.1.0.installer\task-service\src\org\jbpm\DemoTas

kService.java 使用或覆盖了已过时的 API

    [javac] 注意:要了解详细信息,请使用 -Xlint:deprecation 重新编译。

    [javac] 2 警告

     [copy] Copying 2 files to C:\java\jbpm-5.1.0.installer\task-service\target

     [java] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

     [java] SLF4J: Defaulting to no-operation (NOP) logger implementation

     [java] SLF4J: See for fu

rther details.

     [java] Task service started correctly !

     [java] Task service running ...

 

 

 

我在安装的时候,自己下载了:

jboss-5.1.0.GA.zip

eclipse-java-helios-SR2-win32.zip

GEF-SDK-3.6.2.zip

放在jbpm-installer /lib目录下

这些版本号是从build.properties中获取到的。

 

 

Using Eclipse Tooling

The gives an overview of how to run a simple demo process in Eclipse. It shows you:

  • How to import an existing example project into your workspace, containing
    • a sample BPMN2 process for requesting a performance evaluation
    • a sample Java class to start the process
  • How to start the process
  • How to debug a process using the audit view or runtime debugging

Once Eclipse has opened, simple import (using "File -> Import ..." and then under the General category, select "Existing Projects into Workspace") the existing sample project (in the jbpm-installer/sample/evaluation directory). This should add the sample project, including a simple BPMN2 process and a Java file to start the process. You can open the BPMN2 process by double-clicking it. To execute the process, right-click on ProcessTest.java in the com.sample package (under "src/main/java") and select "Run As - Java Application". In this case, it will simply start the process, which will result in the creation of a new user task for the user "krisv" in the human task service, after which the process will wait for its execution. We will show you later how you could complete human tasks like this using a human task client like the jbpm-console.

 

Eclipse打开后,导入已经存在的sample项目(the jbpm-installer/sample/evaluation 目录下),选择“文件-》导入-"Existing Projects into Workspace"。然后可以通过在"src/main/java"下的ProcessTest.java上选择"Run As - Java Application"运行。

You could also create a new project using the jBPM project wizard. This sample project contains a simple HelloWorld BPMN2 process and an associated Java file to start the process. Simple select "File - New ... - Project ..." and under the "jBPM" category, select "jBPM project" and click "Next". Give the project a name and click "Finish". You should see a new project containing a "sample.bpmn" process and a "com.sample.ProcessTest" Java class. You can open the BPMN2 process by double-clicking it. To execute the process, right-click on ProcessTest.java and select "Run As - Java Application". You should see a "Hello World" statement in the output console.

Using web management consoles

Open up the process management console:


Log in, using "krisv" / "krisv" as username / password.

The gives an overview of how to manage your process instances. It shows you:

  • How to start a new process
  • How to look up the current status of a running process instance
  • How to look up your tasks
  • How to complete a task
  • How to generate reports to monitor your process execution

To manage your process instances, click on the "Processes" tab at the left an select "Process Overview". After a slight delay (if you are using the application for the first time, due to session initalization etc.), the "Process" list should show all the known processes. The jbpm-console in the demo setup currently loads all the process in the "src/main/resources" folder of the evaluation sample in "jbpm-installer/sample/evaluation". If you click the process, it will show you all current running instances. Since there are no running instances at this point, the "Instance" table will remain empty.

You can start a new process instance by click on the "Start" button. After confirming that you want to start a new execution of this process, you will see a process form where you need to fill in the necessary information to start the process. In this case, you need to fill in your username "krisv", after which you can complete the form and close the window. A new instance should show up in the "Instance" table. If you click the process instance, you can check its details below and the diagram and instance data by click on the "Diagram" and "Instance Data" buttons respectively. The process instance that you just started is first requiring a self-evaluation of the user and is waiting until the user has completed this task.

To see the tasks that have been assigned to you, choose the "Tasks" tab on the left and select "Personal Tasks" (you may need to click refresh to update your task view). The personal tasks table should show a "Performance Evaluation" task for you. You can complete this task by selecting it and clicking the "View" button. This will open the task form for performance evaluations. You can fill in the necessary data and then complete the form and close the window. After completing the task, you could check the "Process Overview" once more to check the progress of your process instance. You should be able to see that the process is now waiting for your HR manager and project manager to also perform an evaluation. You could log in as "john" / "john" and "mary" / "mary" to complete these tasks.

After starting and/or completing a few process instances and human tasks, you can generate a report of what happened so far. Under "Reporting", select "Report Templates". By default, the console has two report templates, one for generating a generic overview for all processes and one for inspecting once specific process definition. If you select the latter, make sure to enter "com.sample.evaluation" as the process definition id to see the activity related to the evaluation process. Click the "Create Report" button to generate a realtime report of the current status. Notice that the initialization of the reports might take a moment, especially the first time you use the application.

Using Guvnor repository

The Guvnor repository can be used as a process repository to store business processes. It also offers a web-based interface to manage your processes. This includes a web-based editor for viewing and editing processes.

Open up Drools Guvnor:


Log in, using any non-empty username / password (we disabled authentication for demo purposes).

The gives an overview of how to manage your repository. It shows you:

  • How to import an existing process (in this case the evaluation process) from eclipse into guvnor
  • How to open up the evaluation process in the web editor
  • How to build a package so it can be used for creating a session

Once you're done playing: ant stop.demo

and simply close all the rest.

What to do if I encounter problems or have questions?

You can always contact the jBPM community for assistance.

Email: jbpm-dev@jboss.org
IRC: #jbpm at irc.codehaus.org
jBPM User Forum

Some common issues are explained below.

Q: What if the installer complains it cannot download component X?
A: Are you connected to the internet? Do you have a firewall turned on? Do you require a proxy? It might be possible that one of the locations we're downloading the components from is temporarly offline. Try downloading the components manually (possibly from alternate locations) and put them in the jbpm-installer/lib folder.

Q: What if the installer complains it cannot extract / unzip a certain jar/war/zip?
A: If your download failed while downloading a component, it is possible that the installer is trying to use an incomplete file. Try deleting the component in question from the jbpm-installer/lib folder and reinstall, so it will be downloaded again.

Q: What if I have been changing my installation (and it no longer works) and I want to start over again with a clean installation?
A: You can use ant clean.demo to remove all the installed components, so you end up with a fresh installation again.

Q: I sometimes see exceptions when trying to stop or restart certain services, what should I do?
A: If you see errors during shutdown, are you sure the services were still running? If you see exceptions during restart, are you sure the service you started earlier was successfully shutdown? Maybe try killing the services manually if necessary.

Q: Something seems to be going wrong when running Eclipse but I have no idea what. What can I do?
A: Always check the consoles for output like error messages or stack traces. You can also check the Eclipse Error Log for exceptions. Try adding an audit logger to your session to figure out what's happening at runtime, or try debugging your application.

Q: Something seems to be going wrong when running the a web-based application like the jbpm-console, Guvnor and the Designer. What can I do?
A: You can check the server log for possible exceptions in the jbpm-installer/jboss-4.2.3.GA/server/default/log directory.

For all other questions, try contacting the jBPM community as described above.

Manually installing the different components

If you don't want to use the demo setup, you can also use the individual ant targets, as described below.

Getting JBoss AS

You need to download and install JBoss AS version 4.2.3.GA. If you don't have it installed yet, go into the install folder and run the installation script:
ant install.jboss

This will download and install the server in install/jboss-4.2.3.GA folder. If you don't want it to download the zip file, you can put the jboss-4.2.3.GA.zip in the install/lib folder.

If you already have it installed somewhere else, in install/build.properties, change the jboss.home property to the location of your JBoss AS installation.

Getting Eclipse

You need to download and install Eclipse 3.6.1 If you don't have it installed yet, run installation script:
ant install.eclipse

This will download and install eclipse in install/eclipse folder. If you don't want it to download the eclipse file, you can put the file in the install/lib folder:
eclipse-SDK-3.6.1-linux-gtk.tar.gz (linux),
eclipse-SDK-3.6.1-win32.zip (windows), or
eclipse-SDK-3.6.1-macosx-carbon.tar.gz (mac).
If you don't want it to download the eclipse GEF file, you can put the GEF-runtime-3.6.1.zip file in the install/lib folder.

If you already have it installed somewhere else, in install/build.properties, change the eclipse.home property to the location of your Eclipse installation.

Installing

In the install dir, run installation script:
ant install.guvnor.into.jboss
ant install.designer.into.jboss
ant install.jBPM-gwt-console.into.jboss
ant install.jBPM-eclipse.into.eclipse
ant install.drools-eclipse.into.eclipse

Starting

Startup database:
ant start.h2

Startup JBoss AS:
ant start.jboss

Startup task service:
ant start.human.task

Startup eclipse:
ant start.eclipse

Stopping

Once you're done playing
stop database:
ant stop.h2

stop JBoss AS:
ant stop.jboss

and simply close all the rest. You can also clean up your installation using:
ant clean.jboss ant clean.eclipse

 

阅读(2348) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~