Tutorial: Practicing With the Throw Step

Prerequisites:

You performed the steps in Tutorial: Creating an Empty Synchronous Orchestration Workflow for the Throw Step

In this exercise, you use a Scope step in the NamedFaultOWF2 orchestration workflow and add Catch branches to its FaultHandler section automatically.

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

Figure 1. ThrowOWF

Throw step in an orchestration workflow

To use the Throw step in an orchestration workflow that throw custom and named faults:

  1. In App Explorer, under Orchestration Workflows, click ThrowOWF.
  2. In the New Items section of the Step Palette, drag a Decision step onto the orchestration workflow editor, and drop it onto the line between the Start and End steps.

    In steps 3 through 10, you configure this step to decide between two possible outcomes: the company is Bluejay Bird Supply or the company is not Bluejay Bird Supply.

  3. On the General tab of the Property Editor, change the Name to IsCompanyBluejay.
  4. Right-click the IsCompanyBluejay step, and then select Insert New Branch.
  5. On the General tab of the Property Editor, change the Name to IsBluejay.
  6. On the Options tab of the Property Editor, enter the following expression in the Rule section using the expression editor: EventNoticeWithReply\Extension\Title="Bluejay Bird Supply"

    See About the Expression Editor.

  7. In the Step Palette, drag a Throw step onto the orchestration workflow editor and drop it on the IsBluejay branch.

    This step is used to show an error message to users when the Title field contains "Bluejay Bird Supply." It is also used to display an optional error code that is not shown to users, but can be used, for example, for debugging purposes.

  8. On the General tab of the Property Editor, change the Name to ReportBluejay, and then press the Tab key.
  9. On the Data Mapping tab, locate the FaultCode data element and enter the following in the corresponding cell of the Default value column: ERROR-BLUEJAY.
  10. Locate the FaultString data element, and enter the following in the corresponding Default value column: Bluejay Bird Supply is a credit risk.
  11. In the New Items section of the Step Palette, drag a Scope step onto the orchestration workflow editor, and drop it between the ReportBluejay and End steps.

    This step is used to enclose the GetTickerSymbol Web service operation and to catch any faults that it generates.

  12. On the General tab of the Property Editor, change the Name to GetTickerSymbolScope.
  13. In the Configured Items section of the Step Palette, drag a SerenaSampleTickerService step into the top section of the GetTickerSymbolScope step, and drop it. This step is used to get the ticker symbol for the company name passed from the Title field, or to return a fault for all other company names except Bluejay Bird Supply (see step 4).
  14. On the General tab of the Property Editor, change the Name to GetTickerSymbol.
  15. On the Operation menu, select GetTickerSymbol.
  16. 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.
  17. In the Select a Source popup that opens, under ThrowOWF, Inputs, EventNoticeWithReply, Extension; select Title; and then click OK.
  18. Expand the FaultHandler section.
  19. Right-click the Fault Handler step, and then select Insert New Catch.

    This Catch branch handles the SerenaSampleTickerService-GetTickerSymbolFault. All other faults generated by the GetTickerSymbol step are handled by the CatchAll branch.

  20. On the General tab of the Property Editor for the Catch branch, change the Name to GetTickerSymbolFault.
  21. 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 Step Palette, drag a Throw step into the FaultHandler section and drop it onto the GetTickerSymbolFault branch.

    This step is used to return a customized fault message. It is also used to generate an optional error code.

  23. On the General tab of the Property Editor, change the Name to ReturnGetTickerSymbolFault.
  24. On the Data Mapping tab, locate the FaultCode data element and enter the following in the corresponding cell in the Default value column: ERROR-SYSTEM.
  25. Locate the FaultString 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 ThrowOWF, GetTickerSymbolFault, Outputs, GetTickerSymbolFault; select detail; and then click OK.
  27. Select the End step.

    The contents of the Title field are passed to the End step. This step is used to display a valid ticker symbol in the Description field. Although Bluejay Bird Supply is listed in the SerenaSampleTickerService, its symbol is not returned because it was caught by the ReportBluejay Throw step.

  28. On the Data Mapping tab, under Extension, locate the Description data element, select the corresponding cell in the Source elements column, and then click the down arrow.
  29. In the Select a Source popup that opens, under GetTickerSymbol, Outputs, GetTickerSymbolResponse; select GetTickerSymbolResult; and then click OK.
  30. On the Quick Access Toolbar, click the Validate button.

    The following a 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.

  31. Publish and deploy the FaultHandlingProcApp.

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

Related Topics

Tutorial: Creating an Empty Synchronous Orchestration Workflow for the Throw Step