Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Azure

Service-Orientation with .NET : Service Composition and Orchestration Basics - Orchestration (part 2)

3/28/2011 2:34:12 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

State Repository and Compensating Service Transaction

Whereas regular task services tend to encapsulate parent business process logic that can be executed within reasonable timeframes as part of single, runtime service activities, orchestrations offer the ability to create and manage long-running service activities.

The execution time of a given orchestration can span from a few seconds to hours or even days, especially if it involves human interaction. This is why orchestration platforms naturally provide a central state database and an alternative transaction mechanism that does not allow for the rollback of changes. These two characteristics correspond to the State Repository and Compensating Service Transaction patterns respectively.

State Repository with .NET

During times of inactivity, long-running processes can be stored in a central state database through a technique called dehydration. When processing needs to resume, the process logic is rehydrated and loaded back into memory. This is the primary reason State Repository is applied within orchestration platforms.

Managing this type of state previously with traditional .NET component technologies, such as .NET Enterprise Services or COM+, was often challenging. .NET orchestration tools, on the other hand, are built specifically to accommodate the state management requirements of long-running processes. For example, if you think of a process as an object of type orchestration, then capturing the state of a running process instance is equivalent to taking a snapshot of all the properties of that object and saving it to persistent storage. Rehydration is then just a matter of deserializing the data from the persistent storage to recreate the orchestration object graph.

Figure 5 shows how only active process instances reside in the orchestration engine. Idle process instances, such as those waiting to receive messages, are dehydrated and stored in persistent storage (usually SQL Server).

Figure 5. The orchestration engine dehydrates idle process instances to a database to conserve server resources.

Compensating Service Transaction

The parent business process logic encapsulated by an orchestrated task service can be extended with routines designed to respond to various exceptions that may occur at runtime in relation to an overarching transaction. These routines are commonly employed as an alternative to ACID-style transactions when it makes sense not to preserve the state of the process prior to the transaction. As a result, a rollback of all changes that occurred prior to the exception is not required. The Compensating Service Transaction pattern allows for a failed transaction to be handled via this pre-defined exception logic, referred to as compensation logic (as shown in Figure 6).

Figure 6. Compensation logic is pre-defined as part of the overall business process logic encapsulated by the orchestrated task service controlling a transaction as part of a service composition.


Both WF and BizTalk Server provide different features for defining compensations. Because compensation logic is part of the overall workflow or process definition, the same tools are generally used.

Other Patterns

The extended patterns hierarchy for the Orchestration compound pattern includes the additional Atomic Service Transaction , Data Model Transformation, and Rules Centralization patterns (Figure 7). When applied in conjunction with the core patterns, these optional patterns provide further features and capabilities that can enhance and extend orchestration platforms. Both WF and BizTalk Server provide support for these patterns (as shown in the upcoming Table 1).

Figure 7. The extended patterns hierarchy for the Orchestration compound pattern.

Table 1. Support for patterns mapped to different parts of the Microsoft technology platform. (1 = Native and configuration-only support, 2 = Can be created, 3 = Not applicable or not supported.) Note that with both WF and BizTalk Server, State Repository  is applied with the use of SQL Server.
Orchestration PatternsWFBizTalk Server
Process Abstraction21
Process Centralization (tools)21
State Repository
21
Compensating Service Transaction
21
Rules Centralization
21
Atomic Service Transaction
21
Data Model Transformation
21

Microsoft Orchestration Platforms: WF and BizTalk Server

Table 1 highlights the differences in the respective platforms in how they provide support for the attainment of the feature-sets associated with the patterns.


Each platform has distinct strengths and weaknesses with regard to feature-set, flexibility, cost, and the effort necessary to build, run, and maintain orchestrated solutions. Table 2 provides further insight into some key areas of comparison.

Table 2. A comparison of orchestration-related characteristics provided by WF and BizTalk Server platforms.
CharacteristicWFBizTalk Server
APIs.NET, WF object modelXML, .NET orchestration library, BizTalk object model
architecture foundation.NETXML and .NET
autonomyorchestrations are autonomous or embedded in other applicationsorchestrations are fully autonomous
composabilitycomposition of Web services and custom WF activities, and orchestrations are composable as services or directlycomposition of Web services and legacy applications, and orchestrations are composable as services or directly
costfree of charge as part of the .NET frameworklicensed by processor
discoveryservices are discoverable via published WSDL definitions or inside the developer toolservices are discoverable via published WSDL definitions
extensibilityhigh extensibility for customized execution, state persistence and support for other protocols and transports via custom activitiesextensibility to support additional transports, protocols, and message processing
formal contractslight support for service contracts in the form of .NET interfacesstrong support for XML Schema and WSDL-based contracts
industry standardssupport for SOAP, WSDL. WS-*strong support for XML, SOAP, WSDL, and WS-* with WCF integration and limited support for WS-BPEL
messaginggeneral support for asynchronous messaging, resource management, and XML-based message exchanges
reusabilityreusable via Web services and directly inside the orchestration engine (other forms of reuse possible with custom development)reusable via Web services, queue endpoints, file drop, and directly inside the orchestration engine
rules enginerules based on facts in .NET objectscomplex rules based on facts in XML documents, .NET objects, and database records
scalabilitymedium scalability through custom extensions for persistence and activity schedulinghigh scalability through clustering and distributable functionality
state managementprocess state is stored in memory, SQL Server, or custom data storeprocess state is stored in SQL Server
toolsre-hostable orchestration design, Web service publishingorchestration design, data mapping, Web service publishing, runtime monitoring and deployment
Other -----------------
- SOA with .NET and Windows Azure : Service Composition 101 (part 2)
- SOA with .NET and Windows Azure : Service Composition 101 (part 1)
- SOA Security with .NET and Windows Azure Security (part 2) - Windows Azure Platform AppFabric Access Control Overview
- SOA Security with .NET and Windows Azure Security (part 1) - Cloud Computing Security 101
- Running a healthy service in the cloud : Better together for scaling
- Running a healthy service in the cloud : Using the service management API (part 4) - Changing configuration and dynamically scaling your application
- Running a healthy service in the cloud : Using the service management API (part 3) - Automating a deployment
- Running a healthy service in the cloud : Using the service management API (part 2) - Listing your services and containers
- Running a healthy service in the cloud : Using the service management API (part 1) - Setting up the management credentials
- Running a healthy service in the cloud : Transferring diagnostic data
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server