Activiti Workflow Framework Learning (i)--environmental construction and data table understanding __ACTIVITI5

Source: Internet
Author: User
Tags alfresco software jbpm
One, what is the workflow

A workflow (Workflow), which is "automation of a part or whole of a business process in a computer application environment", is primarily about "automating the process of delivering documents, information, or tasks across multiple participants in accordance with a predefined rule, to achieve an expected business goal, or to promote the realization of this goal. "

The Workflow management system (Workflow Management SYSTEM,WFMS) is a software system that completes the definition and management of the workload and executes the workflow instance according to the predefined workflow logic in the system. Workflow management system is not an enterprise's business system, but provides a software support environment for the operation of Enterprise's business system. ii. Common Workflow Framework

The popular workflow frameworks are: Activity5.13, JBPM4.4, Osworkflow, WorkFlow

The bottom of the workflow framework needs to be supported by a database, activiti5.13 version, with 23 sheets.

The JBPM4.4 framework has database support at the bottom, 18 sheets.

The JBPM low-level uses the hibernate operation database.

Activiti the MyBatis Operational database used at the bottom of the framework. iii. introduction of Activiti5

ACTIVITI5 is a business process management (BPM) framework released by the alfresco software on May 17, 2010, an open source, flexible, and extensible executable process language framework covering business process management, workflow, service collaboration, and more. Activiti based on the Apache-licensed open source BPM platform, founder Tom Baeyens is the JBoss JBPM Project architect, featuring the Eclipse plug-in, which allows developers to paint business flowcharts directly through Plug-ins.

Iv. Installing Activiti process designer Plug-ins

Step one: Get the installation package for downloading the Activiti-eclipse plugin

Step Two: Unpack the installation package, copy the Activiti into the Dropins directory in eclipse

Step three: Restart Eclipse and check the save option

Fourth step: If the Activiti icon is not displayed by restarting Eclipse, indicating that the eclipse version you are using does not support the plug-in, you can choose to swap myeclipse or another version of Eclipse v. Initialize the ACTIVITI framework datasheet 5.1 Download Activiti Frame

Activiti frame Download Address: 5.2 Create a database

5.3 Using the Activiti Framework automatic table-building function

The Activiti framework provides automatic table-like functionality similar to hibernate

Build the development environment:

First step: Create a Java project activiti1110

Step two: Import the jar package (import the jar package from the demo below the downloaded activiti-5.13 workflow engine) and import the MySQL driver package 1, do not use the configuration file (not recommended)

Test Code:

Package Net.csdn.activiti;
Import Org.activiti.engine.ProcessEngine;
Import Org.junit.Test;
The public class HelloWorld {
    * uses the ACTIVITI framework to provide automatic tables (no profiles)
   /@Test public
   void Test1 () {
      // Create a process engine configuration object
      processengineconfiguration configuration = Processengineconfiguration.createstandaloneprocessengineconfiguration ();
      Configure the data source
      configuration.setjdbcdriver ("Com.mysql.jdbc.Driver");
        Configuration.setjdbcurl ("jdbc:mysql://localhost:3306/activiti_1110?useunicode=true&characterencoding= UTF-8 ");
      Configuration.setjdbcusername ("root");
        Configuration.setjdbcpassword ("root");
        Set up automatic table
        configuration.setdatabaseschemaupdate ("true");
        Creates a process engine object that automatically creates the table
        processengine processengine =configuration.buildprocessengine () when the process engine object is created;

2, use the configuration file

The configuration file Activiti-context.xml is as follows:

<beans xmlns= "Http://" xmlns:context= " Schema/context "xmlns:tx=" Http:// "xmlns:xsi=" Xmlschema-instance "xsi:schemalocation=" Http:// http:// http:// http:// "> <!--Configure the process engine configuration object--> <bean id=" processengineconf Iguration "class=" org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration "> <property name=" JD Bcdriver "value=" Com.mysql.jdbc.Driver "/> <property name=" Jdbcurl "value=" Jdbc:mysql://localhost:3306/activi ti_1110 "/> <property name=" jdbcusername "value=" "Root"/> <properTy name= "Jdbcpassword" value= "root"/> <property name= "Databaseschemaupdate" value= "true"/> &LT;/BEAN&G
T </beans>

Test Code:

    * Use the automatic table provided by the framework (provide configuration file)---configuration file activiti-context.xml can obtain the
   @Test public
   void Test2 () from the example program provided by the framework {
      String resource = "activiti-context.xml";//configuration file name
      String beanname = "processengineconfiguration";//configuration ID value
      processengineconfiguration conf = Processengineconfiguration
            . Createprocessengineconfigurationfromresource (Resource,
      Processengine processengine =conf.buildprocessengine ();

3, use the configuration file (using the default configuration)

Requires the profile name to be Activiti-context.xml or activiti.cfg.xml because, because the default configuration Processengines.getdefaultprocessengine (); One of these two files is initialized, and the default configuration information is as follows:

Test Code:

    * Use framework to provide automatic table (using configuration file) *
   @Test public
   void Test3 () {
      Processengine processengine = Processengines.getdefaultprocessengine ();

Vi. understanding of 23 sheets

Activiti background is supported by the database, and all tables begin with Act_. The second section is a two-letter identifier that represents the purpose of the table. The purpose also corresponds to the API of the service.

1) act_re_*: ' RE ' means repository. This prefix table contains the process definition and process static resources (pictures, rules, and so on).

2) act_ru_*: ' RU ' means runtime. These run-time tables, including process instances, tasks, variables, asynchronous tasks, and so on run the data. Activiti saves the data only during process instance execution and deletes the records at the end of the process. This way the runtime table can always be very small and fast.

3) act_id_*: ' ID ' indicates identity. These tables contain identity information, such as users, groups, and so on.

4) act_hi_*: ' HI ' means history. These tables contain historical data, such as historical process instances, variables, tasks, and so on.

5) Act_ge_*: General data, for different scenarios. resource pool process rules table

1) Act_re_deployment Deployment Information table

2) Act_re_model process Design Model Deployment table

3) act_re_procdef process definition datasheet run-time database table

1) act_ru_execution run-time Process Execution Instance table

2 Act_ru_identitylink the Run-time process personnel table, mainly stores the task node and the participant's related information

3) act_ru_task The Runtime Task node table

4 act_ru_variable run-time process variable datasheet history database table

1) Act_hi_actinst History node table

2) Act_hi_attachment History Annex table

3) Act_hi_comment Historical Opinion form

4) Act_hi_identitylink History process Personnel table

5 Act_hi_detail History Detail table, provide query of historical variables

6) Act_hi_procinst History Process Instance table

7) Act_hi_taskinst History task Instance table

8) Act_hi_varinst history variable table Organization table

1) Act_id_group User Group Information table

2) Act_id_info User extended Information table

3) act_id_membership user and user group corresponding information table

4) Act_id_user User Information table

These four tables are very common, basic organization management, on the user authentication suggestion or own development set, the function of the component is too simple, the use of a lot of requirements difficult to meet the General data table

1) Act_ge_bytearray Binary data table

2 The Act_ge_property property datasheet stores the entire process engine level of data, and when the table structure is initialized, three records are inserted by default

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.