User Guide - Informatica

Alerting Operators about Workflows that have
Completed with Errors
© 2008 Informatica Corporation
Overview
The error threshold that you set for a PowerCenter workflow determines whether the workflow fails or succeeds when it
encounters non-fatal errors. If the number of non-fatal errors exceeds the error threshold, the workflow fails and does
not process the remaining source rows. If the number of non-fatal errors does not exceed the error threshold, the
workflow succeeds and the workflow operator is not informed of these errors.
You can configure workflows that encounter non-fatal errors to perform the following actions:
y
Send the operator an email containing the workflow name and a list of sessions that encountered non-fatal errors.
y
Fail after the Integration Service loads all successfully processed rows to the target.
This article describes how to configure a workflow that contains multiple sessions and a workflow that contains multiple
worklets to alert operators about workflows that have completed with non-fatal errors. The article also describes how to
use a parameter file to override the list of email recipients configured in the workflow.
The sample workflows described in this article include the following components:
y
A user-defined workflow variable that captures the name of each session that encounters row errors.
y
An Assignment task that assigns each session name to the workflow variable if the predefined task-specific
variables SrcFailedRows, TgtFailedRows, or TotalTransErrors contain values.
y
An Email task that sends an email if the workflow variable contains a session name.
y
A Control task that fails the workflow if the workflow variable contains a session name.
Configuring a Workflow that Contains Multiple Sessions
In this example, a workflow contains sessions named s_test_mapping1 and s_test_mapping2. The workflow has a
user-defined variable named $$session_list. The Assignment task assigns a session name to the workflow variable
$$session_list if the session encounters non-fatal errors. If the workflow variable $$session_list contains a session
name, the Email task sends an email and then the Control task fails the workflow.
The following figure displays this sample workflow:
To configure a workflow containing multiple sessions to send an email for non-fatal errors:
1.
In the Workflow Designer, edit the workflow to define a workflow variable of the datatype nstring that captures the
name of each session encountering a non-fatal error.
For example, declare a variable named $$session_list.
2.
Create an Assignment task.
3.
Edit the Assignment task and choose to treat the input links as an AND link in the General tab.
4.
On the Expressions tab, select the workflow variable you defined in step 1.
For example, select $$session_list.
5.
Enter the following expression for the variable:
iif($<session_n>.SrcFailedRows + $<session_n>.TgtFailedRows
$<session_n>.TotalTransErrors > 0, '<session_n>’,'')
||
...
2
+
where <session_n> is the name of each session in the workflow.
For example:
iif($<s_test_mapping1>.SrcFailedRows
$<s_test_mapping1>.TotalTransErrors >
||
iif($<s_test_mapping2>.SrcFailedRows
$<s_test_mapping2>.TotalTransErrors >
+ $<s_test_mapping1>.TgtFailedRows
0, '<s_test_mapping1>’,'')
+
+ $<s_test_mapping2>.TgtFailedRows
0, '<s_test_mapping2>’,'')
+
6.
Link the last Session task to the Assignment task.
7.
Create an Email task.
8.
Edit the Email task and enter values for the following attributes in the Properties tab:
3
Attribute
Value
Email User Name
Fully qualified email address of the mail recipient. You can also use a parameter file to override the
email address. See Using a Parameter File to Specify Email Recipients.
Email Subject
Subject of the email. For example: Workflow <Workflow_Name> failed
Email Text
Enter text and the workflow variable containing the list of session names with errors. For example:
Sessions $$session_list have failed rows.
9.
Link the Assignment task to the Email task.
10. Add a link condition from the Assignment task to the Email task containing the following expression:
$$session_list != ''
11. Create a Control task.
12. Edit the Control task so that it fails the top-level workflow.
13. Link the Email task to the Control task.
Configuring a Workflow that Contains Multiple Worklets
In this example, a workflow contains worklets named wl_worklet1 and wl_worklet2. Both worklets include one or more
sessions, a user-defined variable named $$worklet1_session_list or $$worklet2_session_list, and an Assignment task.
The Assignment task assigns a session name to the worklet variable if the session encounters non-fatal errors.
The following figure displays the sample worklet wl_worklet1:
The following figure displays the sample worklet wl_worklet2:
The workflow contains the following user-defined variables:
y
$$session_list_from_worklet1. Passes the value of the $$worklet1_session_list variable to the workflow.
y
$$session_list_from_worklet2. Passes the value of the $$worklet2_session_list variable to the workflow.
y
$$session_list. Contains the values of $$session_list_from_worklet1 and $$session_list_from_worklet2.
4
The Assignment task in the workflow concatenates the values of $$session_list_from_worklet1 and
$$session_list_from_worklet2 and assigns the value to the $$session_list workflow variable. If the workflow variable
$$session_list contains a session name, the Email task sends an email and then the Control task fails the workflow.
The following figure displays the sample workflow:
To configure a workflow containing multiple worklets to send an email for non-fatal errors:
1.
In the Worklet Designer, edit a worklet to define a worklet variable of the datatype nstring that captures the name
of each session encountering a non-fatal error.
For example, declare a variable named $$worklet1_session_list.
2.
Create an Assignment task in the worklet.
3.
Edit the Assignment task and choose to treat the input links as an AND link in the General tab.
4.
On the Expressions tab, select the worklet variable you defined in step 1.
For example, select $$worklet1_session_list.
5.
Enter the following expression for the variable:
iif($<session_n>.SrcFailedRows + $<session_n>.TgtFailedRows
$<session_n>.TotalTransErrors > 0, '<session_n>’,'')
||
...
+
where <session_n> is the name of each session in the worklet.
For example:
iif($<s_test_mapping1>.SrcFailedRows
$<s_test_mapping1>.TotalTransErrors >
||
iif($<s_test_mapping2>.SrcFailedRows
$<s_test_mapping2>.TotalTransErrors >
+ $<s_test_mapping1>.TgtFailedRows
0, '<s_test_mapping1>’,'')
+
+ $<s_test_mapping2>.TgtFailedRows
0, '<s_test_mapping2>’,'')
+
6.
Link all Session tasks to the Assignment task.
7.
Repeat steps 1 to 6 to configure the additional worklets in the workflow.
5
8.
In the Workflow Designer, edit the workflow to define the following workflow variables of the datatype nstring:
-
Workflow variables that capture each worklet variable value
-
Workflow variable that contains the concatenated values of the remaining workflow variables
For example, define the following workflow variables:
9.
-
$$session_list_from_worklet1
-
$$session_list_from_worklet2
-
$$session_list
In the Workflow Designer, edit each worklet to assign the appropriate parent workflow variable to the user-defined
worklet variable.
For example, edit worklet wl_worklet1 to assign the parent workflow variable $$session_list_from_worklet1 to the
worklet variable $$worklet1_session_list.
10. Create an Assignment task.
11. On the Expressions tab, select the workflow variable you created in step 8 to contain the concatenated list of
session names.
For example, select $$session_list.
12. Enter the following expression for the variable to concatenate the session names containing non-fatal errors found
in each worklet:
<parent_workflow_variable1> || <parent_workflow_variable2>
For example:
$$session_list_from_worklet1 || $$session_list_from_worklet2
13. Link the last worklet to the Assignment task.
14. Create an Email task.
6
15. Edit the Email task and enter values for the following attributes in the Properties tab:
Attribute
Value
Email User Name
Fully qualified email address of the mail recipient. You can also use a parameter file to override the
email address. See Using a Parameter File to Specify Email Recipients.
Email Subject
Subject of the email. For example:
Workflow <Workflow_Name> failed
Email Text
Enter text and the workflow variable containing the list of session names with errors. For example:
Sessions $$session_list have failed rows.
16. Link the Assignment task to the Email task.
17. Add a link condition from the Assignment task to the Email task containing the following expression:
$$session_list != ''
18. Create a Control task.
19. Edit the Control task so that it fails the top-level workflow.
7
20. Link the Email task to the Control task.
Using a Parameter File to Specify Email Recipients
You can define the service variable $PMFailureEmailUser in a workflow parameter file to override the list of email
recipients without editing the Email task in the workflow. You might want to define the service variable in a parameter
file for the following reasons:
y
Specify different email recipients. Set $PMFailureEmailUser in the workflow parameter file to a different list of
email recipients. The Integration Service sends the email to the list of recipients configured in the parameter file
instead of the list configured in the Email task.
y
Disable sending an email for the workflow. Set $PMFailureEmailUser in the workflow parameter file to a blank
value. The Integration Service does not send an email if the workflow encounters non-fatal errors.
Author
Ratish T. Neelakandan
Consultant, Informatica Professional Services, India
8