KK

          Kim-'s-Blog.Object-Everything.I'm POJO.

          .紀-錄.爲了忘卻的記憶..真的勇士,要敢于直面遇到的問題,敢于正視繁雜的原碼......在實踐中積累!

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            74 Posts :: 1 Stories :: 70 Comments :: 0 Trackbacks
          前段時間對 JBPM 4.0 Spring 2.6 進行了整合
          方法有幾種,經過比較感覺原生集成較好~
          整合后的結構:
          src\resources
          src\resources\jbpm
          src\resources\jbpm\jbpm.cfg.xml
          src\resources\jbpm\jbpm.default.cfg.xml
          src\resources\jbpm\jbpm.tx.hibernate.cfg.xml

          src\resources\jbpm\jbpm.mail.properties
          src\resources\jbpm\jbpm.mail.templates.examples.xml
          src\resources\jbpm\logging.properties
          src\resources\spring\applicationContext-jbpm.xml
          src\resources\spring\applicationContext-hibernate.xml


          重點是5個標色文件
          jbpm.cfg.xml
          <?xml version="1.0" encoding="UTF-8"?>

          <jbpm-configuration>

            
          <import resource="jbpm/jbpm.default.cfg.xml" />
            
          <import resource="jbpm/jbpm.tx.hibernate.cfg.xml" />
            
          <import resource="jbpm.jpdl.cfg.xml" />
            
          <import resource="jbpm.identity.cfg.xml" />

            
          <!-- Job executor is excluded for running the example test cases. -->
            
          <!-- To enable timers and messages in production use, this should be included. -->
            
          <!--
            <import resource="jbpm.jobexecutor.cfg.xml" />
            
          -->

            
          <import resource="jbpm/jbpm.mail.templates.examples.xml" />
            
            
          <process-engine-context>
              
          <command-service>
                
          <retry-interceptor />
                
          <environment-interceptor />
                
          <spring-transaction-interceptor />
              
          </command-service>
            
          </process-engine-context>

            
          <transaction-context>
              
          <transaction />
              
          <hibernate-session />
            
          </transaction-context>

          </jbpm-configuration>

          jbpm.default.cfg.xml
          <?xml version="1.0" encoding="UTF-8"?>

          <jbpm-configuration>

            
          <process-engine-context>
            
              
          <repository-service />
              
          <repository-cache />
              
          <execution-service />
              
          <history-service />
              
          <management-service />
              
          <identity-service />
              
          <task-service />
              
          <!--kim
              <hibernate-configuration>
                <cfg resource="jbpm.hibernate.cfg.xml" />     
              </hibernate-configuration>

              <hibernate-session-factory />
              !
          -->
              
          <script-manager default-expression-language="juel"
                              default-script-language
          ="juel">
                
          <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
              
          </script-manager>
              
              
          <authentication />

              
          <id-generator />
              
          <types resource="jbpm.variable.types.xml" />

              
          <address-resolver />

              
          <business-calendar>
                
          <monday    hours="9:00-12:00 and 12:30-17:00"/>
                
          <tuesday   hours="9:00-12:00 and 12:30-17:00"/>
                
          <wednesday hours="9:00-12:00 and 12:30-17:00"/>
                
          <thursday  hours="9:00-12:00 and 12:30-17:00"/>
                
          <friday    hours="9:00-12:00 and 12:30-17:00"/>
                
          <holiday period="01/07/2008 - 31/08/2008"/>
              
          </business-calendar>
              
              
          <mail-template name='task-notification'>
                
          <to users="${task.assignee}"/>
                
          <subject>${task.name}</subject>
                
          <text><![CDATA[Hi ${task.assignee},
          Task "${task.name}" has been assigned to you.
          ${task.description}

          Sent by JBoss jBPM
          ]]></text>
              
          </mail-template>
            
              
          <mail-template name='task-reminder'>
                
          <to users="${task.assignee}"/>
                
          <subject>${task.name}</subject>
                
          <text><![CDATA[Hey ${task.assignee},
          Do not forget about task "${task.name}".
          ${task.description}

          Sent by JBoss jBPM
          ]]></text>
              
          </mail-template>
            
            
          </process-engine-context>

            
          <transaction-context>
              
          <repository-session />
              
          <db-session />
              
              
          <message-session />
              
          <timer-session />
              
          <history-session />
              
          <mail-session>
                
          <mail-server>
                  
          <session-properties resource="jbpm.mail.properties" />
                
          </mail-server>
              
          </mail-session>
            
          </transaction-context>

          </jbpm-configuration>

          jbpm.tx.hibernate.cfg.xml
          <?xml version="1.0" encoding="UTF-8"?>

          <jbpm-configuration>

            
          <process-engine-context>
              
          <command-service>
                
          <retry-interceptor />
                
          <environment-interceptor />
                
          <!-- <standard-transaction-interceptor /> -->
                
          <spring-transaction-interceptor current="true" /> 
              
          </command-service>
            
          </process-engine-context>
            
          <!--kim  
            <transaction-context>
              <transaction />
              <hibernate-session />
            </transaction-context>
            
          -->
            
          <transaction-context>
              
          <hibernate-session current="true"/>
            
          </transaction-context>
            

          </jbpm-configuration>

          applicationContext-jbpm.xml
          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
          <beans>

              
          <bean id="jbpmConfiguration" class="org.jbpm.pvm.internal.cfg.SpringConfiguration">
                     
          <constructor-arg value="jbpm/jbpm.cfg.xml" />
              
          </bean>
              
          <bean id="processEngine" factory-bean="jbpmConfiguration" factory-method="buildProcessEngine" />
              
          <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
              
          <bean id="executionService" factory-bean="processEngine" factory-method="getExecutionService" />
              
          <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
              
          <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
              
          <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
              
          <bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" />

          </beans>

          applicationContext-hibernate.xml (片段)

          <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" parent="AbstractSessionFactory">
                  
          <property name="annotatedClasses">
                      
          <list>
                          
          <value>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</value>
          </list>
                  
          </property>
                  
          <property name="mappingResources">
                      
          <list>
                          
          <value>jbpm.repository.hbm.xml</value>
                          
          <value>jbpm.execution.hbm.xml</value>
                          
          <value>jbpm.history.hbm.xml</value>
                          
          <value>jbpm.task.hbm.xml</value>
                          
          <value>jbpm.identity.hbm.xml</value>
                      
          </list>
                  
          </property>
                  
              
          </bean>

          另外該有的Jar包都要有哦~
          posted on 2009-08-21 15:19 Kim' 閱讀(1917) 評論(1)  編輯  收藏

          Feedback

          # re: JBPM 4.0 使用問題 -- 3:也談 JBPM 4 整合Spring.. 2009-08-21 17:40 99讀書人
          不錯啊!  回復  更多評論
            


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          jj
          主站蜘蛛池模板: 灌阳县| 哈密市| 璧山县| 札达县| 尉犁县| 上蔡县| 康保县| 丰县| 延津县| 淮安市| 喀喇沁旗| 肃宁县| 纳雍县| 闻喜县| 甘泉县| 乡宁县| 甘肃省| 朝阳县| 丹棱县| 于都县| 古交市| 灌南县| 蓝山县| 凉山| 西盟| 余干县| 孝昌县| 云梦县| 贺州市| 历史| 英超| 德庆县| 宁德市| 平和县| 上杭县| 兴隆县| 蒙山县| 西峡县| 锡林浩特市| 宁强县| 固镇县|