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

Prerequisites:

You performed the steps in Tutorial: Creating An Empty Synchronous Orchestration Workflow to Handle Generic Web Service Faults Using the Scope Step.

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

Note: Even though the SBM Application Engine actually returns a named fault, for demonstration purposes, this exercise assumes that is does not.

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

Figure 1. GenericFaultOWF

Generic fault handling in an orchestration workflow

Later, when you run the GenericFaultApp Project, you will alter this orchestration workflow so it returns an error message in the Description field.

To use the Scope step in an orchestration workflow to handle generic Web service faults:

  1. In App Explorer, under Orchestration Workflows, click GenericFaultOWF.
  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 GenericFaultOWF, right-click Working Data, select Add New, and then select String.
    3. Change the name of the new data element (String) 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. On the General tab of the Property Editor, change the Name to IsUserValidScope, and then press the Tab key.
  5. In the Configured Items section of the Step Palette, drag an sbmappservices72 Service step onto the orchestration workflow editor, and drop it onto the line inside the top section of the Scope step.
  6. On the General tab of the Property Editor, change the Name to VerifyUser.
  7. From the Operation menu, select IsUserValid.
  8. On the Data Mapping tab, locate the loginId data element, select the corresponding cell in the Source elements column, and then click the down arrow.
  9. In the Select a Source popup that opens, under GenericFaultOWF, Inputs, EventNoticeWithReply, Extension; select Title; and then click OK.
  10. In the Step Palette, drag a Decision step onto the orchestration workflow editor, and drop it onto the line inside the top section of the IsUserValidScope step, to the right of the VerifyUser step.

    In steps 11 through 24, you configure this step to decide between two possible outcomes: the user is valid or the user is not valid.

  11. In the Property Editor, change the Name to IsUserValid, and then press the Tab key.
  12. Right-click the IsUserValid step, and then select Insert New Branch.
  13. On the General tab of the Property Editor, change the Name to Yes.
  14. On the Options tab, in the Rule section, enter the following expression using the expression editor: VerifyUser.IsUserValidResponse.return.

    See About the Expression Editor.

  15. In the Step Palette, drag a Calculate step onto the orchestration workflow editor, and drop it onto the Yes branch.
  16. On the General tab of the Property Editor, change the Name to CreateValidUserMessage.
  17. On the Options tab, in the Target section, enter the following using the expression editor: Message.
  18. In the Expression section, type: "This user is valid."

    Be sure to include the quotation marks.

  19. Select the Otherwise branch.
  20. On the General tab of the Property Editor, change the Name to No, and then press the Tab key.
  21. In the Step Palette, drag a Calculate step onto the orchestration workflow editor, and drop it onto the No branch.
  22. On the General tab of the Property Editor, change the Name to CreateInvalidUserMessage.
  23. On the Options tab, in the Target section, enter the following using the expression editor: Message
  24. In the Expression section, type "This user is not valid."

    Be sure to include the quotation marks.

  25. Select the End step.
  26. On the Data Mapping tab, under Extension, locate the Description data element, select the corresponding Source elements column, and then click the down arrow.
  27. In the Select a Source popup that opens, under GenericFaultOWF, WorkingData; select Message; and then click OK.
  28. Expand the FaultHandler section of the IsUserValidScope step.
  29. In the Step Palette, drag a Calculate step into the FaultHandler section and drop it onto the CatchAll branch.
  30. On the General tab of the Property Editor, change the Name to CreateUnknownErrorMessage.
  31. On the Options tab, in the Target section, enter the following using the expression editor: Message.
  32. In the Expression section, type "An unknown error occurred at GenericFaultAWF_GenericFaultOWF_VerifyUser."

    Be sure to include the quotation marks.

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

    The following two warning messages appear in the Validation Results:

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

      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.

  34. Publish and deploy the FaultHandlingProcApp.

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

  35. Turn on debug logging as follows:
    1. On the Home tab of the Ribbon, in the Common Views group, select the Common Log Viewer check box.
    2. On the Overview tab of the Common Log Viewer, right-click FaultHandlingApp, and then select Debug Logging.
    3. Right-click FaultHandlingOrch, and then select Debug Logging.

Related Topics

Using the Service Step

Using the Decision Step

Using the Calculate Step

Tutorial: Running the GenericFaultAWF Project

Tutorial: Altering the GenericFaultOWF to Return a Web Service Fault

Tutorial: Running the GenericFaultAWF Project and Invoking the CatchAll Branch