course: coms-e6125 professor: gail e. kaiser student: shanghao li (sl2967)

22
Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

Upload: aleesha-cross

Post on 18-Jan-2016

219 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

Course: COMS-E6125Professor: Gail E. KaiserStudent: Shanghao Li

(sl2967)

Page 2: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

OutlineBackgroundBasic of Web Service Process ModelingSome method of modeling and reasoning

about Web Service, including Orchestration and Choreography

Compare different approaches of WS composition

Some other formal method Conclusion

Page 3: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

BackgroundService Oriented Architecture using Web

Service- An effective solution in addressing the demand of enterprise integration

- An emerging cross-disciplinary method for distributed computing

- Changes the way in which software applications are designed, architected (SOA), delivered and consumed

Web Service is an effective way to realize SOA - Autonomous, platform-independent computational elements, possibly managed by different organizations- Described, published, discovered, and programmed to build networks of collaborating applications, distributed both within and across organizational boundaries

Page 4: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

Background Web Service Stack

Transaction layer: Enable the participants to meet the global protocol

Reliable Messaging layer: Guaranteed the delivery of information

SOAP: Defines the basic structure of a message Web Services Description Language: Depict the interface of the

Web Service. UDDI registry: Allows publishing the availability of a Web Service

Page 5: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

Basic of Web Service Process ModelingWeb Service Process Modeling, sometimes

known as Business Process Modeling, is set of technologies and standards for the design, execution, administration, and monitoring of business processes which is the flow or progression of activities

It is related to the arrangement of business specifications and a specific composition of activities with certain inputs and outputs provides value.

Page 6: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

Modeling and reasoning about Web Service

What are the reasoning tasks

How to mode the control flow and data flow

What are the techniques for these tasks

Page 7: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

Orchestration and ChoreographyOrchestration (Like BPEL4WS)

Refers to an executable business processes that may interact with both internal and external Web services.

Describes how Web Services can interact with others at the message level, including the business logic and execution order of the interactions

• Choreography (Like WSCI, WS-CDL)More collaborative in nature, where each party

involved in the process depicts the part they play in interaction

Tracks the sequence of messages that may involve multiple parties and multiple sources

Page 8: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

Business Process Execution Language for Web Service (BPEL4WS)

The information described by BPEL4WS• The execution order of the activities• The triggering conditions of the activities• The partners for external activities• The composition of Web Services• The binding to WSDL

Page 9: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

BPEL activitiesBPEL activities: atom actions

- <receive/reply>: To provide an interface to call Web Service- <invoke>: Call a Web Service synchronically or non- synchronically- <assign>: To give a value- <terminate>: To stop a process- <wait>: keep for certain time- <empty>: keep state- <throw>: Show mistake information and address it

Page 10: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

BPEL structured activities- <sequence>: an ordered sequence of activities- <flow>: parallel activities

- <switch>: case-statement approach- <while>: loop- <pick>: execute one alternative path- <fault Handlers>: Defines the recovery actions

when faults occur and response to faults

- <link>: Defines the dependencies between activities in BPEL

Page 11: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

Data flow: <variable>- <variable messagetype = “ ”> :

WSDL message- <variable type = “ ”> : XML schema

simple type- <variable element =“ ” > : XML

schema element

Page 12: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

Web Service Choreography Interface(WSCI)Atomic Activities

- <action> : mapping to an operation in WSDL- <delay>- <empty>- <fault>- <call>: for the initialization of a <process>- <spawn>: for the initialization of a <process>- <join>: for the initialization of a <process>

Complex activities of WSCI- <process>- <all>: parallel- <choice>- <foreach>- <sequence>- <switch>- <until>- <while>

Variables: map to SOAP messages similar like BPEL

Page 13: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

Web Service Choreography Description Language(WS-CDL)A global conversation among servicesObservable behaviorsElements and activities

- Channels - Three structures: sequence, parallel,

and choice - Variables

Page 14: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

Simple Use-case ScenarioAir-ticket agent ordering system

Page 15: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

BPEL code <process name="Retailer" business-process/">

<! Main process > <sequence name="main"> <!-- Step 1: The buyer sends

order --> <receive name="receiveInput"

partnerLink="buyer" portType="tns:Agent"

createInstance="yes" operation="sendOrder" variable="Order">

<correlations> <correlation set="poset"

initiate="yes"/> </correlations> </receive>

  <!-- Step 2: Send notification to the buyer -->

<invoke name="callbackbuyer" partnerLink="buyer"

portType="tns:buyerCallback" operation="orderReceipt"

inputVariable="po"/> 

<!-- Step 3: create order record in company-->

<invoke name="writePOToDB" partnerLink="agentDB"

portType="tns:OrderDB" operation="createOrder"

inputVariable="order"/>

<!-- Step 4: send order to companyDB --> <invoke name="sendPOrdertoDB"

partnerLink="companyDB" portType="tns:companyDB" operation="sendOrder"

inputVariable="order"/> <!-- Step 5: wait for companyDB

response --> <receive createInstance="no"

name="receiveDBResponse" partnerLink="companyDB" portType="tns:companyDBCallback"

operation="onResult" variable="orderResponse"> <!-- correlate on identifiers in initial

order --> <correlations> <correlation set="poset"

initiate="no"/> </correlations>

</receive>   <!-- Step 6: send companyDB response to buyer --> <invoke name="responseTobuyer"

partnerLink="buyer" portType="tns:buyerCallback operation="orderResult"

inputVariable="orderResponse"/>

Page 16: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

CDL CodeThe WS-CDL buyer-agent interaction code is:

<interaction name="OrderInteraction" channelVariable="tns:RChannel" operation="handleOrder" initiate="true"> <participate relationshipType="tns:BuyerAgentRelationship" fromRole="tns:Buyer" toRole="tns:Agent"/>

<exchange name="OrderReq" informationType="tns:Order"

action="request"> <send variable="cdl:getVariable(OrderNum, tns:buyer)"/>

<receive variable="cdl:getVariable(OrderNum, tns:Agent)"/> </exchange>

<exchange name="OrderRsp" informationType="tns:OrderAck" action="respond">

<send variable="cdl:getVariable(OrderAckAgent, tns:Agent)"/>

<receive variable="cdl:getVariable(OrderAckBuyer, tns:Buyer)"/>

</exchange></interaction>

Page 17: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

BPEL vs. WS-CDLBPEL4WS is mainly used for an internal activity

and focuses on what kind of task on individual can do

WS-CDL, which is a choreography language follows the way that the individuals tasks can make contribution to a bigger result.

In conclusion, WS-CDL provides the global information exchange between different partners while BPEL provides the messages exchange from the angle of only one participant.

Page 18: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

BPEL vs. WS-CDL• Both XML-based

• BPEL: coordination/composition of WSs (WSDL-based)• Processes model the flow of WSs by connecting activities that

communicate with external WS providers

• WS-CDL: choreography description of WSs • Interactions describe the information exchange by specifying

participants, information and channel• Exception handling and compensations supported through

exception and finalizer work units

Page 19: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

Orchestration VS Choreography Different mechanic

However, neither of them offer any support for the verification of WS composition at design time

That is why other formal method come into play!

Page 20: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

Other formal methodsPetri nets are framework to model

concurrent systemsA Petri Net (P/T Net) is a triple (P, T, F),

where- P is a finite set of places,- T is a finite set of transitions, (P ∩ T = )∅- F ⊆ (P ×T) ∪ (T ×P) is a finite set of the flow relation.

The BPEL code can be transformed into the Petri net diagram to very the data flow and control flow.

Some useful open source tool are available like BPEL2PNML, WOFBPEL to generate the Petri net diagram

Page 21: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

Other formal methodsAutomata:

- A finite automaton Γ is a 5-tuple Γ = (X,Σ, T, I, F), where:

- X is a finite set of states;- Σ is a finite set of events;- T ⊆ X × Σ × X is a finite set of transitions;- I ⊆ X is a finite set of initial states;- F ⊆ X is a finite set of final states.

Process AlgebraPi – Calculus is one method which is suited for depicting concurrency software system.

Page 22: Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)

ConclusionSeveral approaches are discussed for

modeling Web Service Process and composition and analyze their difference.

Formal method and tools allow one to simulate and verify the activities of one’s model at design time

Further work can be done to verify the correctness of WS compositions and perform quantitative analysis of QoS aspects.