Introduction to the jbpm of workflow

Source: Internet
Author: User
Tags jbpm

since doing Itoo It's really something that feels like I know more and more. But the real system of learning a series of things is less, in the project has been required workflow, although the workflow of the atmosphere is more and more feel the workflow is a good thing, Until a few days ago I learned some knowledge of workflow based on video and felt that I was getting closer to work.

First, WorkFlow

Workflow (Workflow), which is the "automation of apart or whole of a business process in a computer-based environment", mainly addresses "enabling the delivery of documents between multiple participants according to a predefined rule, The process of information or tasks is automated in order to achieve a desired business goal, or to facilitate the realization of this goal. "

Second, JBPM

the workflow engine does not mean just JBPM, It's just one of the workflow engines and is based on Java Lightweight workflow Management system. JBPM uses the JPDL process definition language to abstract the business processes that handle transactions in real life, forming a set of business process rules that must be followed in order to process the business .

1 , graphical process definition, intuitive description of business processes

2 , Hibernate management, separating the management functions of the data JBPM focus on the processing of business logic.

Third, JBPM the Use

1 , preparatory work:

( 1 ) first install gpd ( eclipse graphical process designer)

( 2 ) configuration Runtime Environment, Configuration JPDL XML of the SCHEMENDTD ,

( 3 ) to import the development Jbpm.jar Package

2 , creating JPDL Process Definition


Code:

<?xml version= "1.0" encoding= "UTF-8"? ><process key= "Jbpm01" name= "jbpm01" xmlns= "HTTP://JBPM.ORG/4.4/JPDL" >   <start g= "274,66,48,48" name= "Start1" >      <transition g= " -69,-22" name= "submitted to section chief" to= "Chief approval"/>   </start>   <task assignee= "${kezhang}" g= "224,161,92,52" name= "section chief Approval" >      <transition g= "-69 , -22 "Name=" submitted to director "To=" Director approval "/>   </task>   <task assignee=" ${zhuren} "g=" 245,264,92,52 "name=" director approval " >      <transition g= " -42,-5" name= "through" to= "End1"/>   </task>   <end g= "265,355,48,48" Name= " End1 "/></process>

3 , Process Deployment

1. Deployment process public void deploy () {//equals sessionfactory in Hibernate, responsible for creating various services in jbpm processengine processengine =  Configuration.getprocessengine (); Repositoryservice Repositoryservice = Processengine.getrepositoryservice (); Repositoryservice.createdeployment (). Addresourcefromclasspath ("Jbpm01.jpdl.xml"). deploy ();}

After the process is deployed, the default database for the workflow is generated in the database:


4 , creating a process instance

2. Create the process instance public  void CreateInstance () {processengine processengine= configuration.getprocessengine (); Executionservice Executionservice=processengine.getexecutionservice ();//process-defined object ProcessInstance processInstance = Executionservice.startprocessinstancebykey ("jbpm01"); SYSTEM.OUT.PRINTLN ("process instance id====" + Processinstance.getid ());}

After creating the process instance:

Jbpm4_execution (Process instance table): Add a record

Jbpm4_hist_procinst (Process Instance History table): Add a record

Jbpm4_variable (table): Add a record

Jbpm4_task (Task table): Add a record

Jbpm4_hist_task (Task History table): Add a record

Jbpm4_hist_actinst (Active node Instance table): Add a record

In fact, this workflow can work normally, the other we just need to get the current task according to the user, or get the current node of the process or complete the task can be, is very simple.

Although the work flow into the door is simple but really want to use it is still a bit difficult.

Introduction to the jbpm of workflow

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.