Process Orchestration Design Principles and Best Practice
Process Orchestration Design Principles and Best Practice
1
2
Introduction................................................................................................................. 3
Implementation Considerations .................................................................................. 3
2.1
SOA Application Design Analysis ..................................................................... 3
2.1.1
Top level business process logic and partner interactions .......................... 4
2.1.2
Messages and Correlation Set..................................................................... 5
2.1.3
Human Workflow ....................................................................................... 6
2.1.4
Modularization and Reusability.................................................................. 7
2.1.5
Handling Faults and Exceptions ................................................................. 8
2.1.6
Handling Process Governance .................................................................... 9
2.1.7
Separation of Concerns ............................................................................. 10
2.2
Best Practice for Designing Orchestration Flow .............................................. 11
2.2.1
Process Development Cycle ..................................................................... 11
2.2.2
Important Design Principles Using BPEL ................................................ 12
2.3
Use Integrated Testing for Quality Control ...................................................... 13
2.3.1
Process Simulation.................................................................................... 13
2.3.2
Use BUnit for Automated Testing ............................................................ 14
3
Process Management and Maintenance Consideration............................................. 14
4
Engine Configuration and Tuning Best Practice ...................................................... 15
Page 2
1 Introduction
This paper discusses common issues and design considerations related to implementing a
SOA (Service Oriented Architecture) project using the ActiveVOS process orchestration
technology to create service enabled composite applications. The principles described
here are based on best practices gained from proven real-world experiences and it applies
to implementation projects regardless of the development methodology, scale of the
project and complexity of the design.
The goal of this paper is to promote a set of best practices specific to SOA and process
orchestration that would eventually result in lower risk, higher productivity, better agility
and resiliency and faster to market time in the development process. Some specific issues
addressed in this paper:
Important design considerations are enumerated so risks can be handled early on
and fewer surprises will be uncovered at later stage.
Design principles discussed here should be used as guideline for development
throughout the project life cycle and checked often. Superior flexibility and agility
in design enables smooth evolution of the application and long life. In another
word, start small and plan big.
Quality assurance is an integral part of the development cycle and should be
planed accordingly.
Manageability and governance are integral parts of the design and should not be
addressed as afterthought.
This paper does not try to prescribe a rigid approach or implementation framework
because we do not believe that there is a unique and singular approach towards SOA
implementation. SOA project life cycle should be managed and governed by the same set
of software engineering methodologies and project management principles adopted by
the performing organization as deemed appropriate to the delivery requirements, scale,
criticality and complexity of the project. What we really want to highlight are the
significant factors and aspects that are unique to a VOS based implementation. The
content of this paper should serve as input to the various phases of a project.
The audiences of this paper include anyone who would be involved in the scoping,
planning, design, development, testing, deploying and maintaining and managing phases
of a project.
2 Implementation Considerations
2.1 SOA Application Design Analysis
The first steps towards designing an architecture for SOA based orchestration process is
to analyze the business requirements of the project. The purpose of this analysis is to use
a top-down analysis process to gain as much understanding as possible so that the
business requirement can be translated into requirements of the initial design. The focus
Page 3
here is interoperability and other integration concerns such as security, quality of services,
etc.
For example if stage 1 of a project is to enable a desktop client application to connect to a
business process via intranet then it is often tempted to forgo the need to place any
security related token in the data model because it is not needed for the initial
implementation. However if at a later stage a web based self-service client needs to be
added to the system, then the data model may need to be revised to accommodate this
new requirement this may introduce costly changes to the already completed desktop
client because the XML schema has changed. Proper analysis upfront can avoid this kind
of issues by designing the data model with sufficient flexibility and extensibility.
The analysis can be performed based on the categories or topics covered in the next few
sections.
Is there a well-defined interface and data model that describes the partners
interface? Sometime home grown application may never have had a well-defined
interface (but it just worked) so an additional step may be needs to examine and
define an interface for the partner.
Is the WSDL and XML schema definition for the interfaces available? ActiveVOS
allows import of interface artifacts from shared repository into individual
orchestration project and these resources can be cached locally. Some time the
XML schema definition is not readily available but XML instance documents are,
then these instance documents can be used by ActiveVOS to create the
appropriated schema definitions.
What are the main characteristics of the partner services? Are they short lived,
atomic transactions that usually complete in seconds? Is so then synchronous
interaction pattern is most appropriate. If not (lets say the partner represents a
human task), then asynchronous communication pattern should be used.
Page 4
Are these definitions fairly stable or it is anticipated that they will change during
the course of implementation? The fundamental advantage of loosely coupled
application development model rests on the assumption that service interfaces are
well-defined and remain stable. Sometime several components are being
developed simultaneously and the interface does evolve over time because new
business requirements are being addressed this is in general an undesirable
practice because it is very costly to manage this kind of changes. Things may
break all over the place because someone has just replaced a base string type with
an enumeration type in a schema. If this cannot be avoided then an effective
mechanism and policies for managing these interface needs to be put in place:
o Interface artifacts may be put into source code control system and
versioned.
o Use the resource change notification feature of ActiveVOS to
automatically monitor changes. Deployment of these artifacts should be
strictly managed through change process.
o Close and effective team communication is key to success here think of
using co-location to reduce the delay and ambiguity in communication.
Will there be a need to bridge between different protocols and message encoding?
If yes, list the transport protocols/encoding and the applicable technology to
support them:
o ActiveVOS supports the following protocols/bindings for consumption
and producing services out-of-box: SOAP/HTTP/HTTPS, SOAP/JMS,
Plain XML/JMS, REST, JAVA/J2EE and Email.
o Use the custom invoke and custom receive handler mechanism provided
by ActiveVOS. With these features you can write Java class to handle the
message transformation and transport protocol conversion anyways you
want.
o Use an Enterprise Service Bus solution together with ActiveVOS if you
need to support a wide spectrum of transport protocols/bindings.
ActiveVOS process engine can be embedded in an ESB as a service
engine and have the ESB to handle the transport related issues. Your best
choice is to engage the professional services team at Active Endpoints for
this kind of integration.
Page 5
a combination of several piece of data (for example a process id and a sequence number).
The BPEL terminology for these data fragment is called property. The BPEL
terminology for the rules to extract these values from a particular message is called
property alias. The terminology for a complete set of correlation data that can be used for
correlating a single callback is called correlation set. Multiple correlation sets may be
used in one process to handle callbacks from multiple partners. It will be beneficial if
there are clearly understood prior to the development stage.
Page 6
Page 7
Page 8
The alert service can be used for recovery purpose as well, as it will receive the full
details of the exception. More often it requires human involvement to correct the
condition that causes the fault and conduct the recovery manually. For example a fault
caused by a typo in a social security number may require manual correction of the error
in the message variable and retry the failed step in the process. ActiveVOS provides an
interface facilitating such recovery activities. Some people may consider this similar to
what a human workflow would do the important difference is that human task may be
used in a business process to handle predictable exception conditions as part of the
process flow, whereas the suspend-retry function is mostly suitable for runtime error
recovery. However you can design a process with people activities and assign the process
as the alert service so human task can be used to handle uncaught exceptions.
Page 9
Page 10
Are there decision points in the process that will change more often than the
orchestration flow itself? If the changes happen much often than the release cycle
allowed, considering using business rules.
Who will initiate these changes? Are they the architects who design the
orchestration flow, or domain experts who do not know much about the process
flow? If the answer is domain experts then consider utilizing a business rules
management system (BRMS) to give the domain experts the tool to manage these
business policies.
How fast these changes need to take effect? BRMS will allow fast deployment of
business policies changes outside of the normal release cycle.
Using business rules in process orchestration requires the adoption of business rules
software and more effort is required to learn, design, develop and manage rules. You
need to balance the need of separation of concerns against this overhead to make an
appropriate design decision.
We have created reference implementation that demonstrates how to use Business Rules
with ActiveVOS.
Page 11
Define the invoke handler and endpoint reference for the partner
roles. Invoke handler specify what binding and protocols to send
messages to the partners.
Define the receive handler and endpoint reference for my roles.
This defines how the service exposed by this process can be
accessed by clients.
Define policies related to my role and partner roles this should
address any security, communication and QoS attributes required
for the defined interaction.
Define process governance related properties this includes
versioning policies, persistence policies and runtime process
management related data (indexed properties).
o Deploy and use the remote debugging capability of the designer to
diagnose any runtime issues
Page 12
when creating the process deployment descriptor and substitute the tokens
with components (host, port, service names, etc.) of the real address using
the engine administration console. This eliminates the need of redeploying
a process for the sole reason that a partners endpoint address has changed.
Efficient you want the process to perform efficiently at runtime
o BPEL contains constructs that allows for parallel execution. Flows and
parallel forEach activity provide powerful semantics to express the
attributes to execute the enclosed activities in a parallel manner.
ActiveVOS supports true parallel execution using multiple threads for
receiving inbound messages and invoking external services.
Compliant you want to create services that confirms to the most accepted
interoperability standards
o Use WS-I Basic Profile 1.0 as binding guidance when exposing process as
services.
Use doc-lit style whenever possible so the message payload can be
validated against schema
Use single part messages whenever possible
Do not use RPC-Encoded binding style unless you must. Encoded
message cannot be easily validated.
o When to use ActiveBPEL extension ActiveBPEL provides extension to
the features defined in the BPEL specification to address custom needs.
Use BPEL extension with caution because this makes the process less
portable. Below is a summary of the extension:
Suspend, Continue, Break - these permit logically driving a
process into the Suspend state and more fine grained
control of your looping constructs
XQuery, JavaScript as expression language, in addition to
XPATH which is mandated by the BPEL specification
ActiveBPEL functions these are functions (getProcessId,
get Attachment, etc.) that provide access to features not
covered by BPEL specification.
Custom invoke, custom function this provides user a way
to create Java based components and use them in
expressions or as partner services
Page 13
simulation against the process and check if the process behaves as expected under these
conditions.
Simulation is a powerful tool to validate the process without the need of ever deploying it.
You can simulate as many scenarios as you want for a given process. Simulation is
especially useful for testing newly added logic. The key to simulation is to collect sample
data early and understand how they can applied for the test scenarios.
Page 14
off for the engine. Process persistence can be turned on or off for individual
process. Please note that enable logging will trigger additional overhead at
runtime.
Use engine monitoring feature key performance indicators such as faulted
process count, count of discarded inbound messages can be monitored using the
engine monitoring service. You turn on the individual indicators and assign a
BPEL process as the handler of the monitoring events.
Page 15