Table of Contents

Search

  1. Preface
  2. Taskflows and linear taskflows
  3. Taskflows
  4. Linear taskflows

Taskflows

Taskflows

Email notification examples

Email notification examples

You can define the content of the email body based on the number of data tasks in the taskflow to send an email notification with HTML content.

Single data task

When you use the Notification Task step for a single data task, you can enter the data task details in the email body with the source type as content.
For example, you might pass the following XQuery expression:
Hi, Data task with Run Id { $temp.DataTask1[1]/output[1]/Run_Id } started at { $temp.DataTask1[1]/output[1]/Start_Time } and completed at { $temp.DataTask1[1]/output[1]/End_Time } with a status of { $temp.DataTask1[1]/output[1]/Task_Status }
In the above example, if the data task runs successfully, you will receive the output details in an email notification.
In case the data task fails, you can use the fault fields in the XQuery expression to determine the reason for failure as shown in the following example:
Hi, Data task with Run Id { $temp.DataTask1[1]/fault[1]/detail[1]/errOutputDetail[1]/Run_Id } started at { $temp.DataTask1[1]/fault[1]/detail[1]/errOutputDetail[1]/Start_Time } and completed at { $temp.DataTask1[1]/fault[1]/detail[1]/errOutputDetail[1]/End_Time } with a status of { $temp.DataTask1[1]/fault[1]/detail[1]/errOutputDetail[1]/Task_Status }

Multiple data tasks

When you use the Notification Task step to send an email summary for multiple data tasks, you can use an XQuery expression with the source type as formula.
For example, you might pass the following XQuery expression for a taskflow that contains two data tasks named <DataTask1> and <DataTask2>:
util:toXML(<html> <head><h3>Taskflow Tasks Status Summary</h3></head> <body> <table> <tr> <th>Task Name</th> <th>Job Id</th> <th>Status</th> <th>Start Time</th> <th>End Time</th> </tr> {   let $dataTasks := ($temp.DataTask1, $temp.DataTask2) for $dataTask in $dataTasks return <tr> <td>{ local-name($dataTask) }</td> <td>{ $dataTask[1]/output[1]/Run_Id }</td> <td>{ $dataTask[1]/output[1]/Task_Status }</td> <td>{ $dataTask[1]/output[1]/Start_Time }</td> <td>{ $dataTask[1]/output[1]/End_Time }</td> </tr> } </table> </body> </html>)
In the above example, if the data task runs successfully, you will receive the output details in an email notification.
In case of failed data tasks, you can use the fault fields in the XQuery expression to determine the reason for failure as shown in the following example:
util:toXML(<html> <head><h3>Taskflow Tasks Status Summary</h3></head> <body> <table> <tr> <th>Task Name</th> <th>Job Id</th> <th>Status</th> <th>Start Time</th> <th>End Time</th> </tr> { let $dataTasks := ($temp.DataTask1, $temp.DataTask2) for $dataTask in $dataTasks return <tr> <td>{ local-name($dataTask) }</td> <td>{ $dataTask[1]/fault[1]/detail[1]/errOutputDetail[1]/Run_Id }</td> <td>{ $dataTask[1]/fault[1]/detail[1]/errOutputDetail[1]/Task_Status }</td> <td>{ $dataTask[1]/fault[1]/detail[1]/errOutputDetail[1]/Start_Time }</td> <td>{ $dataTask[1]/fault[1]/detail[1]/errOutputDetail[1]/End_Time }</td> </tr> } </table> </body> </html>)
Before sending an email notification, you might want to convert the timezone based on the recipient's location. To do this, you can use the
infa:format
XQuery function in the email subject or email body. For more information about converting the timezone using a formula, see the following community article:

0 COMMENTS

We’d like to hear from you!
Ankita Sahoo - November 08, 2023

What is the 

 

sff:getTaskStatus() is it a informatica function?

Informatica Documentation Team - November 09, 2023

Hi Ankita Sahoo,

We’re working to address your comments and will get back to you.

Thanks,

Informatica Documentation team


Informatica Documentation Team - January 23, 2024

Hi Ankita,
We’re happy to let you know that we addressed your feedback in the documentation. 

The technical team confirmed that the sff:getTaskStatus() function is not an Informatica-supported function. The sff:getTaskStatus() function has been removed and the example is updated to successfully receive the output details in an email notification. 
Thanks,
Informatica Documentation team


Ankita Sahoo - November 08, 2023

The Multiple task example doesnot create a table in the notification

Informatica Documentation Team - November 09, 2023

Hi Ankita Sahoo,

We’re working to address your comments and will get back to you.

Thanks,

Informatica Documentation team


Informatica Documentation Team - January 23, 2024

Hi Ankita,
We’re happy to let you know that we addressed your feedback in the documentation. 
The Multiple data tasks example has been updated to successfully receive the output details in an email notification. 
Thanks,
Informatica Documentation team