BPEL过程组件
http://tech.ddvip.com 2008年01月05日 社区交流
内容摘要:BPEL流程的本质就是通过BPEL的活动(Activity)将BPEL的过程组件“串起来”。所谓“串起来”就是通过BPEL的活动让BPEL的过程组件产生一种动态的交互。比如说将一个变量赋值给另外一个变量,就是一种变量之间的动态的交互。
上面实例中的信封相当于BPEL的一个实例,信封上的学生的姓名和学生证号码相当于一个相关集。
在BPEL中设置相关集比较复杂,下面以房屋贷款的实例来说明在BPEL中设置相关集的过程思路,下面以顾客姓名“name”数据建立相关集。
首先需要建立“相关属性”如下:
<definitions name="properties"
targetNamespace="http://example.com/houseloanCorrelation.wsdl"
xmlns:tns="http://example.com/ houseloanCorrelation.wsdl"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<!-- define correlation properties -->
<bpws:property name="name" type="xsd:string"/>
</definitions>
接下来需要在WSDL中定义“相关属性”。因为同一个属性名,比如“name”,它可能是请求变量的参数,也可能是响应变量的参数,还有路径的关系,因为变量在SOAP消息中是树状的数据结构。所以这里需要用<bpws:propertyAlias>标签从请求消息中得到“name”值。
<?xml version="1.0" encoding="UTF-8"?>
<definitions targetNamespace=" http://example.com/messageCorrelation.wsdl "
xmlns:tns=" http://example.com/messageCorrelation.wsdl "
xmlns:cor="http://example.com/houseloanCorrelation.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
……
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
<types>
<xsd:schema>
<xsd:complexType name="getLoanQuoteRequest">
<xsd:sequence>
<xsd:element name="name" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
……
</xsd:schema>
</types>
<message name="getLoanQuoteRequest">
<part name="payload" type="typens:getLoanQuoteRequest" />
</message>
<message name="getLoanQuoteResponse">
<part name="payload" type="typens:getLoanQuoteResponse" />
</message>
……
<bpws:propertyAlias propertyName="cor:name"
messageType="tns: getLoanQuoteRequest " part=" payload "
query="/ getLoanQuoteRequest /name"/>
……
</definitions>
责编:豆豆技术应用