The other characteristic feature of our approach
is the restriction on services’ interfaces to provide
only one functionality. Regardless, it is possible to
implement service with more interfaces (i.e. with
more functional capabilities), but the interfaces must
provide independent functionality. It means, services
are not allowed to hold any state information between
two independent incoming requests, in spite of which
interface the service was invoked on. Although
“stateless services” provide better reusability we
must cope with the issue of holding states of services
that are participating in the choreography in relation
with the state of the composite service (e.g. passing
of states between services InitiatePriceCalculation and
CompletePriceCalculation in our example).
The solution of both issues, the issue of passing of
data between services and the issue of holding states
of services that are participating in the choreography,
can be demonstrated on behaviour of the services
ProcessPurchaseOrder, InitiatePriceCalculation
and CompletePriceCalculation in our example (see
Figure 3). At first the ProcessPurchaseOrder
service requests the service InitiatePriceCalculation.
Consequently, the service InitiatePriceCalculation
prepares a price calculation (the initial calculation)
and stores it for later use, i.e. the service changes a
state of the price calculation process (see Figure 1)
implemented by the composite service ProcessPur-
chaseOrder. This state must be transformed into an
initial state of the service CompletePriceCalculation,
which is requested subsequently by the service
ProcessPurchaseOrder and which completes price
calculation based on the initial calculation. The
service ProcessPurchaseOrder forwards returning
data (encoded state) of the first service to the other
one. The merit of such design is independence of
requested services, although they share data and the
state.
5 THE SERVICE
ProcessPurchaseOrder
In previous sections, we have described specifications
of individual services that are participating in
the business process (see Figure 1). More
precisely, the services InitiatePriceCalculation,
CompletePriceCalculation, RequestShipping and
ProcessScheduling were described. This section
deals with composing those services into a single
service ProcessPurchaseOrder representing the
business process in its entirety. Specification of
the ProcessPurchaseOrder service has to include
description of its structure (i.e. an architecture of the
service) and its internal behaviour (i.e. collaboration
of involved services and the “orchestration” of the
ProcessPurchaseOrder service).
The architecture of the ProcessPurchaseOrder
service is described in Figure 3. The service provides
ProcessPurchaseOrder interface, which allows
synchronous and asynchronous calls of the service,
and auxiliary AsyncReply interface for accepting
replies to asynchronous calls from required services.
These required services are represented by their
interfaces InitiatePriceCalculation, CompletePriceCal-
culation, RequestShipping and ProcessScheduling.
Connection of the services is noticeable also in
Figure 2.
The behaviour of the ProcessPurchaseOrder
service is described in Figure 4. After receiving
a request from a Consumer, the service asyn-
chronously calls services InitiatePriceCalculation,
RequestShipping and ProcessScheduling. When
both InitiatePriceCalculation and RequestShipping
notify (via the AsyncReply interface, see Figure
2) they have finished processing the requests,
the CompletePriceCalculation service is called
asynchronously with the result received from
InitiatePriceCalculation.
While the CompletePriceCalculation is running,
ProcessPurchaseOrder computes the “Process
Schedule” internal process in parallel (see Figure
5). After CompletePr iceCalculation notifies it had
finished the computation, the “Process Invoice”
internal process is being computed parallel to the
“Process Schedule” process. As soon as both internal
processes “Process Schedule” and “Process Invoice”
are done and ProcessScheduling service notifies
it is finished, ProcessPurchaseOrder finishes its
processing by sending a result (the invoice) back
to the consumer. The result is returned instantly if
the service has been called synchronously or it is
returned via the AsyncReply consumer’s providing
interface to the address, which has been included in
the asynchronous call.
6 DISCUSSION AND RELATED
WORK
The work presented in this paper has been influenced
by several different proposals. First of all, we
should mention UML profiles for SOA. (Amir and
Zeid, 2004) introduces a simple UML profile that
is intended to use for modeling of web services.
(Johnston, 2005) provides a well-defined profile for
modeling of service-oriented solutions. (Ortiz and
Hern
´
andez, 2006) shows how services and their
ENASE 2008 - International Conference on Evaluation of Novel Approaches to Software Engineering
144