您的位置:首页 > 业界新闻

构建富互联网应用程序监控工作流和流程(3)

2006-09-09 23:10 501 查看
接口使 用户能够...
IDeliveryService从 BPEL 流程域上部署的流程中调用实例
IBPELProcessHandle浏览 BPEL 流程域上部署的 BPEL 流程
IInstanceHandle对 活动实例执行操作
ITask 与 流程域中已经实例化的任务交互
IWorklistService搜索 并完成已经从流程域中实例化的任务
  您已经了解了 RIA 和 BPELService 的基本组件,下面将介绍它们如何协同提供丰富的最终用户体验。

  运行新帐户流程

  如前所述,首先向客户显示工作流面板中的输入屏幕以输入 SSN。当用户单击 Submit 时,将使用 ActionScript 创建一个“新帐户应用程序”XML 文档,并通过 Flex 的远程对象体系结构将其传递给 BPELService 服务器端 Java 类。(这使 Flex 能够直接与 BPELService 等 Java 对象进行通信。)Java 组件使用 IDeliveryService 接口的实例初始化 BPEL 流程。随后,如下所示,initiateProcess Java 方法将新创建的业务流程实例的实例引用 ID 返回给 Flex 客户端。随后的操作中使用此引用 ID 将相应的业务流程实例作为目标。

/**
* This function initiates an instance of a BPEL PM process based on the
* process name.The function sets the function id and the reference id for
* future use.
*
* @param xmlRequest
* is the initiating request message for the process
* @param strBusinessProcess
* the business process name
* @return the initiating response message for the process
*/
public String initiateProcess(Document xmlRequest, String strBusinessProcess) {

System.out.println("Initiate" + strBusinessProcess);
/*
* This interface allows users to invoke instances from processes
* deployed on a BPEL process domain.
*/
IDeliveryService deliveryService = getDeliveryService();
/*
* Construct the normalized message and send to Oracle BPEL process
* manager
*/
NormalizedMessage nm = new NormalizedMessage();
nm.addPart(PAYLOAD, xmlRequest.getDocumentElement());

NormalizedMessage responseNm = null;
try {
responseNm = deliveryService.request(strBusinessProcess, PROCESS,
nm);
} catch (Exception e){
e.printStackTrace();
throw new RuntimeException("Could not initialize process.");
}
Map payload = responseNm.getPayload();
Document xmlResponse = getXMLDoc(XMLHelper
.elementToString((Element) payload.get(PAYLOAD)));
/*
* Sets the Instance reference ID for interagating active BPEL
* instances.
*/
setInstanceReferenceId(strBusinessProcess, xmlResponse);

return XMLHelper.elementToString(xmlResponse.getDocumentElement());
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: