1activiti awareness and database and plug-in configuration

Source: Internet
Author: User
Tags aop alfresco software jbpm

Workflow IntroductionWorkflow (Workflow)is the automated execution of business process management through a computer. It primarily addresses the process of automating the delivery of documents, information, or tasks among multiple participants in accordance with a predefined set of rules, to achieve a desired business goal, or to achieve this goal. " Activiti Alfresco Software announced the official launch of the Activiti Business Process Management (BPM) Open source project on May 17, 2010, with the chief architect of the business process management BPM expert Tom Baeyens, Tom Baeyens the original JBPM architect ,and JBPM is a very well-known workflow engine, of course Activiti is also a workflow engine. Activiti is a workflow engine that Activiti to extract complex business processes from a business system, define them using a specialized modeling language (BPMN2.0), and execute the business system in a defined process .The business process of business system is managed by Activiti, which reduces the workload of system upgrading and transformation of the business system due to the process change, thus improving the robustness of the system and reducing the cost of system development and maintenance. BPMBPM (Business process Management), or orchestration management, is a disciplined, end-to-end, business process-centric approach to continuously improve organizational business performance Systematic method for the purpose BPMNBPMN (Business process model and Notation)-orchestration models and symbols are a standard set of business process modeling symbols developed by BPMI (Management Initiative) ,use the symbols provided by BPMN to create business processes. The BPMN1.0 specification was released in May 2004. BPMI was incorporated into the OMG (the object Management Group Objects Management organization) in September 2005. The OMG released the final version of BPMN2.0 in January 2011.Activiti is modeled with bpmn2.0Two common keyword process definitions for processes, process examplesTheir relationship is like Java and Java objects.

1 Process Examples: A and B all initiate a sick leave, then a process instance of two sick leave is generated

2 process definition: A and B sick leave is a process definition

Activiti Service Architecture diagramThe above architecture is plainly to get the engine configuration object through Activiti.cfg.xml processengineconfigurationusing this configuration object to get the engine object Processengine,Finally, the process can be processed by the engine to obtain the individual service.Here is a brief introduction to the roles of each service
Repositoryservice Activiti resource management class, used for process deployment, to obtain resources for process deployment.
Runtimeservice Activiti process run management class to start a process instance and manipulate the current running process information
Taskservice Activiti task management classes, manipulating personal tasks, group tasks
Historyservice Activiti's history management class for manipulating historical process information
Identityservice Activiti user Identity Management class, set user, group (role), user, and group relationships.
Formservice Activiti forms management class that implements the configuration form data in Activiti.
ManagerService Activiti's engine management class, used for Activiti running monitoring, for super administrators.

Below isinstallation of ActiviActiviti:http://activiti.org/download.html(5.14 version I used)Download the post directory structure we have the database we need, activiti support a variety of databasesh2, MySQL, Oracle, Postgres, MSSQL, DB2I'm using MySQL as a demo here.How to create a database
    1. Mode 1
to the directory database-create find MySQL three SQLimport into a database of your own creation
    1. Mode 2

The way the program was created

in the Classpath directory, resume Activiti.cfg.xml (why the name of the resume in this position for this is said later)
<Beansxmlns= "Http://www.springframework.org/schema/beans"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"Xmlns:mvc= "Http://www.springframework.org/schema/mvc"Xmlns:context= "Http://www.springframework.org/schema/context"XMLNS:AOP= "HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP"Xmlns:tx= "Http://www.springframework.org/schema/tx"xsi:schemalocation= "Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/ Spring-beans-3.1.xsd Http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/s Pring-mvc-3.1.xsd Http://www.springframework.org/schema/context http://www.springframework.org/schema/context/ Spring-context-3.1.xsd HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP /spring-aop-3.1.xsd Http://www.springframework.org/schema/tx Http://www.springframework.org/schema/tx/spri Ng-tx-3.1.xsd ">    <BeanID= "DataSource"class= "Org.apache.commons.dbcp.BasicDataSource">        < Propertyname= "Driverclassname"value= "Com.mysql.jdbc.Driver" />        < Propertyname= "url"value= "Jdbc:mysql://localhost:3306/activiti" />        < Propertyname= "username"value= "Ferwms" />        < Propertyname= "Password"value= "Ferwms" />        < Propertyname= "Maxactive"value= "3" />        < Propertyname= "Maxidle"value= "1" />    </Bean>    <BeanID= "Processengineconfiguration"class= "Org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">        <!--Data Source -        < Propertyname= "DataSource"ref= "DataSource" />        <!--Activiti database table processing policy -        < Propertyname= "Databaseschemaupdate"value= "true" />    </Bean></Beans>

In fact, it is a spring configuration, you will find in the above processengineconfiguration there is a parameter databaseschemaupdate is the database processing strategy, several strategies are as followsfalse (Default): Checks the version of the database table and the version of the dependent library, and throws an exception if the version does not match. true: When the process engine is built, checks are performed and updates are performed if necessary. If the table does not exist, it is created. (Common)create-drop: Create a database table when the process engine is built, and delete these tables when the process engine is closed. drop-create: Delete the table and create the table first. (commonly used, change to true after use is complete)Create: Creates a database table when the process engine is built, and does not delete these tables when the process engine is closed. We chose true, so when we created the process engine, we would check that it didn't exist and create the following program to get the process engine object.
/ Find XML for resource name from Classpath directory (default activiti.cfg.xml if not specified)//  Find the Bean's ID for Processengineconfiguration's process engine configuration class from the inside,/// Of course there are other construction classes that can specify the Bean IDString resource = " Activiti.cfg.xml "= processengineconfiguration.                Createprocessengineconfigurationfromresource (Resource);         // gets the engine based on the process configuration object and discovers that the policy is true, // the database is created without a database, so the Activiti database is created automatically Processengine processengine = Configuration.buildprocessengine ();

What is the purpose of the different names when the database is created?act_re_*: ' RE ' represents repository. The table for this prefix contains the process definition and process static resources (pictures, rules, etc.). act_ru_*: ' RU ' indicates runtime. These run-time tables contain process instances, tasks, variables, asynchronous tasks, and other running data. Activiti only saves this data during the process instance execution and deletes the records at the end of the process. This way the run-time table can always be very small and fast. act_id_*: ' ID ' denotes identity. These tables contain identity information, such as users, groups, and so on. act_hi_*: ' HI ' means history . These tables contain historical data, such as historical process instances, variables, tasks, and so on. act_ge_*: GE says General. common data for different scenarios. installation of Activiti-designer plugin under Eclipse (Draw flowchart to generate BPMN file)I use the Eclipse-indigo version here, Other problems 1 open Eclipse create Myplugins folder 2 Unzip the above Activiti file into 3 Open the Dropins under Eclipse to create the file ACTIVITI.TXT4 settings inside the content is path=d:\\eclipse\\ Activiti address is your eclipse's own address 5 restart Eclipse, right click on new-other can find Activiti windows-preference point on this, you can generate a BPMN file while generating a process of PNG file, Because the Activiti code generated will be garbled, need to modify the source, very troublesome

Open Windows-showview-other to open the Properties view to make it easier to modify BPMN flowchart

1activiti awareness and database and plug-in configuration

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: info-contact@alibabacloud.com 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.