Start learning jbpm

Source: Internet
Author: User
Tags jbpm

 

Jbpm is required because of the work relationship, but I have never touched it before. It should be from scratch. I will write down some of my learning points later. My tutorial is a Chinese version of jbpm jpdl user development manual 3.2.3, however, it is faster than reading English slowly. Now we are talking about efficiency, and the author is a kind of person.

 

  Download: (jbpm SourceForge file list)

Jbpm-jpdl-suite-3.2.3.zip

  There is no special reason. This version is used in the tutorial.

Eclipse-jee-europa-winter-win32.zip

  To use the jbpm 3.2.3 designer plug-in, you must support eclipse 3.3. You can only temporarily shelve eclipse 3.5.

 

  Installation:

  Of course, the premise of using jbpm is that you have installed and configured JDK. You don't have to talk about it,

  1. Decompress jbpm-jpdl-stuite-3.2.3.zip.
  2. Decompress eclipse-jee-europa-winter-win32.zip
  3. Install the graphics designer plug-in. Copy the content in the eclipse folder under the decompressed designer directory to the root directory of eclipse 3.3, and restart eclipse to complete plug-in installation. After the plug-in is installed, you can find related items of jbpm in the new dialog box. Expand the "JBoss jbpm" branch in eclipse's "WINDOW> Preferences" and add a runtime Location Path to the path after the jbpm-jpdl-stuite-3.2.3 is decompressed. You can see the deployment configuration of jbpm in the server deployment branch.

      Copy the content in the eclipse folder under the designer directory decompressed by jbpm-jpdl-stuite-3.2.3.zip to the root directory of eclipse 3.3, and restart eclipse to install the plug-in. After the plug-in is installed, you can find related items of jbpm in the new dialog box.

  4. Configure the jbpm plug-in runtime environment.
     Expand the "JBoss jbpm" branch in eclipse's "WINDOW> Preferences" and add a runtime Location Path to the path after the jbpm-jpdl-stuite-3.2.3 is decompressed. You can see the deployment configuration of jbpm in the server deployment branch.

 

  Hello, world:

Take Hello, world in the tutorial as an example. The process is as follows.

 

  

 

Create a new"Process Project"Project, and then create a helloworld class.

Package Org. zym. helloworld; <br/> Import Org. jbpm. graph. def. processdefinition; <br/> Import org.jbpm.graph.exe. processinstance; <br/> Import org.jbpm.graph.exe. token; <br/> Import JUnit. framework. testcase; <br/> public class helloworld extends testcase {<br/> Public void testhelloworldprocess () {<br/> // This method displays the execution of a process definition and a process definition. <Br/> // The process definition has three nodes: <br/> // Untitled Start-state, state's and end-state nodes named 'end' <br/> // The next line parses XML text to the processdefinition class <br/> // processdefinition is used as a Java object the formal description of the process. <Br/> string xml = "<process-definition>" + "<start-State>" <br/> + "<transition to ='s '/>" +" </start-State> "<br/> +" <state name ='s '> "+" <transition to = 'end'/> "+" </State> "<br/> +" <end-state name = 'end'/> "+" </process-definition> "; <br/> processdefinition = processdefinition <br/>. parsexmlstring (XML); <br/> // create a process definition execution in the next row. After the creation, the process execution has a master path <br/> // (= root token), which is located in the sta RT-state node location. <Br/> processinstance = new processinstance (processdefinition); <br/> // create a master path (= root token) for process execution. <br/> token = processinstance. getroottoken (); <br/> // after the process definition is created, determine the node where the main path card starts. <br/> assertsame (processdefinition. getstartstate (), Token. getnode (); <br/> // Let's start the process execution and exit the Start Node through its default process conversion <br/> token. signal (); <br/> // The signal method will be blocked until the process execution enters a waiting state <br/> // The main path for execution is now located in the state 's' <br/> assert Same (processdefinition. getnode ("S"), Token. getnode (); <br/> // Let's send a signal. Assume that the execution of the exit state is switched by default. <br/> token. signal (); <br/> // The current information method is returned because the process instance has reached the end node (end-state) <br/> assertsame (processdefinition. getnode ("end"), Token. getnode (); <br/>}< br/>} 

Run the Hello world command using JUnit.

 

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.