Activiti in Action(實(shí)戰(zhàn)Activiti)-第一章 BPMN 2.0: what’s in it for developers?(8)
Posted on 2011-01-04 23:12 網(wǎng)路冷眼@BlogJava 閱讀(5509) 評(píng)論(4) 編輯 收藏 所屬分類: Java 、Java EE 、BPM1.5.2 Installing the Activiti tool stack (安裝Activiti工具棧)
Tom Baeyens and his team have been able to provide a smooth installation process. The first thing you have to do is to point your web browser to the Activiti website at http://www.activiti.org. There you will be guided to the latest release of Activiti via the download button. Just download the latest version and unpack the distribution to a logical folder such as:
Tom Baeyens和他的團(tuán)隊(duì)已經(jīng)能夠提供一個(gè)平滑的安裝過程。您所要做的第一件事情就是將web瀏覽器指向Activiti的:http://www.activiti.org。點(diǎn)擊下載按鈕,將導(dǎo)航至Activiti的最新版本。只要將最新版本下載下來并將分發(fā)解壓至如下的邏輯文件夾:
2 /opt/activiti (Linux or Mac OS)
When working with other process engines downloading the distribution, which is also a lot larger than the couple of MBs of Activiti, is only the beginning of a long and complex installation procedure. With Activiti, there’s a setup directory which contains an Ant build file that installs the full Activiti suite. The directory structure of the distribution is shown in figure 1.10.
當(dāng)使用其它的流程引擎,它只是漫長(zhǎng)和復(fù)雜安裝步驟的第一步。在Activiti里,有一個(gè)包含全部Activiti套件的ant構(gòu)建文件。分發(fā)的目錄結(jié)構(gòu)如圖1.10所示。
Figure 1.10 The directory structure of the Activiti distribution with the setup directory and the Ant build.xml
file as the main parts for the installation procedure.
圖 1.10 Activiti分發(fā)包的目錄結(jié)構(gòu),里面有setup目錄以及作為安裝過程主要部分的Ant build.xml文件。
Before you go further with the installation procedure, make sure that you have installed a Java 6 SDK, pointed the JAVA_HOME environment variable to the Java installation directory, and installed Ant (http://ant.apache.org). Shortcuts to the Java SDK and the Ant framework are also provided on the Activiti download page.
在進(jìn)行安裝過程之前,確保您已經(jīng)安裝了Java 6 JDK, 并將JAVA_HOME環(huán)境變量指向Java的安裝目錄,也安裝了Ant(http://ant.apache.org). 在Activiti的下載頁面也提供了Java SDK和ant框架的快捷方式。
Another prerequisite is that for Linux and Mac OS platforms the current user has permissions to create a directory downloads in the parent folder of the Activiti installation directory. So if you unpacked the distribution to /opt/activiti, the user should have permissions to create a folder /opt/downloads. The last thing to make sure is that you have a internet connection available without a proxy, because the Ant build file will download additional packages.
在Linux和Mac OS平臺(tái)下,另外一個(gè)必要條件是當(dāng)前用戶具有在Activiti安裝目錄的父文件夾里建立目錄downloads的權(quán)限。所以,如果您將發(fā)布包解壓至/opt/activity,用戶應(yīng)該具有創(chuàng)建/opt/downloads/文件夾的權(quán)限。因?yàn)閍nt構(gòu)建文件將下載另外的包,最后確定之事是確保一個(gè)無代理的互聯(lián)網(wǎng)連接可用。
When you open a terminal or command prompt and go to the setup directory shown in figure 1.11, you only have to run the simple ant command. This will kick off the Ant process which will look for a build.xml file in the setup directory. The installation that now takes includes the following steps:
當(dāng)您打開終端或命令行提示,切換至圖1.11所示的setup目錄,您只要簡(jiǎn)單運(yùn)行ant命令即可。這將啟動(dòng)Ant過程,則將查找build.xml文件。安裝包括下列步驟:
- 1. A H2 database is installed to /apps/h2 and the H2 database is started on port 9092.
- H2數(shù)據(jù)庫(kù)安裝至/apps/h2,H2在端口9092上啟功。
- 2. The Activiti database is created in the running H2 database.
- 在運(yùn)行的H2數(shù)據(jù)庫(kù)上創(chuàng)建Activiti數(shù)據(jù)庫(kù)。
- 3. Apache Tomcat 6.0.x is downloaded and installed to /apps/apache-tomcat-6.0.x, where x stands for the latest version.
- 下載Apache Tomcat 6.0.x并安裝至/apps/apache-tomcat-6.0.x,這里x表示最新的版本號(hào)。
- 3. The Activiti engine libraries are copied to the lib directory of Tomcat
- 將Activiti引擎類庫(kù)拷貝至Tomcat 的lib目錄。
- 5. Demo data including users, groups and business processes are installed to the H2 database.
- 包括用戶,組和業(yè)務(wù)流程的演示數(shù)據(jù)安裝至H2數(shù)據(jù)庫(kù)。
- 6. The Activiti engine, REST API, explorer, probe, cycle WARs are copied to the webapps directory of Tomcat.
- 拷貝Activiti引擎,REST API,Explorer,Probe,Cycle的WAR包至Tomcat的webapps的目錄。
- 7. Tomcat is started with the Activiti toolstack.
- Tomcat和Activiti工具棧一起啟動(dòng)。
- 8. The modeler is downloaded and installed separately in the last step of the installation procedure.
- 安裝的最后一步是分別下載并安裝Modeler。
When the Ant script is ready, you have the Activiti toolstack installed and also running. That’s not bad for about a minute of installation time. The Ant build file is not only handy for the installation of Activiti, but also for doing common tasks like stopping and starting the H2 database (ant h2.stop, ant h2.start) and the Tomcat server (ant tomcat.stop,ant tomcat.start) and for re-creating a vanilla database schema (ant db.drop,ant db.create). So it’s worth the time to look at the Ant targets in the Ant build file.
當(dāng)Ant腳本準(zhǔn)備就緒,就可安裝Activiti工具棧并運(yùn)行它們了。安裝時(shí)間僅僅幾分鐘,情況不是太糟。Ant build文件不僅方便Activiti安裝,而且對(duì)下列公共服務(wù)也很方便:停止和啟動(dòng)H2數(shù)據(jù)庫(kù)(ant h2.stop, ant h2.start),停止和啟動(dòng)Tomcat((ant tomcat.stop, ant tomcat.start),重建普通的數(shù)據(jù)庫(kù)schema(ant db.drop, ant db.create),所以值得花時(shí)間來看看Ant構(gòu)建文件的Ant目標(biāo)。
The installation of Activiti consists foremost of several web applications being deployed to a Tomcat server with Activiti libraries and a ready-to-use H2 database with example processes, groups and users already loaded. For the full picture figure 1.11 shows the installation result in a schematic overview.
Activiti安裝包括幾個(gè)最重要的部署到Tomcat服務(wù)器的Web應(yīng)用程序:Activiti類庫(kù),帶有示例的H2數(shù)據(jù)庫(kù)。為了展示全圖,圖 1.11以示意圖的方式顯示了安裝結(jié)果。
Figure 1.11 An overview of the installation result of the Activiti tool stack, including a running Tomcat server and H2 database with all the Activiti web applications already deployed.
圖 1.11 Activiti工具棧安裝結(jié)果的概貌,包括運(yùn)行的Tomcat服務(wù)器和H2數(shù)據(jù)庫(kù),以及已經(jīng)部署的Activiti Web應(yīng)用
To verify if the installation has succeeded the web applications listed in table 1.1 should be available via your favorite web browser. You can use the user kermit with the same password to login to these applications.
為了驗(yàn)證安裝成功與否,應(yīng)該使用您喜好的web 瀏覽器訪問表 1.1所示的Web應(yīng)用。您可以使用用戶名和密碼均為kermit登錄到這些應(yīng)用中。
Table 1.1 The URIs of the web applications available for you after the installation of Activiti
表 1.1 Activiti安裝之后,您可訪問的Web應(yīng)用程序的URI
Application name |
URI |
Short description |
Activiti Probe |
The Probe application provides an admin console on the engine. Use this tool to verify your installation. Probe應(yīng)用提供了引擎的管理控制臺(tái)。使用這個(gè)工具來驗(yàn)證您的安裝。 |
|
Activiti Explorer |
The Explorer application can be used to work with the deployed processes.This is a good starting point to try the example processes. Explorer應(yīng)用程序用來管理部署的流程。這是嘗試示例流程的良好開端。 |
|
Activiti Cycle |
Activiti Cycle is a collaboration tool that can be use to browse the process repositories. Activiti Cycle是用來瀏覽流程倉(cāng)庫(kù)的協(xié)同工具。 |
|
Activiti Modeler |
http://localhost:8080/activiti- modeler/p/explorer
|
The Modeler application can be used to model BPMN 2.0 business processes. 建模器應(yīng)用程序能用來對(duì)BPMN 2.0業(yè)務(wù)流程建模。 |
By trying the Activiti Probe application, you can verify if the installation was successful. After logging in, you should get a message saying that everything is running fine. Working with demo processes is fun, but it’s even better to try out your own developed business process.
通過嘗試Activiti Probe應(yīng)用程序,您可以驗(yàn)證安裝成功與否。在登錄之后,您應(yīng)該得到一條消息,說明一切運(yùn)行均好。盡管運(yùn)行示例流程很愉快,但是最好嘗試您自己開發(fā)的業(yè)務(wù)流程。