16
Module 10: Creating Transactional Business Processes

Module 10: Creating Transactional Business Processes

  • Upload
    rivka

  • View
    41

  • Download
    1

Embed Size (px)

DESCRIPTION

Module 10: Creating Transactional Business Processes. Overview. Lesson 1: Introduction to Transactions Lesson 2: Configuring Transactions. Lesson 1: Introduction To Transactions . What Are Transactions? What Is Instance Persistence? Persistence Points in an Orchestration - PowerPoint PPT Presentation

Citation preview

Page 1: Module 10: Creating Transactional Business Processes

Module 10:Creating TransactionalBusiness Processes

Page 2: Module 10: Creating Transactional Business Processes

Overview

Lesson 1: Introduction to Transactions Lesson 2: Configuring Transactions

Page 3: Module 10: Creating Transactional Business Processes

Lesson 1: Introduction To Transactions

What Are Transactions? What Is Instance Persistence?Persistence Points in an OrchestrationSteps for Setting Up a Transaction

Page 4: Module 10: Creating Transactional Business Processes

Transaction Types

Atomic — provide rollback capabilitiesLong-running — save state at persistence points

What Are Transactions?

Scope Shape

Framework for transactionsEnables exception handlingEnables compensation handling

Scope{ }

Drop a shape fromthe toolbox here

Page 5: Module 10: Creating Transactional Business Processes

What Is Instance Persistence?

State Persistence

Orchestration engine manages the persistence and restoration of orchestration service instancesCritical when resources required by service instances are greater than resources available

Persistence Functions

Dehydration and rehydration Instance recovery Transaction compensation Controlled system shutdown

Page 6: Module 10: Creating Transactional Business Processes

Persistence PointsPersistence Point

Persistence Points in an Orchestration

MessageBox

Message sent within anon-atomic scope End of transactional scope Starting a new orchestration instance (Start Orchestration shape)Debug break pointDehydrationOrchestration completesSystem shutdown

Persist State

Page 7: Module 10: Creating Transactional Business Processes

Create a scope1

Determine if the transaction requires compensation3

Identify potential errors4

Add appropriate exception handlers5

Define compensation code6

Identify the type of transaction required2

Steps for Setting Up a Transaction

Page 8: Module 10: Creating Transactional Business Processes

Lesson 2: Configuring Transactions

Defining an Orchestration as TransactionalCreating a Long-Running TransactionCreating an Atomic TransactionCreating Modular Business Processes Demonstration: Creating TransactionsAdding Compensation CodeDemonstration: Adding Compensation Code

Page 9: Module 10: Creating Transactional Business Processes

Defining an Orchestration as Transactional

Transactional orchestration

Use to define an entire orchestration as transactionalYou can nest a long-runningor atomic transaction withina transactional orchestrationYou cannot nest a transactional scope within an orchestration that is not transactional Set the Transaction Type property to specify the transaction type forthe orchestration

Page 10: Module 10: Creating Transactional Business Processes

Long-Running TransactionLong-running transactions

May run for an extended timeUsed when ACID properties arenot requiredData is not locked and can be modifiedIndividual steps are committed during the transactionThe transaction itself is not committed until the last statement has completedCan be nested to provideatomic components

Creating a Long-Running Transaction

Loan application received

Request Credit Report

Order Appraisal

Sign Documents

Page 11: Module 10: Creating Transactional Business Processes

Creating an Atomic Transaction

Atomic Transactions

Guarantee rollback for transaction failuresUsed when ACID properties are requiredIsolate state changes until committedCan set entire orchestration to atomic

Atomic Transaction

Debit Account A Credit Account B

Commit Commit

Page 12: Module 10: Creating Transactional Business Processes

Creating Modular Business Processes

Invokes anotherorchestration asynchronouslyCalling orchestration continues processing

Start Orchestration

Invokes anotherorchestration synchronouslyCalling orchestration waits

Call Orchestration

Page 13: Module 10: Creating Transactional Business Processes

Demonstration: Creating Transactions

In this demonstration, you will see how to:Set an orchestration as transactionalAdd a transactional scope toan orchestrationAdd an exception handler to a scope

Page 14: Module 10: Creating Transactional Business Processes

Adding Compensation Code

Compensation code

Can be used for long-running or atomic transactionsReverses the effects of a transactionCalled after the transaction has been completedUses default compensation for nested transactions

Atomic Transaction

Commit

Credit Account A

Commit

Credit Account B

Compensation Code

Reverse Debit Reverse Credit

Page 15: Module 10: Creating Transactional Business Processes

Demonstration: Adding Compensation Code

In this demonstration, you will see how to:Add a compensation block toa transaction

Page 16: Module 10: Creating Transactional Business Processes

Lab: Creating Transactional Business Processes

Exercise 1: Adding Exception Handling to an Orchestration

Exercise 2: Adding Compensation to an Orchestration

Exercise 3: Calling CompensationExercise 4: Testing the Application