Three minutes to understand Activity workflow -- java application

See: http://www.it165.net/pro/html/201504/37443.html


maven/ java /web/bootstrap/dataTable/app development QQ group: 566862629. I hope more people can help me learn together.


 

1. What is Workflow

Taking leave as an example, the leave process of most companies is now like this

The employee calls (or chats online) to apply for leave to the superior - the superior verbally agrees - the superior records the leave request - submits the leave request record to the company at the end of the month - the company records the leave request into the computer

The leave process of a company that adopts workflow technology is like this

The employee uses the account to log in to the system - click to ask for leave - the superior login system click to allow

Just like that, the leave process is over.

Some people will ask, that the superior does not need to submit the leave record to the company? The company does not need to record records into the computer? The answer is, use it. But all this work will run automatically after the superior clicks Allow!

This is workflow technology.

 

The definition of workflow given by Georgakopoulos is: Workflow is to organize a set of tasks to complete a certain business process: it defines the trigger sequence and trigger conditions of tasks. Each task can be completed by one or more software systems, or it can be Completed by one or a group of people, and can also be done by one or more people in collaboration with the software system

 

The advantages of workflow technology

From the above example, it is easy to see

The workflow system realizes the automation of the workflow, improves the efficiency of enterprise operation, improves the utilization of enterprise resources, improves the flexibility and adaptability of enterprise operation, improves the efficiency of quantitative assessment of business processing, and reduces waste (time is money).

Manual processing of workflow, on the one hand, cannot effectively track and understand the entire process status, on the other hand, human errors and time delays will inevitably lead to low efficiency, especially the inability to perform quantitative statistics, which is not conducive to query and reporting. and performance evaluation.

 

3. Why do Java developers want to learn Activity workflow

在Java领域,JBPM和Activity是两个主流的工作流系统,而Activity的出现无疑将会取代JBPM(Activity的开发者就是从Jbpm开发者出来的)。

 

四、 Activity工作流学习要点

 

1. 1个插件

在Eclipse中安装Activity插件,让你可以在Eclipse中绘制Activity工作流图

 

2. 1个引擎

ProcessEngine对象,Activity工作流引擎。这是Activiti工作的核心。负责生成流程运行时的各种实例及数据、监控和管理流程的运行。

所有的操作都是从获取引擎开始的,所以一般会把引擎作为全局变量

ProcessEngine processEngine =ProcessEngines.getDefaultProcessEngine();

 

3. 1个配置文件

activiti.cfg.xml。Activiti核心配置文件,配置流程引擎创建工具的基本参数和数据库连接池参数

 

4. 5种数据库表

Activiti的后台是有数据库的支持,所有的表都以ACT_开头。 第二部分是表示表的用途的两个字母标识。用途也和服务的API对应。

ACT_RE_*: 'RE'表示repository。 这个前缀的表包含了流程定义和流程静态资源(图片,规则,等等)。

ACT_RU_*: 'RU'表示runtime。 这些运行时的表,包含流程实例,任务,变量,异步任务,等运行中的数据。 Activiti只在流程实例执行过程中保存这些数据,在流程结束时就会删除这些记录。 这样运行时表可以一直很小速度很快。

ACT_ID_*: 'ID'表示identity。 这些表包含身份信息,比如用户,组等等。

ACT_HI_*: 'HI'表示history。 这些表包含历史数据,比如历史流程实例,变量,任务等等。

ACT_GE_*: General data, used in different scenarios, such as storing resource files.

 

5. 23 tables

Different tables store different aspects of data, including process definition table, task node table, process variable table, task history table and so on.

 

6. 5 services

Different Service classes correspond to different functions.

For example, TaskService is the task service class of activiti. Information about tasks can be obtained from this class.

The HistoryService is a class for activiti to query historical information. After a process is executed, this object provides us with query history information.

 

7. 7 basic operations

Design flowcharts (various components such as wires, user tasks, gateways)

Process definition additions, deletions, modifications and inspections

Process variable addition, deletion and modification

start process definition

Task CRUD

mission accomplished

Historical information query

 

When learning the 7 basic operations, you only need to execute it under JavaSE. Of course, when doing web projects, you must consider the combination of development frameworks such as SSH. Of course, comprehensive development is not difficult only if the basic operations are learned.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324881804&siteId=291194637