|
Re: Please help! Simple BPEL Process. [message #889986 is a reply to message #888676] |
Wed, 20 June 2012 13:41 |
|
Are you asking us to do your homework for you?
Start by creating a synchronous process (using the New BPEL Process wizard), then add an Assign immediately after the Receive. The Assign can be used to assign an XPath expression to the result variable. The calculation can be done in the expression.
HTH,
Bob
|
|
|
|
Re: Please help! Simple BPEL Process. [message #893351 is a reply to message #892983] |
Tue, 03 July 2012 16:15 |
|
Hi Hussein,
I'm wondering how this process file was generated because there are several problems with it, both syntactically and semantically:
* the <process> element should include either a "http://docs.oasis-open.org/wsbpel/2.0/process/executable" or "http://docs.oasis-open.org/wsbpel/2.0/process/abstract" namespace declaration
* the <variables> element does not have closing </variables> tag
* the <from> element should not have an "expression" attribute - the expression should just be written as CDATA enclosed in the <from> and </from> tags
* it is highly unusual to have two <receive> elements in a row, and the first one must have its "createInstance" attribute set to "yes"
* none of the XSD types or partner link types are defined and the process does not include an <import> which is typically where these types would be defined
Are you trying to import a BPEL process generated by a tool used for some non-standard runtime?
HTH,
Bob
|
|
|
Re: Please help! Simple BPEL Process. [message #893352 is a reply to message #893351] |
Tue, 03 July 2012 16:16 |
|
Here's the solution that I generated using the BPEL editor:
First, the "Division" bpel process file:
<!-- Division BPEL Process [Generated by the Eclipse BPEL Designer] -->
<!-- Date: Tue Jul 03 10:23:05 MDT 2012 -->
<bpel:process name="Division"
targetNamespace="http://eclipse.org/bpel/sample"
suppressJoinFailure="yes"
xmlns:tns="http://eclipse.org/bpel/sample"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
>
<!-- Import the client WSDL -->
<bpel:import location="DivisionArtifacts.wsdl" namespace="http://eclipse.org/bpel/sample"
importType="http://schemas.xmlsoap.org/wsdl/" />
<!-- ================================================================= -->
<!-- PARTNERLINKS -->
<!-- List of services participating in this BPEL process -->
<!-- ================================================================= -->
<bpel:partnerLinks>
<!-- The 'client' role represents the requester of this service. -->
<bpel:partnerLink name="client"
partnerLinkType="tns:Division"
myRole="DivisionProvider"
/>
</bpel:partnerLinks>
<!-- ================================================================= -->
<!-- VARIABLES -->
<!-- List of messages and XML documents used within this BPEL process -->
<!-- ================================================================= -->
<bpel:variables>
<!-- Reference to the message passed as input during initiation -->
<bpel:variable name="input"
messageType="tns:DivisionRequestMessage"/>
<!--
Reference to the message that will be returned to the requester
-->
<bpel:variable name="output"
messageType="tns:DivisionResponseMessage"/>
</bpel:variables>
<!-- ================================================================= -->
<!-- ORCHESTRATION LOGIC -->
<!-- Set of activities coordinating the flow of messages across the -->
<!-- services integrated within this business process -->
<!-- ================================================================= -->
<bpel:sequence name="main">
<!-- Receive input from requester.
Note: This maps to operation defined in Division.wsdl
-->
<bpel:receive name="receiveInput" partnerLink="client"
portType="tns:Division"
operation="process" variable="input"
createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<bpel:assign validate="no" name="Divide">
<bpel:copy>
<bpel:from><bpel:literal><tns:DivisionResponse xmlns:tns="http://eclipse.org/bpel/sample" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tns:result>tns:result</tns:result>
</tns:DivisionResponse>
</bpel:literal></bpel:from>
<bpel:to variable="output" part="payload"></bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<![CDATA[$input.payload/tns:x div $input.payload/tns:y]]>
</bpel:from>
<bpel:to part="payload" variable="output">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[tns:result]]>
</bpel:query>
</bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:reply name="replyOutput"
partnerLink="client"
portType="tns:Division"
operation="process"
variable="output"
/>
</bpel:sequence>
</bpel:process>
And next the generated "DivisionArtifacts" WSDL file:
<?xml version="1.0"?>
<definitions name="Division"
targetNamespace="http://eclipse.org/bpel/sample"
xmlns:tns="http://eclipse.org/bpel/sample"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of types participating in this BPEL process
The BPEL Designer will generate default request and response types
but you can define or import any XML Schema type and use them as part
of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<types>
<schema attributeFormDefault="unqualified" elementFormDefault="qualified"
targetNamespace="http://eclipse.org/bpel/sample"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="DivisionRequest">
<complexType>
<sequence>
<element name="x" type="string" />
<element name="y" type="string"></element>
</sequence>
</complexType>
</element>
<element name="DivisionResponse">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<message name="DivisionRequestMessage">
<part name="payload" element="tns:DivisionRequest"/>
</message>
<message name="DivisionResponseMessage">
<part name="payload" element="tns:DivisionResponse"/>
</message>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- portType implemented by the Division BPEL process -->
<portType name="Division">
<operation name="process">
<input message="tns:DivisionRequestMessage" />
<output message="tns:DivisionResponseMessage"/>
</operation>
</portType>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<plnk:partnerLinkType name="Division">
<plnk:role name="DivisionProvider" portType="tns:Division"/>
</plnk:partnerLinkType>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BINDING DEFINITION - Defines the message format and protocol details
for a web service.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<binding name="DivisionBinding" type="tns:Division">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="process">
<soap:operation
soapAction="http://eclipse.org/bpel/sample/process" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SERVICE DEFINITION - A service groups a set of ports into
a service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<service name="DivisionService">
<port name="DivisionPort" binding="tns:DivisionBinding">
<soap:address location="http://localhost:8080/Division" />
</port>
</service>
</definitions>
[Updated on: Tue, 03 July 2012 16:29] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03954 seconds