One, overview
JBPM Full name-- Java Business prcessmanagerment ( Orchestration Management ) , it is an open, flexible and extensible executable process language framework that covers business process management, workflow, and service collaboration.
Two, the biggest feature
( 1 Its business logic definition did not adopt some of the current specifications, but instead adopted its own definition of jboss Jbpm Process definition Language (JPDL) jpdl Task a business process can be seen as a uml Span lang= "ZH-CN" > state diagram. jpdl think that a business process can be seen as a uml Span lang= "ZH-CN" > state diagram. jpdl
(2) use Hibernate to manage the JBPM database.
Thirdly, it introduces Several important tables of Jbpm by examples. (1) Jbpm total sheet
(2) Some of the basic processes involved are:
--Deploy process definition, START process instance, get personal ( Group ) tasks, highlighting ( View Process Progress Chart ) , complete the task ....
(3) Example:take the leave process as an example:
Qingjia.jpdl.xml:
<?xmlversion= "1.0" encoding= "UTF-8"?> <processname= "qingjia1" xmlns= "HTTP://JBPM.ORG/4.4/JPDL" key= " Qingjia1 "> <start g=" 246,28,7,3 "name=" Start1 "> <transition g=" -71,-17 "name=" to apply for leave "to=" Apply for Leave " /> </start> <end g= "226,320,48,48" name= "End1"/> <task assignee= "Zhang San" g= "88,99,92,52" Name= "Apply for Leave" > <transition g= " -138,5" name= "to Department manager approval" to= "department manager approval"/> </task> <task Assignee= "John Doe" g= "233,156,92,52" name= "department manager approval" > <transition g= "3,-26" Name= "to general manager approval" to= "general manager approval"/> </task> <task assignee= "Wang er Leper" g= "380,226,92,52" Name= "general manager Approval" > <transition g= " -47,-17" name = "to End1" to= "End1"/> </task></process>
Qingjia.png:
(1) deployment Process Definition--from Classpath Loading Jpdl.xml file
Public staticprocessengine processengine;processengine =configuration.getprocessengine (); Public Voidtestdeployfromclasspath () {Processengine.getrepositoryservice (). Createdeployment (). Addresourcefromclasspath ("Qingjia.jpdl.xml"). Addresourcefromclasspath ("Qingjia.png"). deploy ();
Tables related to:
Table name (English) |
Table Name (medium) |
Description |
Field |
Field description |
|
Jbpm4_deployment |
Deployment tables |
Describe one deployment |
Dbid_ |
Primary key, Deployment ID |
|
State |
Status Active |
|
Jbpm4_lob |
Warehouse Table |
The Process definition document (XML, PNG) is stored |
Deployment_ |
Deployment ID, FOREIGN key |
|
Name_ |
File path for XML or PNG |
|
Jbpm4_deployprop |
Deployment Property sheet |
|
Dbid_ |
Primary key |
|
Objname_ |
Process definition Name |
|
Key_ |
Generate 4 rows of records per deployment |
|
Langid |
language version jpdl-4.4 |
Pdid |
{Pdkey-version} |
Pdkey |
Process definition Name In general, the values of Pdkey and objname_ are the same |
Pdversion |
Version number If the Pdkey has not changed, each deployment, the version number plus 1, if the pdkey changes, it is a brand-new name, so the version number should be calculated starting from 1 |
(2) START Process Instance--based on Id Start
Public Voidteststartpibypdid () {Processinstancepi = Processengine.getexecutionservice (). Startprocessinstancebyid (" Qingjia1-1 "); System.out.println (Pi.getid ()); System.out.println (Pi.getstate ());}
Table name (English) |
Table Name (medium) |
Description |
Field |
Field description |
|
Jbpm4_execution |
Process Instance Table |
Represents a process instance that is currently executing |
Dbid_ |
Primary key |
|
Id_ |
Process Instance ID |
|
Activityname_ |
Node active for the current process instance |
|
Procdefid_ |
Process definition ID |
|
Jbpm4_hist_procinst |
Elapsed Process Instance Table |
A process instance that represents history, but the process instance that is currently running is also here |
Dbid_ |
Primary key |
|
Id_ |
Process Instance ID |
|
Start_ |
Start time of the entire process instance |
|
End_ |
The end time of the process instance, or null if the process instance is the currently running process |
|
State |
Represents the state of the process instance, if it is running as active, if the process instance ends with ended |
|
Jbpm4_task |
Task table |
Represents the currently executing task (the task is a node of the JBPM flowchart) |
Dbid_ |
Primary key, task ID |
Temporary table, after the current task is completed, the data is deleted; When the process instance is started, it automatically leaves the start node and flows to the next node |
Name_ |
Task Name |
|
Assignee_ |
Mandate holders |
|
Jbpm4_hist_task |
History Task Table |
A task that represents history, but the task that is currently being performed is also here |
State_ |
If a task is completed, the value is completed |
|
End_ |
Task End Time |
|
Jbpm4_hist_actinst |
Elapsed Node Table |
A node that represents history |
Type |
Node type |
|
Four, table structure summary:
A total of 18 sheets. Red is a common table
(1) resource pool and run-time table structure
1. jbpm4_deployment Process Definition Table
2. jbpm4_deployprop Process definition attribute table
3. jbpm4_execution Process Instance Table
4. Jbpm4_property Process engine Table
5. Jbpm4_task Task Table
6. jbpm4_variable Context Table
7. Jbpm4_job Timing Table
8. Jbpm4_lob Storage Table
9. Jbpm4_swimlane Swimlane Table
Jbpm4_participation Participant Table
(2) Historical Data sheet
Jbpm4_hist_actinst Process activity (node) instance table
Jbpm4_hist_detail Process History Detail Table
Jbpm4_hist_procinst Process Instance History table
Jbpm4_hist_task Process Task Instance history table
Jbpm4_hist_var process variables (context) History table
(3) Identity Verification table structure
Jbpm4_id_group Group table
Jbpm4_id_membership User Role Table
Jbpm4_id_user User Table
JBPM table Structure