In this exercise, you use a
Scope step in the
NamedFaultOWF2 orchestration workflow and you
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. NamedFaultOWF2
To automatically add Catch branches for named Web
service faults:
-
Under
Orchestration Workflows, click
NamedFaultOWF2.
-
Create a working data element of type String to hold the message
that is passed to the
Description field as follows:
-
Click a blank area of the orchestration workflow editor.
-
On the
Data Mapping tab of the Property Editor,
under
NamedFaultOWF2, right-click
Working Data, select
Add New, and then select
String.
-
Change the name of the new data element
(String) to
Message.
-
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.
-
Change the name of the
Scope step to
GetBuyRatingScope, and then press the Tab key.
-
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
GetBuyRatingScope step.
-
On the
General tab of the Property Editor, change the
Name to
GetBuyRating.
-
From the
Operation menu, select
GetBuyRating.
-
On the
Data Mapping tab, locate the
symbol data element, select the corresponding
cell in the
Source elements column, and then click the
down arrow.
-
In the
Select a Source popup that opens, under
NamedFaultOWF2,
Inputs,
EventNoticeWithReply,
Extension; select
Title; and then click
OK.
-
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
GetBuyRatingScope step, to the right of the
GetBuyRating step.
-
On the
General tab of the Property Editor, change the
Name to
ReturnBuyRating.
-
On the
Options tab, in the
Target section, enter the following using the
expression editor:
Message.
See
About the Expression Editor.
-
In the
Expression section, enter the following
expression using the expression editor:
GetBuyRating.GetBuyRatingResponse.GetBuyRatingResult.
-
Select the
End 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 popup that opens, under
NamedFaultOWF2,
WorkingData; select
Message; and then click
OK.
-
Expand the
FaultHandler section of the
GetBuyRatingScope step.
-
In the top section of the
GetBuyRatingScope step, right-click the
GetBuyRating step, and then select
Add Catch Branches to GetBuyRatingScope.
SBM Composer scans the
SerenaSampleTickerService WSDL for any named
faults defined for the
GetBuyRating operation and adds the
following three
Catch branches to the
FaultHandler section:
CatchUnknownTickerSymbolFault,
CatchInvalidInputFault, and
CatchGetBuyRatingFault.
Note: If the Web service operation does not return any named faults,
the
Add Catch Branches to Scope option is not
available.
-
Select each
Catch branch, and note on the
General tab of the Property Editor that the
Fault name and
Fault message are automatically configured.
-
In the
New Items section of the
Step Palette, drag a
Calculate step into the
FaultHandler section, and drop it onto the
CatchUnknownTickerSymbolFault branch.
-
On the
General tab of the Property Editor, change the
Name to
ReturnUnknownTickerSymbolFault.
-
On the
Options tab, in the
Target section, enter the following using the
expression editor:
Message
-
In the
Expression section, enter the following
expression using the expression editor:
CatchUnknownTickerSymbolFault\UnknownTickerSymbolFault\detail
You can use
errorCode rather than
detail if you specified a decision based on
the error code.
Note: For this step, you must first type
CatchUnknownTickerSymbolFault 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.
-
In the
New Items section of the
Step Palette, drag a
Calculate step into the
FaultHandler section, and drop it onto the
CatchInvalidInputFault branch.
-
On the
General tab of the Property Editor, change the
Name to
ReturnInvalidInputFault.
-
On the
Options tab, in the
Target section, enter the following using the
expression editor:
Message.
-
In the
Expression section, enter the following
expression using the expression editor:
CatchInvalidInputFault\InvalidInputFault.
Note: For this step, you must first type
CatchInvalidInputFault followed by a period.
Then you can use the expression editor to complete the expression.
-
In the
New Items section of the
Step Palette, drag a
Calculate step into the
FaultHandler section, and drop it onto the
CatchGetBuyRatingFault branch.
-
On the
General tab of the Property Editor, change the
Name to
ReturnGetBuyRatingFault.
-
On the
Options tab, in the
Target section, enter the following using the
expression editor:
Message.
-
In the
Expression section, enter the following
expression using the expression editor:
CatchGetBuyRatingFault\GetBuyRatingFault\detail.
You can use
errorCode rather than
detail if you created a system that
correlates the message detail with the error code.
Note: For this step, you must first type
CatchGetBuyRatingFault 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.
-
In the
New Items section of the
Step Palette, drag a
Calculate step into the
FaultHandler section of the
GetBuyRatingScope step, and drop it onto the
CatchAll branch.
-
On the
General tab of the
Property Editor, change the
Name to
CreateUnknownErrorMessage.
-
On the
Options tab, in the
Target section, enter the following using the
expression editor:
Message.
-
In the
Expression section, type:
"An unknown error occurred at
NamedFaultAWF_NamedFaultOWF2_GetBuyRating"
Be sure to include the quotation marks.
-
On the Quick Access Toolbar, click the
Validate button.
The following warning messages appear
in the Validation Results:
-
The required DefaultElement
'NamedFaultOWF2\Message' is not mapped or defaulted in
'NamedFaultOWF2'
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.
- The required DataElement
'GetBuyRating\GetBuyRating\type' is not mapped or defaulted in
'NamedFaultOWF2
You can ignore this message.
-
Publish and deploy the
FaultHandlingProcApp.
See
Step 6: Publish the Process App and
Step 7: Deploy the Process App for instructions.