Author: rebody
Date: 2010-07-08 07:33:58 -0400 (Thu, 08 Jul 2010)
New Revision: 6473
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch17-SpringIntegration.xml
Log:
JBPM-2910 escape text in spring integration section of devguide
Modified:
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch17-SpringIntegration.xml
===================================================================
---
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch17-SpringIntegration.xml 2010-07-08
05:28:43 UTC (rev 6472)
+++
jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch17-SpringIntegration.xml 2010-07-08
11:33:58 UTC (rev 6473)
@@ -1,147 +1,147 @@
<?xml version="1.0" encoding="UTF-8"?>
<chapter id="springIntegration">
<title>Spring Integration</title>
-
+
<para>
- The embeddability of the jBPM engine in different environments has always
- been one of its core strengths, but often extra libraries to do the integration
- were required. Since jBPM4 however, it is now possible to natively
- integrate jBPM with <ulink
url="http://www.springsource.org/about">Spring</ulink>.
- This section will explain which steps are required for such an integration.
+ The embeddability of the jBPM engine in different environments has always
+ been one of its core strengths, but often extra libraries to do the integration
+ were required. Since jBPM4 however, it is now possible to natively
+ integrate jBPM with <ulink
url="http://www.springsource.org/about">Spring</ulink>.
+ This section will explain which steps are required for such an integration.
</para>
-
+
<para>
- The Spring integration has started out as a community effort by
- <ulink url="http://www.inze.be/andries/">Andries
Inzé</ulink>.
- Do note that Spring integration currently is in 'incubation', before
- it is moved to the user guide.
+ The Spring integration has started out as a community effort by
+ <ulink url="http://www.inze.be/andries/">Andries
Inzé</ulink>.
+ Do note that Spring integration currently is in 'incubation', before
+ it is moved to the user guide.
</para>
<section id="spring_overview">
<title>Overview</title>
<para>
- The default jBPM behaviour is to open a transaction for each operation
- that is called on the service API. In a typical Spring setup, applications are
- accessed from the web tier and enter a transactional boundary by invoking
- operations on service beans. These service beans will then access the jBPM services.
- All these operations run typically in a single transaction (ie one transaction
- per request from the browser), which invalidates the standard jBPM
- transaction handling approach. Instead of starting and committing
- a transaction for every service operation, the existing transaction
- should be used (or a new one started if none exists).
+ The default jBPM behaviour is to open a transaction for each operation
+ that is called on the service API. In a typical Spring setup, applications are
+ accessed from the web tier and enter a transactional boundary by invoking
+ operations on service beans. These service beans will then access the jBPM
services.
+ All these operations run typically in a single transaction (ie one transaction
+ per request from the browser), which invalidates the standard jBPM
+ transaction handling approach. Instead of starting and committing
+ a transaction for every service operation, the existing transaction
+ should be used (or a new one started if none exists).
</para>
</section>
-
+
<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 uses 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>
+ <title>Configuration</title>
<para>
- 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
+ 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 uses 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>
+ 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>
- <emphasis role="bold"><spring-transaction-interceptor
/></emphasis>
- ...
- </command-service>
- ...
- </process-engine-context>
- <transaction-context>
- ...
- <emphasis role="bold"><hibernate-session
current="true"/></emphasis>
- </transaction-context>
- </programlisting>
- </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
+ This forces jBPM to search for the current session, which will then be provided
by Spring.
+ <programlisting>
+ <process-engine-context>
+ <command-service>
+ <emphasis role="bold"><spring-transaction-interceptor
/></emphasis>
+ ...
+ </command-service>
+ ...
+ </process-engine-context>
+ <transaction-context>
+ ...
+ <emphasis role="bold"><hibernate-session
current="true"/></emphasis>
+ </transaction-context>
+ </programlisting>
+ </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>" />
+<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 contexts where the jBPM engine will look for beans.
- Using this SpringContext, it is now possible to retrieve beans from the
- Spring Application Context. The jBPM process engine can be configured in a Spring
- applicationContext.xml as follows:
- <programlisting>
- <bean id="springHelper"
class="org.jbpm.pvm.internal.processengine.SpringHelper">
- <property name="jbpmCfg"
value="org/jbpm/spring/jbpm.cfg.xml"></property>
- </bean>
+ </para>
- <bean id="processEngine" factory-bean="springHelper"
factory-method="createProcessEngine" />
+ <para>
+ The Spring integration provides a special context, which is added to
+ 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. The jBPM process engine can be configured in a
Spring
+ applicationContext.xml as follows:
+ <programlisting>
+<bean id="springHelper"
class="org.jbpm.pvm.internal.processengine.SpringHelper">
+ <property name="jbpmCfg"
value="org/jbpm/spring/jbpm.cfg.xml"></property>
+</bean>
+
+ <bean id="processEngine" factory-bean="springHelper"
factory-method="createProcessEngine" />
</programlisting>
Note that the <emphasis role="bold">jbpmCfg</emphasis> property
for the SpringHelper is optional.
If a default jbpm.cfg.xml exists on the classpath (ie not in some package), this line
can
be removed.
- </para>
-
- <para>
- The jBPM services can also be defined in the Spring applicationContext, as following:
- <programlisting>
+ </para>
+
+ <para>
+ The jBPM services can also be defined in the Spring applicationContext, as
following:
+ <programlisting>
<bean id="repositoryService"
factory-bean="processEngine"
factory-method="getRepositoryService" />
<bean id="executionService"
factory-bean="processEngine"
factory-method="getExecutionService" />
- </programlisting>
- </para>
+ </programlisting>
+ </para>
</section>
-
+
<section id="spring_usage">
- <title>Usage</title>
-
- <para>
- The previous section already showed how the jBPM services can be made
- accessible for other Spring services. The other use case is calling
- Spring beans from within a process. This can be done by using
- an expression which resolves to the name of a Spring bean.
-
- <programlisting>
+ <title>Usage</title>
+
+ <para>
+ The previous section already showed how the jBPM services can be made
+ accessible for other Spring services. The other use case is calling
+ Spring beans from within a process. This can be done by using
+ an expression which resolves to the name of a Spring bean.
+
+ <programlisting>
<java name="echo" expr="#{echoService}"
method="sayHello" >
- <transition name="to accept"
to="join1"/>
- </java>
- </programlisting>
-
- The scripting engine will look into all contexts from the bean named echoService.
- If you configured the ScriptManager as above, Spring will be the last context to
search for.
- You can also add a Spring bean to the Spring Application context
- (eg IdentitySessionImpl with id <emphasis
role="italic">identitySession</emphasis>)
- and use it in the jBPM config (eg by adding <env
class="identitySession" />)
- </para>
-
+ <transition name="to accept"
to="join1"/>
+</java>
+ </programlisting>
+
+ The scripting engine will look into all contexts from the bean named
echoService.
+ If you configured the ScriptManager as above, Spring will be the last context to
search for.
+ You can also add a Spring bean to the Spring Application context
+ (eg IdentitySessionImpl with id <emphasis
role="italic">identitySession</emphasis>)
+ and use it in the jBPM config (eg by adding <env
class="identitySession" />)
+ </para>
+
</section>
-
+
<section id="spring_testing">
- <title>Testing</title>
-
- <para>
- Use the <emphasis
role="bold">AbstractTransactionalJbpmTestCase</emphasis>
- to test a process in isolation (ie without impact on the database).
- This class extends from
- the <emphasis
role="italic">AbstractTransactionalDataSourceSpringContextTests</emphasis>
- class, which means that testing a process comes down to exactly the same
- approach as testing a DAO.
- </para>
-
+ <title>Testing</title>
+
+ <para>
+ Use the <emphasis
role="bold">AbstractTransactionalJbpmTestCase</emphasis>
+ to test a process in isolation (ie without impact on the database).
+ This class extends from
+ the <emphasis
role="italic">AbstractTransactionalDataSourceSpringContextTests</emphasis>
+ class, which means that testing a process comes down to exactly the same
+ approach as testing a DAO.
+ </para>
+
</section>
-
-
-
+
+
+
</chapter>