[jboss-jira] [JBoss JIRA] Created: (JBRULES-2604) New simple JPAKnowledgeServiceBean that can be used to create / reload Stateful Knowledge Sessions

Anatoly Polinsky (JIRA) jira-events at lists.jboss.org
Wed Jul 28 15:23:33 EDT 2010


New simple JPAKnowledgeServiceBean that can be used to create / reload Stateful Knowledge Sessions
--------------------------------------------------------------------------------------------------

                 Key: JBRULES-2604
                 URL: https://jira.jboss.org/browse/JBRULES-2604
             Project: Drools
          Issue Type: Patch
      Security Level: Public (Everyone can see)
          Components: All
    Affects Versions: 5.1.0.FINAL
         Environment: N/A
            Reporter: Anatoly Polinsky
            Assignee: Mark Proctor
         Attachments: JPAKnowledgeServiceBean.java

Spring bean that serves as a facade into Drools Session creation and reloading using persistent (JPA) knowledge state.

Public client APIs are newStatefulKnowledgeSession( ) and loadStatefulKnowledgeSession( sessionID ) which do just that:

newStatefulKnowledgeSession():            Creates a new StatefulKnowledgeSession
loadStatefulKnowledgeSession( sessionID ):        Reloads an existing ( previously persisted StatefulKnowledgeSession ) by the sesssionID 

Here is an example on how this bean can be configured: 


 	<bean id="abstractKnowledgeProvider"
               class="org.drools.container.spring.beans.persistence.JPAKnowledgeServiceBean">
               <property name="entityManagerFactory" ref="entityManagerFactory" />
               <property name="transactionManager" ref="txManager" />
               <property name="knowledgeStore" ref="kstore"/>
  
               <property name="kbase">
                   <drools:kbase id="kbase" node="node">
                       <drools:resources>
                           <drools:resource type="DRF"
                                            source="classpath:./META-INF/flow/subprocess-flow.rf" />					             
                           <drools:resource type="DRF"
                                            source="classpath:./META-INF/flow/parallel-subprocess-flow.rf" />
                           <drools:resource type="DRF"
                                            source="classpath:./META-INF/flow/approval-flow.rf" />
                       </drools:resources>
                   </drools:kbase>
               </property>
               <property name="variablePersisters">
                   <util:map>
                       <entry key="javax.persistence.Entity"
                              value="org.drools.persistence.processinstance.persisters.JPAVariablePersister" />
                       <entry key="java.io.Serializable"
                              value="org.drools.persistence.processinstance.persisters.SerializableVariablePersister" />
                       <entry key="java.lang.String"
                              value="org.drools.persistence.processinstance.persisters.StringVariablePersister" />
                   </util:map>
               </property>
	</bean>


Besides "variablePersisters" all properties are mandatory ( cannot be NULL / not set ). 



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list