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

接口 使 用户能够...
 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());
}
 


原文链接: http://blog.csdn.net/newhappy2008/article/details/1200450

转载于:https://my.oschina.net/chen106106/blog/47206

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值