Tutorial: JBPM4.4 learning path (1): Introduction to setting up a damn Hello World Environment
I can't remember how many types of Hello World I have written, or even I can't remember how many things I have stayed at the level of Hello World, so I am deeply blaming myself for this.
Workflow: automation of part of a business process or the entire computer environment.
Concept. Briefly describe this profound problem. How do you ask for leave from your teacher? In the most primitive way, you ran to the teacher and said, "Teacher, I have a stomachache and want to go to the hospital ". The teacher said, "OK ". Formally, fill out a leave application form and hand it over to the teacher. The teacher gives instructions on the form. All of them are in the paperless office era. What should I do with my computer? Fill in the application form on the webpage, and click apply. The instructor will approve the application after seeing the application on another computer. Asking for leave is a business process. automation saves you the trouble of handing in to your teacher.
Development Environment Construction
Install the JBPM plug-in. As we all know, the installation files for offline plug-ins are:
- Install \ src \ gpd \ jbpm-gpd-site.zip
Of course, you 'd better add Schema validation. The process is not easy to say, the file is in.
- Src> jpdl-4.0.xsd
Project Configuration
Add the core reporting jbpm. jar and add all the packages under the lib directory, except for these.
Then add the junit 4 test package.
Copy the configuration file in the example/src directory.
Modify jbpm. hibernate. cfg. xml
- <Hibernate-configuration>
- <Session-factory>
-
- <Property name = "dialect"> org. hibernate. dialect. MySQLDialect </property>
- <Property name = "connection. url"> jdbc: mysql: // localhost: 3306/jbpm </property>
- <Property name = "connection. username"> root </property>
- <Property name = "connection. password"> gaopeng </property>
- <Property name = "connection. driver_class"> com. mysql. jdbc. Driver </property>
- <Property name = "myeclipse. connection. profile"> mysql </property>
- <Property name = "show_ SQL"> true </property>
- <Property name = "hbm2ddl. auto"> update </property>
-
- <Mapping resource = "jbpm. repository. hbm. xml"/>
- <Mapping resource = "jbpm.exe cution. hbm. xml"/>
- <Mapping resource = "jbpm. history. hbm. xml"/>
- <Mapping resource = "jbpm. task. hbm. xml"/>
- <Mapping resource = "jbpm. identity. hbm. xml"/>
-
- </Session-factory>
- </Hibernate-configuration>
Do not forget to create a database jbpm. UTF-8 encoding format.
Automatic database creation
- Public class CreateDB {
-
- @ Test
- Public void test (){
- // Obtain the configuration object
- Configuration configuration = new Configuration ();
- // Non-standard configuration, which must be specified
- Configuration. configure ("jbpm. hibernate. cfg. xml ");
- Configuration. buildSessionFactory ();
- }
- }
Test Run: the database is as follows.
In the eyes of many programmers, the program operates the database, so almost every step of the operation needs to correspond to the database.