[jbpm-commits] JBoss JBPM SVN: r5954 - jbpm4/trunk/modules/devguide/src/main/docbook/en/modules.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Dec 11 09:58:10 EST 2009


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>
+&lt;import resource=&quot;jbpm.tx.spring.cfg.xml&quot; /&gt;  	
+  	</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 &lt;transaction/&gt; 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 &lt;transaction/&gt; 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>
 	&lt;process-engine-context&gt;
 	    &lt;command-service&gt;
@@ -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>
+&lt;spring-transaction-interceptor transaction-manager=&quot;<emphasis role="bold">myTransactionManager</emphasis>&quot; /&gt;  
+  </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>
+&lt;bean id=&quot;processEngine&quot; factory-bean=&quot;jbpmConfiguration&quot; factory-method=&quot;buildProcessEngine&quot; /&gt;
+    </programlisting>
+	</para>
+	
+	<para>
 		The jBPM services can also be defined in the Spring applicationContext, as following:
 		<programlisting>
-&lt;bean id=&quot;processEngine&quot; factory-bean=&quot;jbpmConfiguration&quot; factory-method=&quot;buildProcessEngine&quot; /&gt;
 &lt;bean id=&quot;repositoryService&quot; factory-bean=&quot;processEngine&quot; factory-method=&quot;getRepositoryService&quot; /&gt;
 &lt;bean id=&quot;executionService&quot; factory-bean=&quot;processEngine&quot; factory-method=&quot;getExecutionService&quot; /&gt;
 		</programlisting>



More information about the jbpm-commits mailing list