1. Create object classes related to document flow and create database tables
2. Based on the analysis of use cases, initially establish interfaces related to document flow
3. Implementation Interface
-Integrate jbpm into the OA system (step 1: Create a database table)
◆ Copy the relevant dependency package to the WEB-INF/lib (bsh. Jar/jcr-1.0.jar/jbpm-identity.jar/jbpm-jpdl.jar)
◆ Modify hibernate. cfg. XML, add the ing configuration of jbpm, and configure cache attributes.
◆ Because the user object in jbpm conflicts with the user object name in the OA system, you need to modify the auto-import attribute mapped to "false" in the OA system ". (See user. HBM. XML)
◆ After modifying the auto-import = "false" of the user ing, you need to use the full path class name when querying the user object (see usermanagerimpl. Java)
◆ Start Tomcat and properly create all database tables of jbpm
-Integrate jbpm into the OA system (step 2: integrate with spring)
◆ Jbpm and spring integration, need to use third-party integration package: spring-modules-0.8.zip
◆ Copy the spring-modules-jbpm31.jar to the WEB-INF/lib.
◆ The jbpm and spring integration methods are as follows: The jbpmconfiguration object is created by spring.
◆ Therefore, jbpm and spring integration require jbpmconfiguration object creation in the spring configuration file.
Configure jbmp Configuration
<bean id="jbpmConfiguration" class="org.springmodules.workflow.jbpm31.LocalJbpmConfigurationFactoryBean"> <property name="configuration" value="classpath:jbpm.cfg.xml"> </property> </bean>
◆ At this time, jbpm is required. cfg. XML. This is the configuration file of jbpm. We can copy default from the directory jbpm_home \ SRC \ jpdl \ org \ jbpm. jbpm. cfg. and rename it jbpm. cfg. XML
-Integrate jbpm into the OA system (Step 3: How to Implement the business logic class, see workflowmanagerimpl. Java)
◆ Injection is required when the jbpmconfiguration object is used
◆ When jbpmcontext object is used to manipulate jbpm, we need to set the hibernatesession object of jbpmcontext to the current hibernatesession object.
private JbpmContext getContext(){ JbpmContext context = jbpmConfiguration.createJbpmContext(); context.setSession(getSession()); return context; }