Activiti User Guide -- Activit 用户指南 Part01

    终于告一个段落了,前一段时间忙着开发一个流转引擎,所以这一段时间也没有跟踪Activiti的进展,直到前几天才开始重新研究,觉得先把用户指南好好看看,顺便也进行了翻译,不敢独享,所以发表出来和大家一起分享。

    还是采用以前的方式同时把中英文发布出来,由于本人英语不是很好,所以翻译过程中肯定有很多值得商榷的地方,请大家多多包涵。

    后面我会逐渐把整个用户指南发布,现在还没有全部翻译完,所以只能一部分一部分的发布出来,希望大家了解。

 

 

Chapter 1. Introduction

第一章 简介

Table of Contents

License

Download

Sources

Required software

Reporting problems

License

许可

Activiti is distributed under the Apache V2 license.

Activiti是依据the Apache V2 license进行发布的。

Download

下载

http://activiti.org/download.html

Sources

源码

The distribution contains most of the sources as jar files. To find and build the full source codebase, please read the 'Building the distribution' wiki page

Activiti的发布包中以jar的方式包含了大部分的源码。在 'Building the distribution' wiki page 找到全部代码和如何进行编译。

Required software

运行环境

  • JVM 5+
  • Ant 1.7.1+

Reporting problems

报告问题

Every self respecting developer should have read How to ask questions the smart way

每一个开发人员都应该阅读How to ask questions the smart way

After you've done that you can post questions and comments on the Users forum and create issues in our JIRA issue tracker

当你阅读后你就可以在 the Users forum中发布你的问题和意见,同时可以在our JIRA issue tracker中创建相应的报告。


Chapter 2. Getting Started

第二章 启航

Table of Contents

Demo setup

Examples

Library dependencies

Eclipse setup

Checking the database

Demo setup

安装示例

Setup is an ant script located in directory setup that helps you get up and running with Activiti quickly.

Activiti的安装是一个ant脚本,存放在setup目录下,它可以帮助你快速将Activiti运行起来。

 

To run the script, you'll need a working Java runtime and Ant installation. Also make sure that the JAVA_HOME and ANT_HOME system variables are correctly set. The way to do this depends on your operating system, but the manual of ant gives a description on how to do this. The demo setup script is tested with Ant 1.7.1.

为了运行该脚本,你必须正确安装了JavaAnt运行环境。同时你也必须确认JAVA_HOMEANT_HOME系统变量设置正确。具体如何进行设置依赖于你的操作系统,具体可以参考manual of ant 。本示例脚本在Ant1.7.1下测试通过。

 

To configure setup for your environment, update property files build.properties and build.{your-database}.properties . Check those files for more information on configurable properties and potential values.

然后修改 build.properties  build.{your-database}.properties 属性文件。检查这些属性配置文件的属性项及相应的配置的值。

 

The easiest target to get started is demo.setup. That target will

启动Activiti的最简单的targetdemo.setup。该target

 

  • Fetch the library dependencies for the examples
  • 获取示例所依赖的包
  • Install the H2 in ${activiti.home}/apps/h2
  • 安装H2${activiti.home}/apps/h2目录
  • Start the H2 database
  • 启动H2数据库
  • Create the Activiti tables in the database
  • 在数据库中创建Activiti的表
  • Download Tomcat if not available in the ${downloads.dir}
  • 如果在${downloads.dir}目录不存在Tomcat安装文件,则进行下载
  • Install Tomcat in ${activiti.home}/apps/apache-tomcat-${tomcat.version}
  • 安装Tomcat${activiti.home}/apps/apache-tomcat-${tomcat.version}目录
  • Create an Activiti configuration jar
  • 创建Activiti配置jar
  • Install Activiti Engine into Tomcat, which includes libraries and configurations
  • 安装Activiti引擎到Tomcat,包含了相应的包机配置信息
  • Insert the demo users and groups in the Activiti identity tables (see below)
  • Activiti identity表中插入示例用户和岗位(参考下面)
  • Deploy the example processes to the Activiti Engine DB
  • 部署示例流程到Activiti 引擎数据库
  • Deploy the REST interface webapp into tomcat
  • 部署REST应用接口到tomcat
  • Download the Activiti Modeler webapp to ${activiti.home}/webapps
  • 下载Activiti建模工具到${activiti.home}/webapps
  • Deploy the Probe, Explorer and Modeler webapps into tomcat.
  • 部署ProbeExplorerModeler应用到tomcat
  • Start tomcat
  • 启动tomcat

After running this target H2 and Tomcat will be running in the background. To stop those processes run ant demo.teardown. Note that if you start Tomcat manually with the startup and shutdown scripts in tomcats bin directory, on some platforms Activiti Cycle will currently store configuration files in the working directory (which is the directory you start the script in).

当运行该target后,H2Tomcat将会在后台运行。你可以通过运行ant demo.teardown来停止。注意,如果你是通过手工启动tomcat bin目录下的startupshutdown时,在某些平台中Activiti Cycle将会把配置文件存放在相应的工作目录下(也就是你启动脚本的那个目录)。

 

The other targets in that build script can also be called individually and they will take the configurable properties into account. Run ant -pfor more details.

构建脚本中的其它target可以单独的调用,它们将获取相应的配置文件信息。运行ant –p 来查看详细的信息。

 

These are the demo users:

示例用户如下:

Table 2.1. The demo users

UserId

Password

Security roles

kermit

Kermit

admin

gonzo

Gonzo

manager

fozzie

Fozzie

user

 

Now you can access following web applications:

现在你可以通过下面的链接来访问应用了:

Table 2.2. The webapp tools

Webapp Name

URL

Description

Activiti Probe

http://localhost:8080/activiti-probe

The admin management console. Use this tool to see if the configured process engine is correctly initialized, DB tables contents.

管理控制台。通过该工具可以查看流程引擎配置是否正确被安装,数据库中表的内容。

Activiti Explorer

http://localhost:8080/activiti-explorer

The process engine user console. Use this tool to view your personal and candidate task lists and to complete tasks.

用户控制台。使用该工具可以查看个人任务、待确定任务列表,也可以完成任务。

Activiti Cycle

http://localhost:8080/activiti-cycle

The process cycle layer. Use this to browse repositories, execute transformations between model formats.

流程循环层。使用该工具可以查看流程定义??

Activiti Modeler powered by Signavio

http://localhost:8080/activiti-modeler

The web based process designer tool. Use this tool to graphically author BPMN 2.0 compliant process definitions files.

基于Web的流程定义工具。使用该工具可以生成符合BPMN2.0的流程定义文件。

 

Examples

示例

The distribution contains example source code that show different types of usages of Activiti and their library dependencies. The examples are grouped according to their dependencies.

发行包中所包含的示例源文件展示了Activiti的不同应用方式以及这些应用方式的依赖包。示例已经对它们依赖的包进行了有效的分组。

 

The distribution doesn't contain the library dependencies out-of-the-box, but the next section shows how the setup script can automatically download and organize the library dependencies. The examples directory in the root of the distribution contains these types of examples:

发行包中不包含额外的依赖包,在下一节中将展示安装脚本如何自动的下载和组织所依赖的包。发行包的examples目录下包含了以下示例:

 

  • activiti-engine: This set of examples show the most common usage of Activiti: BPMN process definitions and process executions are stored in a DB and the examples make use of the persistent API.
  • activiti-engine: 该系列的示例展示了Activiti:BPMN的常规用法,流程定义和流程实例都将存储在数据库中。示例还使用了持久化API
  • activiti-spring: These examples show how you can use the Activiti Engine in a Spring environment.
  • activiti-spring: 该示例展示了如何在Spring环境中使用Activiti引擎。
  • activiti-pvm These examples show the bare bones Process Virtual Machine. No persistence, no process language. This is the basis for building your own process language and engine.
  • activiti-pvm : 该示例展示了最核心的流程虚拟机。没有持久化,没有流程语言。使用该基础你可以构建自己的流程语言和引擎。

Library dependencies

依赖包

Activiti takes great care in minimizing library dependencies. The 3rd party library dependencies are not included in the Activiti download to reduce the download size, but the setup script can download and organize the library dependencies for those examples that you want to explore.

Activiti尽量缩小对其它的依赖。为了减少下载的大小Activiti发行包中不包含第三方依赖包,但是在示例安装脚本中可以自动下载和组织相应的依赖包。

 

Fetching the library dependencies is included in the demo.setup

依赖包的获取已经包含在demo.setup target中。

 

To download the library dependencies, use one of these targets in the ant setup/build.xml file:

你可以通过setup/build.xml以下target获取相应的依赖包:

  • examples.get.libs.all
  • examples.get.libs.engine
  • examples.get.libs.spring
  • exam
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
首先,Activity是Android系统中的四大组件之一,可以用于显示View。Activity是一个与用记交互的系统模块,几乎所有的Activity都是和用户进行交互的,但是如果这样就能说Activity主要是用来显示View就不太正确了。 在深入了解Activity之前,我们先要知道一下MVC设计模式,在JAVAEE 中MVC设计模式已经很经典了,而且分的也比较清晰了,但是在Android中,好多人对MVC在Android开发中的应用不是很清楚,下面我就先来介绍一下MVC在Android开发中的应用: M(Model 模型):Model是应用程序的主体部分,所有的业务逻辑都应该写在这里,在Android中Model层与JavaEE中的变化不大,如:对数据库的操作,对网络等的操作都放在该层(但不是说它们都放在同一个包中,可以分开放,但它们统称为Model层)。 V(View 视图):是应用程序中负责生成用户界面的部分,也是在整个MVC架构中用户唯一可以看到的一层,接收用户输入,显示处理结果;在Android应用中一般采用XML文件里德界面的描述,使用的时候可以非常方便的引入,当然也可以使用JavaScript+Html等方式作为View。 C(Controller控制层)android的控制层的重任就要落在众多的activity的肩上了,所以在这里就要建议大家不要在activity中写太多的代码,尽量能过activity交割Model业务逻辑层处理。 好了,在介绍过Android应用开发中的MVC架构后,我们就可以很明确的知道,在Android中Activity主要是用来做控制的,它可以选择要显示的View,也可以从View中获取数据然后把数据传给Model层进行处理,最后再来显示出处理结果。 介绍过Activity的主要作用后,那么我们就要详细说一下Activity了。 Activity生命周期图 Activity 的生命周期是被以下的函数控制的。 public class Activity extends ApplicationContext { protected void onCreate(Bundle icicle); protected void onStart(); protected void onRestart(); protected void onResume(); protected void onFreeze(Bundle outIcicle); protected void onPause(); protected void onStop(); protected void onDestroy(); } onCreate(Bundle) 函数是你进行初始化的地方,这个也是执行 setContentView(View)函数的地方,setContentView(View)函数可以传入一个由XML 编制的UI界面,可以使UI和具体实现完全分离。 onPause()函数是处理用户离开当前 Activity 的地方。更重要的是,任何在当前 Activity中的任何改变都要在这个函数中提交。 Activity有四种状态: 活动状态,当Activity处于Stack(栈)顶时,就是手机当前的现实屏幕,这是 Activity就 处于activity或者运行状态。 运行但是失去焦点,当Activity还处于运行状态时,但是屏幕是有另外一个Activity 处于文档处于焦点状态,当前的Activity就处于pause。 停止,当Activity被另一个Activity完全覆盖的时候,就被停止了,其实就是虽然在 运行,但是用户却看不见。 结束,当Activity处于pause或者stop时,系统可以结束 Activity,回收资源,这 是Activity就是处于结束状态了。 处于结束状态的是Activity,如果要使用户可见,只要重启才可以。 Activity的响应时间 当前Activity所在的线程为主线程,它的响应时间为5秒,如果在当前运行的Activity中进行耗时的操作且响应时间起过5秒,那么程序就会报ANR错误。所以,这也是不建议在Activity中写太多复杂代码的原因之一。 当然,有些代码只能写在Activity中,不然就运行不了(它们不是生命周期方法),比如你想要获得android系统或者硬件一的些信息,就必须在Activity中写出来,如果单独写一个工具类获得不了。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值