In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Workflow introduction
Workflow (Workflow) is to automate the management of business processes through computers. It mainly deals with the process of automating the transmission of documents, information, or tasks among multiple participants in accordance with certain predefined rules.
In order to achieve a desired business goal, or promote the realization of this goal.
Activiti
Alfresco software announced the official launch of the Activiti business process management (BPM) open source project on May 17, 2010. its chief architect is Tom Baeyens, an expert in business process management BPM, and Tom Baeyens is the architect of the original jbpm.
Jbpm is a very famous workflow engine, and of course activiti is also a workflow engine.
Activiti is a workflow engine. Activiti can extract complex business processes from business systems, define them using a special modeling language (BPMN2.0), and execute business systems according to predefined processes.
It realizes that the business process of the business system is managed by activiti, which reduces the workload of upgrading the business system due to process changes, so as to improve the robustness of the system and reduce the cost of system development and maintenance.
BPM
BPM (Business Process Management), that is, business process management, is a systematic approach to standardize the construction of excellent end-to-end business processes and to continuously improve the business performance of the organization.
BPMN
BPMN (Business Process Model And Notation)-Business process models and symbols are a set of standard business process modeling symbols developed by BPMI (Business Process Management Initiative)
Business processes can be created using symbols provided by BPMN. The BPMN1.0 specification was issued in May 2004. BPMI was incorporated into OMG (The Object New Waterway training Management Group object Management Organization) in September 2005. OMG released the final version of BPMN2.0 in January 2011.
Activiti uses bpmn2.0 to model.
Two commonly used keywords about process: process definition, process example
Their relationship is like java classes and java objects.
1 process instance (ProcessInstance): both an and b initiate a sick leave, so two process instances of sick leave are generated.
2 process definition (ProcessDefinition): sick leave called in an and b is a process definition
Activiti service architecture diagram
To put it bluntly, the above architecture is to obtain the engine configuration object ProcessEngineConfiguration through activiti.cfg.xml.
Get the engine object ProcessEngine through this configuration object
Finally, each service can be obtained through the engine to process the process.
The role of each service is briefly described below
RepositoryServiceactiviti's resource management class, which is used for process deployment and gets the resources for process deployment. RuntimeServiceactiviti's process operation management class, which is used to start a process instance, operate the currently running process information TaskServiceactiviti task management class, operate individual tasks, group task HistoryServiceactiviti history management class, operate historical process information IdentityServiceactiviti user identity management class, set users, groups (roles), users and group relationships. FormServiceactiviti form management class to implement the configuration of form data in activiti. ManagerServiceactiviti engine management class, used to monitor the operation of activiti, for super administrators to use.
Here is the installation of activi
Activiti download address: http://activiti.org/download.html (version 5.14 I used)
After downloading, the directory structure
Database has the database we need, and activiti supports multiple databases.
H3, mysql, oracle, postgres, mssql, db2
I use mysql to do the demonstration here.
How to create a database
You need to add the jar package of spring and the jar of mybatis, preferably under the environment of both ssm and testing.
Mode 1
Go to database-create to find the three sql of mysql and import them into the database created by yourself.
Mode 2
In the way of program creation
Create an activiti.cfg.xml under the classpath directory (why set up a name of this later in this location)
Actually, it is a configuration of spring.
You will find that there is a parameter databaseSchemaUpdate in the above processEngineConfiguration, which is the strategy for database processing. Several strategies are as follows
False (default): check the version of the database table and the version of the dependent library, and throw an exception if the version does not match.
True: when building the process engine, perform checks and updates if necessary. If the table does not exist, create it. (commonly used)
Create-drop: database tables are created when the process engine is built and deleted when the process engine is closed.
Drop-create: delete the table before creating it. (commonly used, change to true after use)
Create: database tables are created when the process engine is built, and these tables are not deleted when the process engine is closed.
We chose true, so when we create the process engine, we will check that it does not exist and create it.
The following program gets the process engine object
/ find the xml of the resource name from the classpath directory (default activiti.cfg.xml if not specified) / / find out that the id of bean is the process engine configuration class of processEngineConfiguration. / / of course, there are other construction classes that can specify idString resource = "activiti.cfg.xml" of bean; ProcessEngineConfiguration configuration = ProcessEngineConfiguration. CreateProcessEngineConfigurationFromResource (resource); / / configure the object acquisition engine according to the process. The discovery policy is true,//, that is, to create a database without a database, so the activiti database ProcessEngine processEngine = configuration.buildProcessEngine () will be created automatically.
/ * * do you want to get the process engine object? by default, the following method looks for the id named activi.cfg.xml * in the classpath directory for the ProcessEngineConfiguration engine configuration object of processEngineConfiguration to get the ProcessEngine object * / ProcessEngine engine = ProcessEngines.getDefaultProcessEngine ()
The above two ends of the code have the same function to obtain the process engine object, but the acquisition method below needs to pay attention to the location and naming convention of xml
The created database
So what is the purpose of different names?
ACT_RE_*: 'RE' stands for repository. The prefix table contains the process definition and process static resources (pictures, rules, etc.).
ACT_RU_*: 'RU' stands for runtime. These runtime tables contain process instances, tasks, variables, asynchronous tasks, and other running data. Activiti saves this data only during the execution of the process instance and deletes these records at the end of the process. In this way, the runtime table can always be small and fast.
ACT_ID_*: 'ID' stands for identity. These tables contain identity information, such as users, groups, and so on.
ACT_HI_*: 'HI' stands for history. These tables contain historical data, such as historical process instances, variables, tasks, and so on.
ACT_GE_*: GE stands for general. General data, used in different scenarios.
Installation of activiti-designer plug-in under eclipse (drawing flow chart to generate bpmn file)
Note that the plug-in needs to be downloaded separately (available at Baidu), not the official compressed package with jar above!
First you need to know what this plug-in does:
After installing this plug-in, you can draw a flow chart in eclipse according to the rules of bpmn2.0. The flow chart file ends with bpmn. To put it bluntly, opening it with notepad after drawing is xml, but the format is bpmn.
Installation steps:
I use the eclipse-indigo version here, but there are other problems.
1 Open eclipse to create a myplugins folder
2 decompress the above activiti file and put it in it
3 Open dropins under eclipse to create file activiti.txt
4 set the content to path=d:\\ eclipse\\ activiti address is your own eclipse address
5 restart eclipse, right-click New-other to find activiti
Click this on windows-preference to generate a png file of the process while generating the bpmn file, because the activiti code will generate garbled code and need to modify the source code, which is very troublesome
Open windows-showView-other to open the properties view, you can more easily modify the bpmn flow chart
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.