老样子,官网贴出来:https://www.activiti.org/。然后是get started,这里叫做quick start:https://www.activiti.org/quick-start
This quick start assumes:(基础准备)
- Familiarity with Maven and Java(对java和maven熟悉)
- A development environment with Java(有java的开发环境)
The following variables will be referenced in this tutorial(先声明后续步骤中会用到的名词)
Variable | Description |
---|---|
$mvnProject |
The root location of the maven project(maven项目的根目录) |
$actUnzipedPack |
The root location of the unzipped file downloaded fromhttp://www.activiti.org/download.html.(下载下来的解压后的activiti的根目录) |
$quickStartJavaProjectName |
The name of the Quick Start Java Project. This is recommended to be “ActivitiDeveloperQuickStart”.(快速上手项目的名字,建议是ActivitiDeveloperQuickStart) |
... |
Refers to information being skipped, for brevity sake.(老外真是严谨啊,这个也要说一下?) |
$actVer |
The version of Activiti currently being run.(版本号) |
1. Introduction(介绍)
This Quick Start shows the simplicity of embedding Business Process Management (BPM) into your application using Activiti. You will build a command-line application that embeds standards-based Business Process Modeling Notation (BPMN) logic into your application.告诉我们使用axtiviti的话,很容易就把BPM(业务处理管理)嵌入到我们自己的应用中了。
Activiti has advanced process design tools for embedding more sophisticated BPM logic into your application. These tools include an Eclipse-based and Web-Based BPMN Editor to name a few. For brevity, this Quick Start only uses Activiti’s Java APIs.当然activiti也有很多高级的插件可以供我们使用,比如基于eclipse的和 Web-Based BPMN Editor(不知道啥玩意)
2. Create and Setup Maven Project(创建一个maven项目)
Create a Java project called “ActivitiDeveloperQuickStart” (onwards referred to as$quickStartJavaProjectName
) with the following Maven dependencies:(创建一个名字叫做ActivitiDeveloperQuickStart的maven项目,不用任何的原型,一个最简单的maven项目即可。pom里面添加依赖,我使用idea来完成)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wxx</groupId>
<artifactId>ActivitiDeveloperQuickStart</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-engine</artifactId>
<version>6.0.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.21</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.21</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.193</version>
</dependency>
</dependencies>
</project>
Of course, $actVer
will be replaced with the downloaded Activiti version. For instance, if your downloaded Activiti package is “activiti-5.22.0” than the value of $actVer
will be 5.22.0.(下载的啥版本,pom里面就用啥版本)
Notice the following dependencies:
- Activiti (org.activiti) – Activiti’s BPM engine(这个是引擎)
- Database (com.h2database) – the H2 database(这个是数据库)
- Logging (org.slf4j) – Simple Logging Facade for Java(这个是简单的java日志接口)
When referring to build directories, the tutorial assumes the standard Maven build paths for your maven project:(标准maven项目目录结构不再赘述)
Path | Description |
---|---|
$mvnProject /src/main/java |
Java source directory |
$mvnProject /src/main/resources |
Resource directory |
$mvnProject /src/test/java |
Java test directory |
$mvnProject /src/test/resources |
Resource test directory |
You should be able to build the blank project. Please ensure that the overall state is “BUILD SUCCESS” before continuing.(可以是个空的项目,但是必须保证编译通过)
Command: mvn compile
Base Path: $mvnProject
3. Create Process Engine(创建流程机)
As suggested ea