Conversational state management in Web Service Technologies
Homework for
Conversational state management in Web Service Technologies - - PowerPoint PPT Presentation
Conversational state management in Web Service Technologies Homework for Seminars in Software Engineering Author : Claudio Di Ciccio (dc.claudio@gmail.com) The service The service is a software artifact characterized by its behavior
Homework for
Conversational state management in Web Service Technologies 2
– the potential evolutions resulting from its interaction with some
– the execution of processes behind the service – the interaction with clients developing step after step – the separation between application logic and process-state logic
Conversational state management in Web Service Technologies 3
– Commonly, Web Services are a collection of request-response
– WSDL
– for example, only after a login (a web method to call) we can
Conversational state management in Web Service Technologies 4
– on that community, we can create composite Web Services
– in the size of the available services
not impossible to afford
Conversational state management in Web Service Technologies 5
– It has to act like a referee for addressing
– Thus, the Web Service operations' business logic is separated
– On the other hand, the process manager does not mind neither
Conversational state management in Web Service Technologies 6
– Based on stateless protocols (SOAP over HTTP, or SMTP...) – No information about the caller identity, neither about the
Conversational state management in Web Service Technologies 7
– Keep the state-related information (stateful Web Services) – Integrate the Web Service with an automatic behavioral
– respect standards (for portability reasons) the most as possible – use already developed technologies the most as possible
Conversational state management in Web Service Technologies 8
– Application servers, WS-plugin
– “Process containers”
Conversational state management in Web Service Technologies 9
– POJO (Plain Old Java Object) – Stateless Session Bean – Servlet
– this means that the abstract interface can be independent from
Conversational state management in Web Service Technologies 10
– through classes and interfaces definitions
– the same concept already seen for EJBs
requests
– we call “business protocol” the specification of which messages
service operations would be invoked in
Conversational state management in Web Service Technologies 11
– The compiler does not warn... – ... the container does: it's not admitted, as now
– Given you can not decide which instance actually serves you,
calls, as new Stateful objects are created at any WS-call
Conversational state management in Web Service Technologies 12
– http://www.w3.org/TR/ws-addr-core/
– it “defines a family of message addressing properties that
– it suits with our goal!
Conversational state management in Web Service Technologies 13
Conversational state management in Web Service Technologies 14
– It recalls the SESSION-header for HTTP protocols – And like the SESSION-header for HTTP protocols, it can support
Conversational state management in Web Service Technologies 15
– whose defined behavior is hold by a process manager
– application layer related
– whose conversational identity is saved on an identifier
– transport layer related
Conversational state management in Web Service Technologies 16
Conversational state management in Web Service Technologies 17
– separate runtime instructions from a priori definitions
– e.g. communication protocol and application logic
– can be used instead of external configuration files – make the code look cleaner – make the code easier to update
Conversational state management in Web Service Technologies 18
– Sun Glassfish does
– JBoss WS libraries provide WSAddressingServerHandler and
– we can use them in order to properly set up SOAP headers,
Conversational state management in Web Service Technologies 19
– Our classes, enriching
Conversational state management in Web Service Technologies 20
Conversational state management in Web Service Technologies 21
Conversational state management in Web Service Technologies 22
Conversational state management in Web Service Technologies 23
– Implement the WS-Addressing framework
– able to insert WS-Addressing tags into the SOAP headers
– Insert the conversational id as a parameter of WS-Addressing
previously defined Message Handler classes
Conversational state management in Web Service Technologies 24
Conversational state management in Web Service Technologies 25
– We use a subset of
Conversational state management in Web Service Technologies 26
– XML based – BPEL-extensible, in case we want to integrate it with a pre-
– Graph-Oriented
Conversational state management in Web Service Technologies 27
– XML is widely supported – XML is structured
– Frameworks, languages, technologies for interacting,
– as we may use HennessyMilner formulas for asserting
Conversational state management in Web Service Technologies 28
– Σ
– S is the finite set of states – s0 is the initial state, in S – δ
– F
F⊆S
Conversational state management in Web Service Technologies 29
– For example, the server, not the client, decides whether user-
– that is, make the service evolve to states that, otherwise, would be not
accessible
– Thus, we have devilish non-determinism – Consequently, we have to consider this new formal object
– Where every symbol maintains the previous meaning, except
make the service proceed through different states)
Conversational state management in Web Service Technologies 30
<start-state name="s0"> <state name="s"> <end-state name="f"/> <state name="s"> <transition to="s'" name="a"> </state> s0 s∈S f ∈F s ,a=s '
Conversational state management in Web Service Technologies 31
– start-states and end-states cannot be the coincident – transitions cannot end to start-states, nor start from end-states
Conversational state management in Web Service Technologies 32
– ... into the following one
admitted
Conversational state management in Web Service Technologies 33
– jPDL does not admit transitions to have multiple reachable
going to be automatically managed by the jBPM engine
deterministic processes: non-determinism in services' Transition Systems is used to hide some internal details
information to hide to the process manager
– In these cases, we can use special nodes called decision-
Conversational state management in Web Service Technologies 34
has a multi-arc
– decides, in case of devilish (server-dependent) non-determinism, the
transition to move through
an action, the process manager calls the proper action handler
Conversational state management in Web Service Technologies 35
– it includes the previous ones; – jBPM can directly manage exceptions thrown during the action;
calling method
– it enriches the focus on actions, rather than using the
– It delegates the action, or the decisions, to proper Java classes
– Encoding classes is like giving an interpretation to the schema
Conversational state management in Web Service Technologies 36
– As you can see, we are considering δ as a function, and not
– A
– D
D⊆S
Conversational state management in Web Service Technologies 37
– α
– η
– ω
Conversational state management in Web Service Technologies 38
<decision name="d"/> <state name="s"> <transition to="δ (s, a)" name="a"> <action class="e"/> </transition> </state> <decision name="d"><handler class="h"/></decision> <decision name="d"> <handler class="α (d, a)"/> <transition to="s" name="a"/> </decision> d∈D s,a=e d=h d ,a=s
Conversational state management in Web Service Technologies 39
– The next slide will show the same process, XML-encoded
Conversational state management in Web Service Technologies 40
Conversational state management in Web Service Technologies 41
boolean( not(//state[@name="Search"])
//transition[ parent::state[@name="Search"] and @name="Search by Title" and @to="SearchResult"] ) )
Search 〈Search⋅by⋅Title〉T ∧ [Search⋅by⋅Title]SearchResult
Conversational state management in Web Service Technologies 42
boolean( not(//state[@name="Search"])
//transition[parent::state[@name="Search"]] and not( //transition[parent::state[@name="Search"] and not(@name="Search by Title") ] ) ) )
Search 〈any〉T ∧ [any − Search⋅ by⋅Title] F
Conversational state management in Web Service Technologies 43
boolean( not(//start-state[@name="Start"])
//transition[parent::start-state[@name="Start"]] and not( //transition[ parent::start-state[@name="Start"] and not(@name="Log")] ) ) )
Start 〈any〉T ∧ [any − Log]F
Conversational state management in Web Service Technologies 44
– jBPM
– Action-handlers and decision-handlers
interfaces
– Thus, they provide the semantics behind process descriptors
Conversational state management in Web Service Technologies 45
Conversational state management in Web Service Technologies 46
– Information hiding
– Encapsulation
– jBPM framework guarantees persistence, coherence,
Conversational state management in Web Service Technologies 47
specified process
Conversational state management in Web Service Technologies 48
Conversational state management in Web Service Technologies 49
– Divided into three logical units
architecture
– A WAR with presentation modules (View)
– A WAR with control modules (Control)
– A JAR with persistence modules (Model)