Username: Password:

Oracle SOA Suite 预览尝鲜(连载五)SOADEMO系统
来源:CSDN作者:月白 发布时间:2007-12-13 00:00:00

SOADEMO系统 从OTN能够下载到一个soademo_101310_preview.zip,这是SOADEMO的源码包,能够在JDeveloper中打开。 下载地址http://www.oracle.com/technology/software/products/ias/soapreview.html   注意,这个包可能有点问题:假如这个包的根目录下有一个叫decisionservices的文档夹,请把他删除掉,因为他可能会造成编译无法通过,错误原因是duplicate class。
简介
这里我们虚构了一个叫做Global Company的公司,他的主要业务就是在网上卖电子产品,比如MP3等。从功能的角度来说,SOA Order Booking系统实现了“从客户登陆web client端填写订单,到后面的可能的人工批示,再到选择supplier(供货商),最后到选择自动选择发货方式和通知客户”。从技术的角度来说,他充分的展示了怎样将现有的企业内部应用程式和企业外部应用程式组装在一起构成一整套流程。 下面这副图就是SOA Order Booking系统的一个overview,从中您能够看出他的大致流程。请注意,很多应用程式都“松耦合”的参和其中,他们不只是能够在SOA Order Booking系统中使用,也能够被别的系统使用。  流程详解
1、   客户使用SOADEMO-CLIENT浏览货物并填写订单(order),订单发出后会自动调用OrderBookingESB服务
2、   OrderBookingESB服务接到请求后调用SOAOrderBooking BPEL应用,该应用定义了SOA Order Booking系统的主要流程。
3、   SOAOrderBooking把订单插入到数据库中
4、   SOAOrderBooking调用CustomerService服务从数据库中提取客户信息
5、   SOAOrderBooking调用CreditService服务来检查客户的信用卡(credit card)是否合法。假如不合法,自动取消这个订单;否则,将订单和客户的具体情况一起发给RULES引擎(决策服务)
6、   SOAOrderBooking通过RULES引擎(决策服务)定义的规则来决定是否需要人工审批:
a) 假如用户的status是白金(platinum),无需人工审批
b) 假如用户的staus是金(gold),当订单的总额超过1000美元时需要人工审批
c) 假如用户的status是银(silver),不管订单大小都需要人工审批
7、   假如订单需要人工审批,SOAOrderBooking调用人工流程(human workflow),并给有关人员发送消息。
8、   假如订单需要人工审批,有关人员登陆到worklist应用程式,批准或拒绝。SOAOrderBooking收到拒绝回复时,取消该订单,否则进行下一步。
9、   SOAOrderBooking同时向SelectManufacturer服务和RapidService服务请求报价,这里:
a) SelectManufacturer是一级代理商,所以报价比较低,但是他响应不是很及时,即他是异步返回报价
b) RapidService不是一级代理商,所以报价比较高,但是他以快取胜,会同步返回报价
10、              SOAOrderBooking收集两个供给商返回的报价,选择给出低报价的那个供给商。
11、              SOAOrderBooking调用ESB服务FulfillmentESB来决定发货(ship)的方式
12、              FulfillmentESB检查订单的大小
a) 假如订单小于500美元,选择USPS,这个系统是从一个目录下取订单的,所以要用File adapter(文档适配器)把订单写到指定的目录下。
b) 假如订单大于等于500美元,选择 Fedex,这个系统等待订单出现在一个指定的数据库表中,所以要使用Db adapter(数据库适配器)把订单写到此表中
c) 任何订单,不论发货商是谁(USPS或Fedex),都保存在一个临时的JIMS queue中(写入过程由JMS adapter实现),并在前一天晚上以批处理的方式upload。
13、              SOAOrderBooking保存订单的状态在数据库
14、              SOAOrderBooking通过BPEL提供的邮件(email)功能发邮件给客户。
 
每个服务用到的技术
上面已说过SOADEMO中有近10project,下面给出每个project使用到的技术。我们在这篇文章中不会谈太多的技术实现细节,而是focus在演示上。
Project
Technology and Techniques Used
CustomerService
     Uses EJB 3.0 entity objects that are generated from database tables. JDeveloper is used to generate the entity objects.
     Uses JSR-181 Web Services Metadata annotations.
     Uses a stateless session bean as the session facade. The session bean is generated by JDeveloper.
CreditService
Shows "top-down" implementation of web services: starting with a WSDL file, you use JDeveloper to generate Java classes from the WSDL file.
RapidService
     Shows "bottom-up" implementation of web services: starting with Java classes, you use JDeveloper to generate a WSDL file.
     Uses JSR-181 Web Services Metadata annotations in the Java files
SelectManufacturer
Shows a simple asynchronous BPEL process with Receive
and Invoke activities.
FulfillmentESB
     Shows routing services that use filters to check input data. The filters then direct the requests to the appropriate targets.
     Uses transformation rules to transform data appropriately for writing to databases and files. Database adapters and file adapters perform the writes.
     Shows a routing service that routes to a JMS adapter.
SOAOrderBooking
     Shows how to use BPEL to orchestrate a flow sequence.
     Invokes the services provided by all the projects (except for OrderBookingESB).
     Invokes other BPEL flows (the SelectManufacturer BPEL project).
     Invokes ESB project (the FulfillmentESB project).
     Shows how to integrate Oracle Business Rules with BPEL.
     Shows Decision Service.
     Sends email through the Email service.
     Uses the flow activity to send requests to RapidService and SelectManufacturer.
     Uses the human task to set up a step that requires manual approval
OrderBookingESB
Invokes a BPEL project (the SOAOrderBooking project) by
using a SOAP service
SOADemo-Client
     Shows how to invoke an ESB project from an ADF application (the "place order" button invokes the OrderBookingESB project).
     Shows how to call the CustomerService project from the "login" button.

 

 

查看本文来源

喜欢本文,那就收藏到:

    Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪ViVi 365Key网摘 天极网摘 和讯网摘 博拉网 POCO网摘 添加到饭否 QQ书签 Digbuzz我挖网
相关评论  我也要评论
还没有关于此文章的相关评论!
  • 昵称: (为空则显示guest)
  • 评论分数: ★ ★ ★★★ ★★★★ ★★★★★
  • 评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
  • 导航
    赞助商
    文章类别
    订阅