[jboss-svn-commits] JBossWS SVN: r853 - tags/jbossws-1.0.3.GA/docs/user-guide/project/en/modules/wsbpel
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Aug 29 01:09:26 EDT 2006
Author: alex.guizar at jboss.com
Date: 2006-08-29 01:09:25 -0400 (Tue, 29 Aug 2006)
New Revision: 853
Modified:
tags/jbossws-1.0.3.GA/docs/user-guide/project/en/modules/wsbpel/wsbpel.xml
Log:
JBWS-867
Modified: tags/jbossws-1.0.3.GA/docs/user-guide/project/en/modules/wsbpel/wsbpel.xml
===================================================================
--- tags/jbossws-1.0.3.GA/docs/user-guide/project/en/modules/wsbpel/wsbpel.xml 2006-08-28 17:23:00 UTC (rev 852)
+++ tags/jbossws-1.0.3.GA/docs/user-guide/project/en/modules/wsbpel/wsbpel.xml 2006-08-29 05:09:25 UTC (rev 853)
@@ -32,7 +32,7 @@
</section>
- <section id="wsbpel.define">
+ <section id="wsbpel.definition">
<title>Defining a business process</title>
@@ -53,7 +53,10 @@
</mediaobject>
</figure>
- <para>The WSDL interface our endpoint presents to the world goes like this:</para>
+ <para>The interface our endpoint presents to the world appears in the following WSDL document.
+ Observe no binding or service elements are present. A WS-BPEL process is defined in terms
+ of the interfaces (message and port type elements) of the participants, not their possible
+ deployments.</para>
<programlisting><definitions targetNamespace="http://jbpm.org/examples/hello"
xmlns="http://schemas.xmlsoap.org/wsdl/"
@@ -90,9 +93,9 @@
corresponds to the agent sending the person name (caller).</para></listitem>
<listitem><para>The <variables> section defines the data items held by the process
- between message exchanges. The ability to mantain data effectively makes the backed endpoint
- stateful. The state includes received and sent messages as well as intermediate data used
- in business logic.</para></listitem>
+ between message exchanges. The ability to mantain data effectively makes the service
+ provided by the process stateful. The state includes received and sent messages as well as
+ intermediate data used in business logic.</para></listitem>
<listitem><para>The rest of the document describes the normal activities for handling a
greeting request. BPEL also provides the means to perform activities in response to faults.
@@ -165,42 +168,162 @@
<plt:portType name="tns:helloPT"/>
</plt:role>
</plt:partnerLinkType>
- </programlisting>
+</definitions></programlisting>
+
</section>
- <section id="wsbpel.deploy">
+ <section id="wsbpel.database">
- <title>Deploying a business process</title>
+ <title>Storing the process definition in the jBPM database</title>
+
+ <para>In the domain of business processes, traceability is important. Process engines are
+ expected to maintain not only the current state of each process instance, but also the
+ history of performed activities and updated variables.</para>
+
+ <para>To provide these features, the JBoss BPEL implementation builds on <ulink
+ url="http://www.jboss.com/products/jbpm">JBoss jBPM</ulink>. The Graph Oriented Programming
+ (<ulink url="http://jbpm.org/gop">GOP</ulink>) foundation in jBPM allows for storing past
+ and present graph state in a database.</para>
+
+ <para>Installing the jBPM service in JBoss AS is a prerrequisite. Refer to the jBPM BPEL
+ <ulink url="http://docs.jboss.com/jbpm/bpel/getstarted.html#getstarted.setup">user guide
+ </ulink> for details.</para>
+
+ <note><para>The jBPM service comes with a preconfigured Hypersonic database, useful for
+ development purposes. In production, you can switch to the database of your choice.</para>
+ </note>
+
+ <para>Before the process can be enacted, its definition must be stored in the jBPM database.
+ To do so, package your BPEL process and related WSDL interfaces in an archive. Afterwards,
+ submit the archive to the jBPM service.</para>
+
+ <programlisting><![CDATA[<jar destfile="${build.dir}/${app.name}.par">
+ <fileset dir="${bpel.dir}" />
+ <zipfileset dir="${resources.dir}"
+ prefix="META-INF"
+ includes="bpel-definition.xml" />
+</jar>
+
+<get dest="${build.dir}/deploy-def.html"
+ src="http://localhost:8080/jbpm/deploy?archive=file://${build.dir}/${app.name}.par" />]]></programlisting>
+
+ <para>The file <literal>bpel-definition.xml</literal> tells the location of the BPEL and WSDL
+ documents inside the archive.</para>
+
+ <programlisting><![CDATA[<bpelDefinition location="hello.bpel" xmlns="http://jbpm.org/bpel">
+
+ <!-- makes WSDL interface elements available to the process -->
+ <imports>
+ <wsdl location="hello.wsdl" />
+ </imports>
+
+</bpelDefinition>]]></programlisting>
+
+ <tip><para>The definition descriptor can also reference external documents.</para></tip>
+
+ </section>
- <section id="wsbpel.deploy.definition">
+ <section id="wsbpel.artifacts">
+
+ <title id="wsbpel.artifacts.title">Generating the required artifacts</title>
- <title>Storing the process definition</title>
+ <para>After the process definition is stored in the database, deploying a WS-BPEL process is
+ similar to deploying a JSR-109 endpoint starting with WSDL.</para>
+
+ <para>The definition of a WS-BPEL process only includes the port types of the participants, as
+ mentioned in the previous section. On the other hand, a JSR-109 deployment requires the
+ presence of binding and service elements. JBoss BPEL supplies a tool that generates the SOAP
+ 1.1 binding and service elements required for deploying the web service provided by the
+ process.</para>
- <para>In the domain of business processes, traceability is important. Process engines are
- expected to maintain not only the current state of each process instance, but also the
- history of performed activities and updated variables.</para>
-
- <para>In order to provide these features, the JBoss BPEL implementation builds on the Graph
- Oriented Programming (<ulink
- url="http://docs.jboss.org/jbpm/v3/userguide/graphorientedprogramming.html">GOP</ulink>)
- foundation of <ulink url="http://www.jboss.com/products/jbpm">JBoss jBPM</ulink>. The first
- step towards deploying a process is installing the jBPM MBean in JBoss. Refer to the jBPM
- BPEL <ulink url="http://docs.jboss.com/jbpm/bpel/getstarted.html#getstarted.setup">user
- guide</ulink> for details.</para>
-
- <para>Before the process can be enacted, its definition must be stored in a database. The jBPM
- MBean ships with a preconfigured Hypersonic database. All you need to do is package your
- BPEL process + WSDL definitions and submit the resulting file to the store servlet.</para>
-
- </section>
+ <programlisting><![CDATA[<taskdef name="servicegen" classname="org.jbpm.bpel.ant.ServiceGeneratorTask">
+ <classpath>
+ <pathelement location="${template.dir}/config" />
+ <pathelement location="${jbpm.bpel.home}/build/jbpm-bpel-${jbpm.bpel.version}.jar" />
+ <fileset dir="${jbpm.bpel.home}/lib" includes="**/*.jar" />
+ </classpath>
+</taskdef>
+
+<!-- generate binding and service elements -->
+<servicegen processfile="${build.dir}/${app.name}.par" outputdir="${web.dir}/wsdl" />]]></programlisting>
+
+ <para>The generated WSDL can be passed to <literal>wstools</literal>. Use the following
+ configuration.</para>
+
+ <programlisting><![CDATA[<configuration xmlns="http://www.jboss.org/jbossws-tools">
+ <global>
+ <package-namespace package="org.jbpm.bpel.tutorial.hello"
+ namespace="http://jbpm.org/examples/hello" />
+ </global>
+ <wsdl-java file="src/main/resources/WEB-INF/wsdl/service.wsdl">
+ <mapping file="jaxrpc-mapping.xml" />
+ </wsdl-java>
+</configuration>]]></programlisting>
+
+ <note>
- <section id="wsbpel.deploy.webapp">
+ <para>JBoss BPEL is agnostic to the Java mapping artifacts that <literal>wstools</literal>
+ produces. Keep in mind that variables in a BPEL process are defined in terms of XML types
+ and WSDL messages. JBoss BPEL extracts XML content from SOAP messages and puts it in process
+ variables. No need to perform expensive Java binding.</para>
+
+ <para>Nevertheless, the Java mapping artifacts still must be present for the JSR-109
+ deployment to be valid.</para>
+
+ </note>
- <title>Deploying the web application</title>
+ </section>
+
+ <section id="wsbpel.config">
+
+ <title>Configuring the port component</title>
- </section>
+ <para>Similar to the Addressing and Security components, JBoss BPEL uses <link
+ linkend="handlers">JAX-RPC handlers</link> to extract XML content from SOAP messages.</para>
+ <programlisting><![CDATA[<handler>
+
+ <handler-name>callerHandler</handler-name>
+ <handler-class>org.jbpm.bpel.integration.server.SoapHandler</handler-class>
+
+ <init-param>
+ <description>partner link associated to the enclosing port</description>
+ <param-name>partnerLinkHandle</param-name>
+ <param-value>caller</param-value>
+ </init-param>
+
+</handler>]]></programlisting>
+
+ <para>A separate descriptor, <literal>bpel-application.xml</literal>, specifies the name of
+ the process definition previously stored in the jBPM database.</para>
+
+ <programlisting><bpelApplication name="helloWorld" xmlns="http://jbpm.org/bpel" /></programlisting>
+
</section>
+
+ <section id="wsbpel.client">
+
+ <title>Consuming the published web service</title>
+
+ <para>No special configuration is needed on the client side. You consume a service provided by
+ a WS-BPEL process the same way you consume any other service.</para>
+
+ <para>You can reuse the Java mapping artifacts produced in <link linkend="wsbpel.artifacts"
+ endterm="wsbpel.artifacts.title" /> to develop a <link linkend="jsr109-clients">JSR-109 client
+ </link>.</para>
+
+ <programlisting><![CDATA[InitialContext ctx = getInitialContext();
+// lookup service interface in environment context
+service = (HelloWorldService) ctx.lookup("java:comp/env/service/Hello");
+// obtain dynamic proxy for web service port
+HelloPT proxy = service.getCallerPort();
+// use proxy as local java object
+String greeting = proxy.sayHello("Popeye");
+// check popeye is greeted properly
+assertEquals("Hello, Popeye!", greeting);]]></programlisting>
+
+ </section>
+
</chapter>
\ No newline at end of file
More information about the jboss-svn-commits
mailing list