Tutorial: Practicing With the Scope Step to Handle Named Web Service Faults

Prerequisites:

You performed the steps in Tutorial: Creating An Empty Synchronous Orchestration Workflow for the Scope Step to Handle Named Faults.

In this exercise, you use a Scope step in the NamedFaultOWF1 orchestration workflow.

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

Figure 1. NamedFaultOWF1

Handling named faults in an orchestration workflow

To use the Scope step in an orchestration workflow that handles named Web service faults:

  1. Under Orchestration Workflows, click NamedFaultOWF1.
  2. Create a working data element of type String to hold the message that is passed to the Description field as follows:
    1. Click a blank area of the orchestration workflow editor.
    2. On the Data Mapping tab of the Property Editor, under NamedFaultOWF1, right-click Working Data, and then select Add New DataElement.
    3. Change the name of the new DataElement to Message.
  3. In the New Items section of the Step Palette, drag a Scope step onto the orchestration workflow editor, and drop it between the Start and End steps.
  4. Change the name of the Scope step to GetTickerSymbolScope, and then press the Tab key.
  5. In the Configured Items section of the Step Palette, drag a SerenaSampleTickerService Service step onto the orchestration workflow editor, and drop it onto the line inside the top section of the GetTickerSymbolScope step.
  6. On the General tab of the Property Editor, change the Name to GetTickerSymbol.
  7. From the Operation menu, select GetTickerSymbol.
  8. 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.
  9. In the Select a Source tool that opens, under NamedFaultOWF1, Inputs, EventNoticeWithReply, Extension; select Title; and then click OK.
  10. In the New Items section of the Step Palette, drag a Calculate step onto the orchestration workflow editor, and drop it onto the line inside the top section of the GetTickerSymbolScope step, to the right of the GetTickerSymbol step.
  11. On the General tab of the Property Editor, change the Name to ReturnTickerSymbol.
  12. On the Options tab, in the Target section, enter the following using the expression editor: EventNoticeWithReply.Extension.Title.

    See About the Expression Editor.

  13. In the Expression section, enter the following expression using the expression editor: GetTickerSymbol.GetTickerSymbolResponse.GetTickerSymbolResult.
  14. Select the End step.
  15. On the Data Mapping tab, under Extension, locate the Title data element, select the corresponding cell in the Source elements column, and then click the down arrow.
  16. In the Select a source tool that opens, under NamedFaultOWF1, Inputs, EventNoticeWithReply, Extension; select Title; and then click OK.
  17. On the Data Mapping tab, under Extension, locate the Message data element, select the corresponding cell in the Source elements column, and then click the down arrow.
  18. In the Select a source tool that opens, under NamedFaultOWF1, WorkingData; select Message; and then click OK.
  19. Expand the FaultHandler section of the GetTickerSymbolScope step.
  20. Right-click the Throw step, and then select Insert New Catch.
  21. On the General tab of the Catch branch, select SerenaSampleTickerService-GetTickerSymbolFault on the Fault Name menu.

    SerenaSampleTickerService-GetTickerSymbolFault is automatically inserted in the Fault message box and is read-only.

  22. In the New Items section of the Step Palette, drag a Calculate step into the FaultHandler section, and drop it onto the Catch branch.
  23. On the General tab of the Property Editor, change the Name to ReturnGetTickerSymbolFault.
  24. On the Options tab, in the Target section, enter the following using the expression editor: Message.
  25. In the Expression section, enter the following expression using the expression editor: Catch.GetTickerSymbolFault.detail.
    Note: For this step, you must first type Catch followed by a period. Then you can use the expression editor to complete the expression. Also, any time you rename a Catch branch, you must use the new name in the expression.
  26. In the New Items section of the Step Palette, drag a Calculate step into the FaultHandler section of the GetTickerSymbolScope step, and drop it onto the CatchAll branch.
  27. On the General tab of the Property Editor, change the Name to CreateUnknownErrorMessage.
  28. On the Options tab, in the Target section, enter the following using the expression editor: Message.
  29. In the Expression section, type "An unknown error occurred at NamedFaultAWF_NamedFaultOWF1_GetTickerSymbol."

    Be sure to include the quotation marks.

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

    The following two warning messages appear in the Validation Results:

    • The required DefaultElement 'NamedFaultOWF1\Message' is not mapped or defaulted in 'NamedFaultOWF1'

      This message warns you that you did not provide a value for the Message working data element. You can ignore the message, or you can set the default value to 0 (zero) to prevent the message from appearing.

    • Compensation handler is empty.

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

  31. 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