您的位置:首页 > 其它

ActiveBPEL引擎流程部署描述符(pdd)文件概述

2007-12-05 19:13 477 查看
文章仅供大家参考,所有评论, 错误报告, 其他信息以及批评, 请邮寄到
Jeffery.Lee AT gmail.com
或者访问我的个人blog同我交流( http://ibuddie.spaces.live.com/ )。本文遵从GNU 的自由文档许可证(Free Document License)的条款,欢迎转载,如若修改、散布,请注明文章原始出处和来源。

PDD相关内容总结

概述

在ActiveBPEL引擎执行时需要用户定义一个流程部署描述符(Process Deployment Descriptor)文件来与引擎交互,这个文件后缀为pdd。pdd文件告诉ActiveBPEL引擎关于BPEL流程的相关信息。每一个流程文件 (*.bpel)部署之前都需要包含它对应的.pdd文件(一对多的关系)。pdd文件基于XML格式,它的元素包含了partner links 和 WSDL的描述。
关于pdd文件有必要说明以下两点:
首先,pdd文件格式虽然是基于XML的,但它并非标准的文件格式,它是我们采用的ActiveBPEL引擎特有的。因为目前关于BPEL流程部署时相关信息和引擎绑定这方面并没有事实的标准,不同的引擎提供商拥有各自不同的部署文件格式,并提供相应的可视化工具来实现部署文件的生成。
其次,Active-endpoints公司并没有提供任何API供创建pdd文件使用,目前也没有任何第三方提供相应的pdd创建工具。Active-endpoints公司免费提供的ActiveBPEL Designer是目前唯一支持可视化创建pdd的产品。

pdd文件格式

pdd本身是一个XML文件,其Schema定义在以下网址可以查看到:
http://schemas.active-endpoints.com/pdd/2006/08/pdd.xsd
其语法格式总结如下:


<process name="qname"




xmlns=http://schemas.active-endpoints.com/pdd/2005/09/pdd.xsd




xmlns:wsa=http://schemas.xmlsoap.org/ws/2003/03/addressing




xmlns:bpelns=”qname”




location="relativeDeploymentLocation"




persistenceType="full|none"?>




<partnerLinks>




<partnerLink name="ncname">




<partnerRole




endpointReference="static|dynamic|invoker|principal"




<wsa:EndpointReference>




<wsa:Address>url</wsa:Address>




<wsa:ServiceName PortName=”qname”>qname</wsa:ServiceName>




</wsa:EndpointReference>




[... endpoint reference....]




</partnerRole>?




<myRole service="name" allowedRoles="namelist"?




binding="Document Literal|RPC Encoded|RPC Literal|External|Policy Driven"/>?




</partnerLink>+




</partnerLinks>




<references>




<wsdl location="uri" namespace="uri"/>+




</references>?




</process>

l relativeDeploymentLocation属性定义了BPEL文件的路径,与BPEL引擎运行时的类路径相关。通常BPEL文件的路径是指与pdd文件在同一个bpr中的BPEL文件的相对路径。
l persistenceType属性将覆盖引擎自身的持久性设置,可选值为“full|none”。它将影响到所有在此pdd文件基础上由引擎创建的BPEL流程实例。
n full为默认值,表示所有的流程实例(该pdd基础上创建)将按照引擎配置的正常持久性机制运行;
n none表示流程实例不需要持久性支持。所有行为将按照ActiveBPEL引擎默认的in-memory设置进行;
l partnerLink 描述了流程中每个partner扮演的角色,endpointReference属性定义了一个partner的地址是从何处获得的。
n static 在PDD定义
n dynamic 从流程运行时从BPEL流程中映射
n invoker 从partnerde SOAP消息头获得(WS-Addressing)
n principal 从基于认证规则的partner定义文件(.pdef)获得
l EndpointReference元素基于WS-Addressing标准。
n Address子元素用于提供服务的地址;
n ServiceNamePortName分别对应相关服务的WSDL文件中的定义。
l myRole元素中的allowedRoles属性值必须为空,除非你使用应用服务器自带的安全机制。该属性的设置是希望能够利用应用服务器已经存在的Web安全机制。
l references元素列出了BPEL流程参考引用的WSDL文件,它被ActiveBPEL引擎用来创建WSDL在内存中的表示。在每个<wsdl>元素,namespace属性被用来将BPEL中的名空间映射到一个具体的location。location属性可以是一个文件名或者任何URL。首先,location的值将首先供bpr包中META-INF子目录下catalog.xml的定义来查找使用;接下来,引擎将根据location的值获得具体的wsdl的名字(忽略之前的URL或文件相应路径),如果该名字的文件可以在bpr包中的wsdl子目录下找到,那么该WSDL将被引擎读取,否则的话,该location将被视为一个URL,引擎将根据该地址去寻找并读取该WSDL。

pdd文件实例

具体pdd的例子可以参考下面这个例子(BPEL规范中的Loan Approval例子,服务wsdl文件(不含partnerLinkType定义)放置在服务器上通过url方式获得,本地建立wrapper包装wsdl,并在其中实现partnerLinkType定义):


<?xml version="1.0" encoding="UTF-8"?>


<process xmlns="http://schemas.active-endpoints.com/pdd/2006/08/pdd.xsd"
xmlns:bpelns="http://www.jefferylee.com/loan_approval"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing"
location="bpel/Loan_Approval_Remote/loan_approval.bpel"
name="bpelns:loan_approval" persistenceType="none">


<partnerLinks>


<partnerLink name="approver">


<partnerRole endpointReference="static">


<wsa:EndpointReference xmlns:s="http://example.com/loan-approval/wsdl/"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing">


<wsa:Address>http://localhost:8080/active-bpel/services/ApproverWebService</wsa:Address>


<wsa:ServiceName PortName="SOAPPort">s:LoanApprover</wsa:ServiceName>


</wsa:EndpointReference>


</partnerRole>


</partnerLink>


<partnerLink name="assessor">


<partnerRole endpointReference="static">


<wsa:EndpointReference
xmlns:s="http://example.com/loan-approval/wsdl/"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing">


<wsa:Address>http://localhost:8080/active-bpel/services/AssessorWebService</wsa:Address>


<wsa:ServiceName PortName="SOAPPort1">s:LoanAssessor</wsa:ServiceName>


</wsa:EndpointReference>


</partnerRole>


</partnerLink>


<partnerLink name="customer">


<myRole allowedRoles="" binding="RPC" service="LoanService"/>


</partnerLink>


</partnerLinks>


<references>


<wsdl location="http://10.3.5.37/loanServicePT.wsdl"
namespace="http://example.com/loan-approval/wsdl/"/>


<wsdl location="project:/Loan_Approval_Remote/wsdl/wrapper.wsdl"
namespace="http://example.com/loan-approval/wsdl/wrapper"/>


</references>


</process>



参考引用
1 http://forums.active-endpoints.com/showthread.php?t=2426
Quote:
Why does the engine need such a non standard file format?
There is no standard defined for establishing the binding information required for a BPEL process deployment. Every vendors implementation will have it's own unique deployment file format and in many cases different due to the different capabilities that a vendor may choose to provide for their implementation.

Quote:
Is there an API to manage/create the PDD files?
There is no API that creates a pdd as it is dependent on many of the options that you awant to use. There are users that have created their own code to create a pdd which can either be very compex or complicated depending on the options you want to take advantage of.

I am not clear as to what you mean by manage. Can you provide any examples of this?

Quote:
Are there any GPL tools to manage/create PDD files?
Again I am not sure what you mean by manage here. I am not aware of any GPL tools that have been created. Note however the ActiveBPEL Desginer is a free product which provides an unparalleled development, deployment and testing (simulation and remote debugging) environment for all your BPEL needs.

2 http://www.active-endpoints.com/activebpel-pdd-for-version-2x.htm 官方早期关于pdd的格式说明,但基于ActiveBPEL2.0,在3.0以后有很大改动,本文基于ActiveBPEL4.0实现(不知何原因,目前官方从2.0后就不再透露pdd的格式具体细节)。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: