Tutorial: Practicing with the Compensate Step

Prerequisites:

You performed the steps in Tutorial: Creating an Empty Asynchronous Orchestration Workflow for the Compensate Step.

In this exercise, you use a Compensate step in the CompensateOWF orchestration workflow.

Note: For this tutorial, the purpose of the SerenaSampleTickerService Web service is to return a named fault, not to get the results of any of its operations.

After you complete the steps in this exercise, your orchestration workflow should look like the one in the following figure:

Figure 1. CompensateOWF

Compensate step in an orchestration workflow

To use the Compensate step in an asyncronous orchestration workflow:

  1. In App Explorer, select CompensateOWF.
  2. In the New Items section of the Step Palette, drag a Scope step onto the orchestration workflow editor, and drop it onto the line between the Start and End steps.
  3. On the General tab of the Property Editor, change the Name to OuterScope, and then press the Tab key.
  4. In the New Items section of the Step Palette, drag a Scope step onto the orchestration workflow editor, and drop it inside the top section of the OuterScope step.
  5. On the General tab of the Property Editor, change the Name to UpdateTitleScope.
  6. In the Configured Items section of the Step Palette, drag an sbmappservices72 Service step into the UpdateTitleScope step, and drop in the top section.
  7. On the General tab of the Property Editor, change the Name to UpdateTitle.
  8. From the Operation menu, select TransitionItem.
  9. On the Data Mapping tab, expand item, id; locate the tableIdItemId data element; select the corresponding cell in the Source elements column; and then click the down arrow.
  10. In the Select a source popup that opens, under CompensateOWF, Inputs, EventNotice, Extension; select ItemId_TableRecId; and then click OK.
  11. Locate the title data element, and enter the following in the corresponding cell in the Default value column: Updated by CompensationOWF.
  12. Expand the CompensationHandler of the UpdateTitleScope step.
  13. In the Configured Items section of the Step Palette, drag an sbmappservices72 Service step into the CompensationHandler of the UpdateTitleScope step.
  14. On the General tab of the Property Editor, change the Name to ResetTitle.
  15. From the Operations menu, select TransitionItem.
  16. On the Data Mapping tab, expand item, expand id; locate the tableIdItemid data element; select the corresponding cell in the Source elements column; and then click the down arrow.
  17. In the Select a source popup that opens, under CompensateOWF, Inputs, EventNotice, Extension; select ItemId_TableRecId; and then click OK.
  18. Locate the description data element, and enter the following in the corresponding Default value column: Returning Title field to its original value.
  19. Collapse the UpdateTitleScope step.
  20. In the New Items section of the Step Palette, drag a Scope step into the top section of the OuterScope step, and drop it on the right of the UpdateTitleScope step.
  21. On the General tab of the Property Editor, change the Name to GetTickerSymbolScope.
  22. In the Configured Items section of the Step Palette, drag a SerenaSampleTickerService Service step into the top section of the GetTickerSymbolScope step.
  23. On the General tab of the Property Editor, change the Name to GetTickerSymbol.
  24. On the Operation menu, select GetTickerSymbol.
  25. On the Data Mapping tab, locate the company data element; select the corresponding cell in the Source elements column; and then click the down arrow.
  26. In the Select a source popup that opens, under CompensateOWF, Inputs, EventNotice, Extension; select Title; and then click OK.
  27. Expand the FaultHandler section of the GetTickerSymbolScope step.
  28. Right-click the Fault Handler step, and then select Insert New Catch.
  29. Select SerenaSampleTickerService-GetTickerSymbolFault from the Fault name list.
  30. On the General tab of the Property Editor, change the Name to GetTickerSymbolFault.

    SerenaSampleTickerService-GetTickerSymbolFault automatically appears in the Fault message box.

  31. In the New Items section of the Step Palette, drag a Throw step into the FaultHandler section of the GetTickerSymbolScope step, and drop it onto the GetTickerSymbolFault branch.
  32. On the Data Mapping tab, locate the FaultString data element, select the corresponding cell in the Source elements column; and then click the down arrow.
  33. In the Select a source popup that opens, under GetTickerSymbolFault, Outputs, GetTickerSymbolFault; select detail; and then click OK.
  34. Expand the FaultHandler section of the OuterScope step.
  35. In the New Items section of the Step Palette, drag a Compensate step into the FaultHandler section, and drop it onto the CatchAll branch.

    On the General tab of the Property Editor, the Scope should be [Default Scope].

  36. On the Quick Access Toolbar, click the Validate button.

    The following warning message appears in the Validation Results: Compensation handler is empty.

    You can ignore this message, because a compensation handler is not required for this orchestration workflow.

  37. Publish and deploy the FaultHandlingProcApp.

    See Step 6: Publish the Process App and Step 7: Deploy the Process App for instructions.

Related Topics

Using the Service Step

Using the Calculate Step

Tutorial: Running the NamedFaultAWF Project and Invoking a Catch Branch