[
https://issues.jboss.org/browse/JBRULES-2604?page=com.atlassian.jira.plug...
]
Mark Proctor commented on JBRULES-2604:
---------------------------------------
Can you check against our most recent spring stuff, do we have something that does this
for you now? If so please close this jira, or come back with additional requests against
what we have now.
New simple JPAKnowledgeServiceBean that can be used to create /
reload Stateful Knowledge Sessions
--------------------------------------------------------------------------------------------------
Key: JBRULES-2604
URL:
https://issues.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
Labels: drools_spring, spring
Attachments: JPAKnowledgeServiceBean.java
Original Estimate: 1 hour
Remaining Estimate: 1 hour
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.
For more information on JIRA, see:
http://www.atlassian.com/software/jira