Imagine a scenario where we are buying a computer online and money has been deducted from our bank account. Suddenly an unexpected exception occurs, workflow stops, and the purchase gets cancelled. Obviously, such a thing should not happen in real life. If an exception occurs that induces workflow stop, the money should be returned back to our account. In WF4 we can use a
Compensable activity to handle such a compensation job.
Create a new Workflow Console application project and name it
Add a new class file to the project and name it
CompensationWokflow.cs. Fill the file with the following ...