240 likes | 251 Views
Explore how to mediate service interactions, separate 'what' from 'how,' and model protocol behaviors. Enhance automation in process mediation for Semantic Web Services.
E N D
Process Mediation Stuart Williams skw@hplb.hpl.hp.com
Outline • Key Ideas/Principles • Scenario Outline • Service Definitions and Semantics(?) - ‘What’ • Protocol Descriptions – ‘How’ • Mediation Behaviour and Traces • Enhancements (?) • Wrap up and Discussion.
Key Ideas/Principles • Separate the ‘what’ from the ‘how’ – abstraction from mechanism. • Mediate the ‘whats’ – ie. relay meaning/effect (service primitives) not messages. • For a protocol the ‘what’ can be modelled as abstract service primitives (cf. IEEE/OSI protocol service defns). • Hypothesis: • To enable automated Process Mediation… Semantic Web Service Descriptions need to contain: • An abstraction of ‘what’ a service does – service primitives and the effect of their invocation on some shared model of the ‘world’. • A description of ‘how’ a protocol does ‘what’ it does – protocol mechanisms ie. rules for message exchanges.
.request t .indication .response .confirm Service Primitive Sequencing Basic Model of Interaction Partner A Partner B .indication .confirm .request .response .indication .confirm .request .response ProtocolService Primitives (purchaseOrder) ProtocolMessages Protocol Engine ProtocolEngine Messaging Service Primitives (msg) .request .request .indication .indication • purchaseOrder.request(Po=o) • purchaseOrder.indication(Po=o) • purchaseOrder.response(Po=o, Accept=a) • purchaseOrder.confirm(Po=o,Accept=a) • msg.request(To=t,From=f,Msg=m) • msg.indication(To=t,From=f,Msg=m)
Service Primitive Semantics – effects on partial shared state. U = Unknown B = Sent (Buyer Committed) Rx = Received by Seller A = Accepted by Seller (Buyer and Seller Committed) Re = Rejected by Seller (No Commitments) U U purchaseOrder.request B B purchaseOrder.indication purchaseOrder.confirm [Accept=false] Rx purchaseOrder.confirm [Accept=true] purchaseOrder.response [Accept=true] Rx purchaseOrder.response [Accept=false] A A Re Re Buyer Side Primitives Seller Side Primitives
Shared Perceptions of State U = Unknown B = Sent (Buyer Committed) Rx = Received by Seller A = Accepted by Seller (Buyer and Seller Committed) Re = Rejected by Seller (No Commitments) Buyer | Seller U|U purchaseOrder.request B|U purchaseOrder.indication B|B B|Rx purchaseOrder.response [Accept=true] purchaseOrder.response [Accept=false] B|A B|Re purchaseOrder.confirm [Accept=false] purchaseOrder.confirm[Accept=true] A|A Re|Re
“Fire and forget”? Delivery Characteristics Reliability? Ordering? Single/Multiple? Bounded Lifetime? Status Reporting None Failure to send? Failure to deliver? Protocol design must be robust to channel characteristics. Message Channel Assumptions .request .indication Messaging Service Primitives (msg)
POR(Po=x) POR_ACK(Po=x) POA(Po=x,Accept=?) POA_ACK(Po=x) POR(Po=x) Mb Pb POA(Po=x,Accept=?) Pa Ma Mediation by Relaying Service Primitives Partner ABuyer Partner BSeller po.ind_x(Po=ox) -> po.req_y(Po=oy)po.conf_y(Po=oy,Acc=ay) -> po.resp(Po=ox,Acc=ax) Mediator Protocol X Engine Protocol YEngine Protocol XEngine Protocol YEngine POR = purchase order request POA = purchase order acknowledge POR_ACK = acknowledge receipt of POR POA_ACK = acknowledge receipt of POA POR = purchase order request POA = purchase order acknowledge
POR(Po=x) POA(Po=x,Accept=?) Pa Pb Protocol X Buying and Selling Protocol Engine Behaviours Buyer(Po=o) Seller(Po=o) Guard / Action(s) B0 S0 purchaseOrder.req(Po=o) / msg.req(To=o.Seller, From=o.Buyer, Msg=POR(Po=o) ); startTimer; msg.ind(From=o.Buyer, To=o.Seller, Msg=POR(Po=o) ) / purchaseOrder.ind(Po=o); B1 S1 timeOut / msg.req(To=o.Seller, From=o.Buyer, Msg=POR(o) ); startTimer msg.ind(From=o.Buyer, To= o.Seller, Msg=POR(Po=o) ) / //Ignore Duplicates purchaseOrder.resp(Po=o,Accept=a)/ msg.req(To=o.Buyer, From=o.Seller, Msg=POA(Po=o, Acc=a) ); msg.ind(From=o.Seller, To= o.Buyer, Msg=POA(Po=o,Acc=a) ) / purchaseOrder.conf(Po=o,Accept=a); B2 S2 msg.ind(From=o.Seller, To= o.Buyer, Msg=POA(Po=o,Acc=a) ) / //Ignore duplicates msg.ind(From=o.Buyer, To= o.Seller, Msg=(POR(Po=o) ) / msg.req(To=o.Buyer, From=o.Seller, Msg=POA(Po=o, Acc=a) );
POR(Po=x) POR_ACK(Po=x) POA(Po=x,Accept=?) POA_ACK(Po=x) Pa Pb Protocol Y Buying Protocol Engine Behaviour Buyer(Po=o) Guard / Action(s) B0 purchaseOrder.req(Po=o) / msg.req(To=o.Seller, From=o.Buyer, Msg=POR(Po=o) ); startTimer; timeOut / msg.req(To=o.Seller, From=o.Buyer, Msg=POR(Po=o) ); startTimer; B1 msg.ind(From=o.Seller, To= o.Buyer, Msg=POR_ACK(Po=o) ) / stopTimer; msg.ind(From=o.Seller, To= o.Buyer, Msg=POA(Po=o,Acc=a) ) / stopTimer; purchaseOrder.conf(Po=o,Accept=a); msg.req(From=o.Buyer, To=o.Seller, Msg=POA_ACK(Po=o) ); msg.ind(From=o.Seller, To= o.Buyer, Msg=POR_ACK(Po=o) ) / //Ignore B2 msg.ind(From=o.Seller, To= o.Buyer, Msg=POA(Po=o,Acc=a) ) / purchaseOrder.conf(Po=o,Accept=a); msg.req(From=o.Buyer, To=o.Seller, Msg=POA_ACK(Po=o) ); B3 msg.ind(From=o.Seller, To= o.Buyer, Msg=POA(Po=o,Acc=a) ) / msg.req(From=o.Buyer, To=o.Seller, Msg=POA_ACK(Po=o) ); msg.ind(From=o.Seller, To= o.Buyer, Msg=POR_ACK(Po=o) ) / //Ignore delayed POR_ACK messages
POR(Po=x) POR_ACK(Po=x) POA(Po=x,Accept=?) POA_ACK(Po=x) Pa Pb Protocol Y Selling Protocol Engine Behaviour Guard / Action Seller(Po=o) S0 msg.ind(To=o.Seller, From=o.Buyer, Msg=POR(Po=o) ); / msg.req(To=o.Buyer, From=o.Seller, Msg=POR_ACK(Po=o)); purchaseOrder.ind(Po=o) ; msg.ind(To=o.Seller, From=o.Buyer, Msg=POR(Po=o) ); / msg.req(To=o.Buyer,From=o.Seller, Msg=POR_ACK(Po=o)); S1 purchaseOrder.resp(Po=x, Accept=a) / msg.req(To=o.Buyer, From=o.Seller, Msg=POA(Po=o, Accept=a) );startTimer; timeOut / msg.req(To=o.Buyer, From=o.Seller, Msg=POA(Po=o, Accept=a) );startTimer; S3 msg.ind(To=o.Seller, From=o.Buyer, Msg=POR(Po=o) ); / msg.req(To=o.Buyer,From=o.Seller, Msg=POA(Po=o, Accept=a)); msg.ind(To=o.Seller, From=o.Buyer, Msg=POA_ACK(Po=o) ); /stopTimer; S4 msg.ind(To=o.Seller, From=o.Buyer, Msg=POA_ACK(Po=o) ); / //Ignore redundant POA_ACKs msg.ind(To=o.Seller, From=o.Buyer, Msg=POR(Po=o) ) / //Ignore *very* late PORs
Mediation Behaviour Pox Poy Acceptx Accepty ox oy ax ay Schema/Ontology Mapping Data Mediation Instance Mapping M0 purchaseOrder.ind_x(Pox=ox) / purchaseOrder.req_y(Poy=oy) M1 po.ind_x(Po=ox) -> po.req_y(Po=oy)po.conf_y(Po=oy,Acc=ay) -> po.resp(Po=ox,Acc=ax) Mediator purchaseOrder.conf_x(Pox=ox,Accept=ax) / purchaseOrder.resp_y(Poy=oy,Accept=ay) Protocol X Engine Protocol YEngine M2
Protocol X Buyer – Protocol Y Seller Seller_Y Buyer_X Mediator PE_X PE_X PE_Y PE_Y purchaseOrder.req_x POR_X POR_X purchaseOrder.ind_x purchaseOrder.req_y POR_Y purchaseOrder.ind_y POR_ACK_Y POR_Y POR_X POR_ACK_Y purchaseOrder.resp_y POA_Y purchaseOrder.conf_y POA_Y purchaseOrder.resp_x POA_X POA_ACK_Y POA_Y POA_ACK_Y POR_X POA_X purchaseOrder.conf_x
Protocol Y Buyer – Protocol X Seller Seller_X Buyer_Y Mediator PE_Y PE_Y PE_X PE_X purchaseOrder.req_y POR_Y purchaseOrder.ind_y POR_Y purchaseOrder.req_x POR_ACK_Y POR_X POR_Y POR_ACK_Y purchaseOrder.ind_x POR_X POR_X purchaseOrder.conf_x POA_X Lost End-to-End Semantics. The request has not reached the Seller yet. POR_X purchaseOrder.conf_x POA_X purchaseOrder.resp_y POA_Y POA_Y purchaseOrder.conf_y POA_ACK_Y POA_Y POA_ACK_Y
Extend Protocol Y Service Definition purchaseOrder.request t purchaseOrder.indication purchaseOrder.status-indication purchaseOrder.status-notify purchaseOrder.response purchaseOrder.confirm Service Primitive Sequencing Add service primitives for acknowledgement of receipt. Optionally used. Allow .response semantics to subsume acknowledgment of receipt. Also, it is philosophically right to expect acknowledgement to originate from the Selling client rather than the Protocol Engine – ie. from the entity that committed to responding to the request.
Service Primitive Semantics – effects on partial shared state. (Revised) U = Unknown B = Sent (Buyer Committed) Rx = Received by Seller A = Accepted by Seller (Buyer and Seller Committed) Re = Rejected by Seller (No Commitments) U U purchaseOrder.indication purchaseOrder.request purchaseOrder.response [Accept=false] B B purchaseOrder.response [Accept=true] purchaseOrder.confirm [Accept=false] purchaseOrder.confirm [Accept=true] purchaseOrder.status-notify purchaseOrder.status-indication Rx Rx purchaseOrder.confirm [Accept=false] purchaseOrder.response [Accept=false] A Re purchaseOrder.confirm [Accept=true] A Re purchaseOrder.response [Accept=true] Buyer Side Primitives Seller Side Primitives
Revised Shared Perceptions of Order State U = Unknown B = Sent (Buyer Committed) Rx = Received by Seller A = Accepted by Seller (Buyer and Seller Committed) Re = Rejected by Seller (No Commitments) Buyer | Seller U|U Protocol X and Y purchaseOrder.request Protocol Y only B|U purchaseOrder.indication purchaseOrder.indication Rx|Rx B|B purchaseOrder.status-indication purchaseOrder.response [Accept=false] purchaseOrder.status-notify purchaseOrder.response [Accept=true] B|Rx purchaseOrder.response [Accept=true] purchaseOrder.response [Accept=false] B|A Rx|A B|Re Rx|Re purchaseOrder.confirm [Accept=false] purchaseOrder.confirm[Accept=true] purchaseOrder.confirm [Accept=false] purchaseOrder.confirm[Accept=true] A|A Re|Re
Update Mediator M0 M0 purchaseOrder.ind_y(Poy=oy) / purchaseOrder.req_x(Pox=ox) purchaseOrder.ind_y(Poy=oy) / purchaseOrder.status-notify_y(Poy=oy,Status=receivey) purchaseOrder.req_x(Pox=ox) M1 M1 purchaseOrder.conf_y(Poy=oy,Accept=ay) / purchaseOrder.status-notify_y(Poy=oy,Status=receivedy) purchaseOrder.resp_x(Poy=ox,Accept=ax) purchaseOrder.conf_y(Poy=oy,Accept=ay) / purchaseOrder.resp_x(Poy=ox,Accept=ax) M2 M2 Spoof acknowledgement on request (will behave as before). Synthesise acknowledgement with response. NB. Original behaviour is not broken – we allow .response/.confirm to subsume .status-notify/.status-indication
U|U purchaseOrder.request B|U B|B purchaseOrder.indication B|Rx purchaseOrder.response [Accept=false] purchaseOrder.response [Accept=true] B|A B|Re purchaseOrder.confirm[Accept=true] purchaseOrder.confirm [Accept=false] A|A Re|Re Buyer(Po=o) Guard / Action(s) B0 purchaseOrder.req(Po=o) / msg.req(To=o.Seller, From=o.Buyer, Msg=POR(Po=o) ); startTimer; B1 timeOut / msg.req(To=o.Seller, From=o.Buyer, Msg=POR(o) ); startTimer B2 msg.ind(From=o.Seller, To= o.Buyer, Msg=POA(Po=o,Acc=a) ) / //Ignore duplicates M0 purchaseOrder.ind_x(Pox=ox) / purchaseOrder.req_y(Poy=oy) M1 Mediator purchaseOrder.conf_x(Pox=ox,Accept=ax) / purchaseOrder.resp_y(Poy=oy,Accept=ay) Protocol X Engine Protocol YEngine M2 Service Description Elements • Abstract Service Defn (Protocol Service Defn) • inc effects on partial shared state (Semantics?) • Role and/or Combined perpectives • Buyer and Seller Behaviours (Protocol Rules) • Event [Guard] / Action(s) • Primitive invocations (linkage to effects/semantics) • Message Arrivals and Transmissions • Internal (layer) Events – Timeouts • Mediation Behaviour • (but want to synthesise this from description) • Primitive Relaying and Subsumtion Relationships
Preliminary Conclusions/Further Work • Mediation based on relaying semantics of abstract service primitives, rather than individual messages. • Focussed on ‘man-in-middle’ style mediation… but much more interested what elements are essential to enable ‘self-mediation’ . • Agnostic to formalism for FSM’s – Process Algebra’s, Abstract State Machines (aka Evolving Algebra’s). • Good for checking liveness and safety. • Further Work: • Tackle a more substantial example • eCommerce basket/checkout scenario • Trading Partners (part of context) • Template orders (shopping baskets) • Submission, tracking and amendment of orders (including cancellations).
Discussion/Questions • What description elements are essential to enable: • Developer based mediation? • Automatic mediation? • Relationship between Protocol Service Primitives, Capabilities and Goals. • ‘Asynchronous Callbacks’, Interface Typing and Referencing. • Concurrency and Transactions. • Multi-party Interactions • Relationship with WS-Choreography/Orchestration • Box ‘colour’: Grey, Black, White, Transparent. • Exception handling
U Buyer(Po=o) U Guard / Action(s) B0 purchaseOrder.request purchaseOrder.indication purchaseOrder.req(Po=o) / msg.req(To=o.Seller, From=o.Buyer, Msg=POR(Po=o) ); startTimer; B1 timeOut / msg.req(To=o.Seller, From=o.Buyer, Msg=POR(o) ); startTimer purchaseOrder.response [Accept=false] B B B2 purchaseOrder.response [Accept=true] msg.ind(From=o.Seller, To= o.Buyer, Msg=POA(Po=o,Acc=a) ) / //Ignore duplicates purchaseOrder.confirm [Accept=false] purchaseOrder.confirm [Accept=true] purchaseOrder.status-notify purchaseOrder.status-indication Rx Rx purchaseOrder.confirm [Accept=false] purchaseOrder.response [Accept=false] A Re purchaseOrder.confirm [Accept=true] A Re purchaseOrder.response [Accept=true] Buyer Side Primitives Seller Side Primitives Service Decription Elements Abstract Service Primitives and Semantic(?) Effects Role Behaviours (Buyer, Seller…)Protocol Rules Mediation Behaviour, Relaying and Subsumption Relationships between Service Primitives Pox Poy Acceptx Accepty ox oy ax ay Schema/Ontology Mapping Data Mediation Instance Mapping M0 purchaseOrder.ind_x(Pox=ox) / purchaseOrder.req_y(Poy=oy) po.ind_x(Po=ox) -> po.req_y(Po=oy)po.conf_y(Po=oy,Acc=ay) -> po.resp(Po=ox,Acc=ax) M1 purchaseOrder.conf_x(Pox=ox,Accept=ax) / purchaseOrder.resp_y(Poy=oy,Accept=ay) Mediator M2 Protocol X Engine Protocol YEngine