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
To use the Throw step in an orchestration workflow
that throw custom and named faults:
-
In App Explorer, under
Orchestration Workflows, click
ThrowOWF.
-
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.
-
On the
General tab of the Property Editor, change the
Name to
IsCompanyBluejay.
-
Right-click the
IsCompanyBluejay step, and then select
Insert New Branch.
-
On the
General tab of the Property Editor, change the
Name to
IsBluejay.
-
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.
-
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.
-
On the
General tab of the Property Editor, change the
Name to
ReportBluejay, and then press the Tab key.
-
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.
-
Locate the
FaultString data element, and enter the
following in the corresponding
Default value column:
Bluejay Bird Supply is a credit risk.
-
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.
-
On the
General tab of the Property Editor, change the
Name to
GetTickerSymbolScope.
-
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).
-
On the
General tab of the Property Editor, change the
Name to
GetTickerSymbol.
-
On the
Operation menu, select
GetTickerSymbol.
-
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.
-
In the
Select a Source tool that opens, under
ThrowOWF,
Inputs,
EventNoticeWithReply,
Extension; select
Title; and then click
OK.
-
Expand the
FaultHandler section.
-
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.
-
On the
General tab of the Property Editor for the
Catch branch, change the
Name to
GetTickerSymbolFault.
-
Select
SerenaSampleTickerService-GetTickerSymbolFault
on the
Fault Name menu.
SerenaSampleTickerService-GetTickerSymbolFault
is automatically inserted in the
Fault message box and is read-only.
-
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.
-
On the
General tab of the Property Editor, change the
Name to
ReturnGetTickerSymbolFault.
-
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.
-
Locate the
FaultString data element, select the
corresponding cell in the
Source elements column, and then click the
down arrow.
-
In the
Select a Source tool that opens, under
ThrowOWF,
GetTickerSymbolFault,
Outputs,
GetTickerSymbolFault; select
detail; and then click
OK.
-
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.
-
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.
-
In the
Select a Source tool that opens, under
GetTickerSymbol,
Outputs,
GetTickerSymbolResponse; select
GetTickerSymbolResult; and then click
OK.
-
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.
-
Publish and deploy the
FaultHandlingProcApp.
See
Step 6: Publish the Process App and
Step 7: Deploy the Process App for instructions.