The method of Web Service Process modeling Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)
Outline • Background • Basic of Web Service Process Modeling • Some method of modeling and reasoning about Web Service, including Orchestration and Choreography • Compare different approaches of WS composition • Some other formal method • Conclusion
Background • Service 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
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. • UDDIregistry: Allows publishing the availability of a Web Service
Basic of Web Service Process Modeling • Web 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.
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
Orchestration and Choreography • Orchestration (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
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
BPEL activities • BPEL 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
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
Data flow: <variable> • - <variable messagetype = “ ”> : WSDL message • - <variable type = “ ”> : XML schema simple type • - <variable element =“ ” > : XML schema element
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
Web Service Choreography Description Language(WS-CDL) • A global conversation among services • Observable behaviors • Elements and activities - Channels - Three structures: sequence, parallel, and choice - Variables
Simple Use-case Scenario • Air-ticket agent ordering system
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"/>
CDL Code • The 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>
BPEL vs. WS-CDL • BPEL4WS 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.
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
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!
Other formal methods • Petri nets are framework to model concurrent systems • A 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
Other formal methods • Automata: - 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 Algebra Pi – Calculus is one method which is suited for depicting concurrency software system.
Conclusion • Several 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.