Basic steps for designing a BPMN 2.0 workflow definition in eclipse

Source: Internet
Author: User

Original address: http://www.myexception.cn/eclipse/1863140.html

Basic steps for designing a BPMN 2.0 workflow definition in eclipse

1. Activiti asked us to provide Activiti BPMN 2.0, a tool that is based on the tools developed by Eclipse and is easy to install. Before installing Activiti, we will first install the Maven Eclipse plugin.

Click Help, Install New software, and enter the following site information:

Name: m2e
Location: http://download.eclipse.org/technology/m2e/releases

Select Maven to install.

2. Next install Activiti, click Help, install New software, enter the following site information:

Name: Activiti BPMN 2.0 Designer
Location: http://activiti.org/designer/update/

Click Next,finish to install.

3. Once the installation is complete, we can set up the Activiti project. Click New-> Project ...-Activiti-Activiti Project

Enter a name for the project, click Finish, and Eclipse will open Activiti View and generate the following items:

4. Now we start creating workflows. Right click on the project root and choose New---others, select Activiti--Activiti Diagram

Next enter the project name, here we enter Hellowworld.activiti (see HelloWorld is not feeling very cordial AH:))

Click Finish, and finally eclipse will generate a new Helloworld.activit file and use Activiti Designer to open the newly generated file. As shown in the following:

We can see that the largest area on the upper left side is the design area, which is used to place our workflow elements, the upper right side is the tool area, and Activiti provides a lot of out of box workflow elements that allow us to build a workflow. The lower area is the configuration area, and when you click on an element in the workflow, the corresponding properties panel displays the configurable properties of that element.

5. Finally, let's build a very simple workflow, with only a start event, a user task, and an end event. I'm not going to introduce too much BPMN 2.0 here, just to give you a basic step.

As shown, drag the red box on the right to represent the 1, 2, 3, consisting of the following workflow

Select the "select" element at the top right, then click the user task element, and the properties panel appears below. On the Properties panel, click Main Config on the left, then performer type select "Assignee" and expression enter "Kermit". To explain the meaning of this step, here we configure the performer of the task is a user, the user's name is "Kermit". We will use this user to log in to our test environment later.

Click Save, we can see Activiti will automatically generate the Activit file corresponding to the HelloWorld.bpmn20.xml file, the file content is as follows:

<?XML version= "1.0" encoding= "UTF-8"?><Definitionsxmlns= "Http://www.omg.org/spec/BPMN/20100524/MODEL"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"Xmlns:activiti= "HTTP://ACTIVITI.ORG/BPMN"Xmlns:bpmndi= "Http://www.omg.org/spec/BPMN/20100524/DI"XMLNS:OMGDC= "Http://www.omg.org/spec/DD/20100524/DC"Xmlns:omgdi= "Http://www.omg.org/spec/DD/20100524/DI"Typelanguage= "Http://www.w3.org/2001/XMLSchema"Expressionlanguage= "Http://www.w3.org/1999/XPath"targetnamespace= "Http://www.activiti.org/test">  <ProcessID= "HelloWorld"name= "HelloWorld">    <Documentation>Place documentation for the ' HelloWorld ' process here.</Documentation>    <starteventID= "Startevent1"name= "Start"></startevent>    <UsertaskID= "Usertask1"name= "User Task"Activiti:assignee= "Kermit"></Usertask>    <endeventID= "Endevent1"name= "End"></endevent>    <SequenceflowID= "Flow1"name=""Sourceref= "Startevent1"Targetref= "Usertask1"></Sequenceflow>    <SequenceflowID= "Flow2"name=""Sourceref= "Usertask1"Targetref= "Endevent1"></Sequenceflow>  </Process>  <Bpmndi:bpmndiagramID= "Bpmndiagram_helloworld">    <Bpmndi:bpmnplanebpmnelement= "HelloWorld"ID= "Bpmnplane_helloworld">      <Bpmndi:bpmnshapebpmnelement= "Startevent1"ID= "Bpmnshape_startevent1">        <Omgdc:boundsHeight= "+"width= "+"x= "a"y= "$"></Omgdc:bounds>      </Bpmndi:bpmnshape>      <Bpmndi:bpmnshapebpmnelement= "Usertask1"ID= "Bpmnshape_usertask1">        <Omgdc:boundsHeight= " on"width= "The "x= " the"y= " the"></Omgdc:bounds>      </Bpmndi:bpmnshape>      <Bpmndi:bpmnshapebpmnelement= "Endevent1"ID= "Bpmnshape_endevent1">        <Omgdc:boundsHeight= "+"width= "+"x= "The "y= "$"></Omgdc:bounds>      </Bpmndi:bpmnshape>      <Bpmndi:bpmnedgebpmnelement= "Flow1"ID= "Bpmnedge_flow1">        <Omgdi:waypointx= "+"y= "217"></Omgdi:waypoint>        <Omgdi:waypointx= " the"y= "217"></Omgdi:waypoint>      </Bpmndi:bpmnedge>      <Bpmndi:bpmnedgebpmnelement= "Flow2"ID= "Bpmnedge_flow2">        <Omgdi:waypointx= "295"y= "217"></Omgdi:waypoint>        <Omgdi:waypointx= "The "y= "217"></Omgdi:waypoint>      </Bpmndi:bpmnedge>    </Bpmndi:bpmnplane>  </Bpmndi:bpmndiagram></Definitions>

The point to be made here is that because Activiti designer is still developing, there are many drawbacks. For example, if you open the Activiti file and the corresponding Bpmn20.xml file at the same time, after you make changes to the Bpmn20.xml file, eclipse will react very slowly, so close the Activiti file as much as possible. In turn, if you save the Activit file, the designer overwrites the Bpmn20.xml, and its overwrite results may disrupt the bpmn20.xml you have configured in your hand. I personally recommend the basic layout with designer, then save the generated Bpmn20.xml file, and then manually modify the Bpmn20.xml file. Finally, before saving the Bpmn20.xml file, delete the original Activiti file and the PNG file, so that the designer will regenerate the two files according to the Bpmn20.xml file.

6. Build the test environment. Activiti provides us with an out of box test environment. First go to Activiti's official website to download the Activiti-5.9.zip file.

Make sure to install the JRE and ant on your machine and configure the post Java_home and Ant_home.

Unzip the zip file to any directory, here we use Activiti_home representative extract directory. Open the Command Line window, jump to the Activiti_home/setup directory, and enter the Ant Demo.start command, the entire test environment will be set up automatically, all we need to do is drink tea and look at the screen.

Note here that ant executes many commands the first time it runs, including:

* Install H2 Database
* Download and install Tomcat

To add, if you already have a ready-made tomcat, you can manually modify the next build file to avoid repeated downloads and save time. If you are too lazy to modify it, let ant help you get everything done. The steps to modify are as follows:

Create a folder "Downloads" with the Activiti_home sibling directory,

Copy your tomcat compressed file to this folder


To modify the Activiti_home/setup/build.properties file:

tomcat.version=6.0.35

Note that the version number here is consistent with your Tomcat compressed file.

Okay, so what we're going to do next is start the ant task. Open cmd or terminal window, jump to Activiti_home/setup directory, enter

Ant Demo.start

The next step is waiting. Depending on whether or not you have modified the Tomcat download, it will pop up the browser and display the system login page if it is less than 1 minutes away:

Here we use Id:kermit, Passwd:kermit (this account is administrator) to log in. Log in after the screen is as follows:

7. The last step left is to deploy the workflow we just created. Click Manage at the top, and then click Deployments, Upload New

In the pop-up File selection dialog box, select the HelloWorld.bpmn20.xml file we created above, and the deployment results are as follows:

The deployment was successful, very happy. The last thing we need to do is to start this helloworld and see what we have done with our labor. Of course, this lazy workflow doesn't do anything: (. Click on the process at the top, select our HelloWorld workflow on the left, then click on the START process in the top right:

This time we will find the screen automatically switch to the Tasks page, and in the upper left of the Inbox title box more than a "1", meaning that a new task

The only thing you can do here is to assign the task to another user, or click the complete task to finish the task.

Well, the whole process is over here and you can try it.

Basic steps for designing a BPMN 2.0 workflow definition in eclipse

Related Article

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.