Author: jbarrez
Date: 2009-12-11 09:58:09 -0500 (Fri, 11 Dec 2009)
New Revision: 5954
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch16-SpringIntegration.xml
Log:
Changed Spring documentation to reflect current capabilities
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch16-SpringIntegration.xml
===================================================================
---
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch16-SpringIntegration.xml 2009-12-11
14:03:18 UTC (rev 5953)
+++
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch16-SpringIntegration.xml 2009-12-11
14:58:09 UTC (rev 5954)
@@ -34,13 +34,23 @@
<section id="spring_configuration">
<title>Configuration</title>
+ <para>
+ The easiest way to integrate Spring with jBPM is to import the <emphasis
role="bold">jbpm.tx.spring.cfg.xml</emphasis>
+ in your jbpm.cfg.xml file:
+ <programlisting>
+<import resource="jbpm.tx.spring.cfg.xml" />
+ </programlisting>
+ This configuration use the single transaction manager which is defined in the Spring
configuration.
+ Start from the content of this file if you need to tweak the jBPM-Spring integration
+ configuration.
+ </para>
<para>
- Replace the standard-transaction-interceptor with the
- spring-transaction-interceptor. The hibernate session needs the attribute
current=”true”.
- Also, the <transaction/> must be removed from the
transaction-context if you want the
- transactions to be handled by Spring only.
- This forces jBPM to search for the current session,
- which will be provided by Spring.
+ If you start from an existing configuration, replace the
standard-transaction-interceptor with the
+ spring-transaction-interceptor. The hibernate session needs the attribute
current=”true”,
+ depending if you are using the 'current Session' strategy in Spring.
+ Also, the <transaction/> must be removed from the transaction-context
if you want the
+ transactions to be handled by Spring only.
+ This forces jBPM to search for the current session, which will then be provided by
Spring.
<programlisting>
<process-engine-context>
<command-service>
@@ -57,8 +67,18 @@
</para>
<para>
+ The spring-transaction-interceptor will look by default for a
PlatformTransactionManager
+ implementation by doing a search by type on the defined beans. In the case of multiple
+ transaction managers, it is possible to specifically define the name of the transaction
manager
+ that must be used by the interceptor:
+ <programlisting>
+<spring-transaction-interceptor transaction-manager="<emphasis
role="bold">myTransactionManager</emphasis>" />
+ </programlisting>
+ </para>
+
+ <para>
The Spring integration provides a special context, which is added to
- the set of context where the jBPM engine will look for beans.
+ the set of contexts where the jBPM engine will look for beans.
Using this SpringContext, it is now possible to retrieve beans from the
Spring Application Context. For the Spring context to be known, a
SpringConfiguration must be created. This class extends the JbpmConfiguration
@@ -72,9 +92,15 @@
</para>
<para>
+ Using this configuration, a ProcessEngine can be created:
+ <programlisting>
+<bean id="processEngine"
factory-bean="jbpmConfiguration"
factory-method="buildProcessEngine" />
+ </programlisting>
+ </para>
+
+ <para>
The jBPM services can also be defined in the Spring applicationContext, as following:
<programlisting>
-<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" />
</programlisting>
Show replies by date