Table of Contents

Search

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

Taskflows

Taskflows

Rules and guidelines for Notification Task step

Rules and guidelines for Notification Task step

Certain restrictions apply when you use the
Content
option to specify the email body and the
HTML
option to specify the email content type in a Notification Task step.
Consider the following guidelines:
  • If you use HTML content, you may not receive a valid formatted email. You must use a variable to define the HTML content and serialize the variable in the Expression Editor.
    For example, if the HTML content is as follows:
    <html> Order {$output.OrderID} has been submitted for {$input.CustomerEmail}. <br/> <b>Order details for your records.</b> <br/><br/> Item Cost: {$temp.InventoryDetails[1]/ItemCostPrice} Item Count: {$temp.InventoryDetails[1]/ItemCount } Item Sell Price: {$temp.InventoryDetails[1]/ItemSellingPrice } Commission Percentage: {$temp.InventoryDetails[1]/SalesCommissionInPercentage } <br/><br/> <b>Margins</b> Overall Profit: {$output.Calculate_Margin_ServiceResponse[1]/MarginBeforeCommission} Sales Commission: {$output.Calculate_Margin_ServiceResponse[1]/SalesCommission} Profit after Commission: {$output.Calculate_Margin_ServiceResponse[1]/MarginAfterCommission} </html>
    Use the following content in the Expression Editor to define a variable for the HTML content and serialize the variable to receive a valid formatted email:
    let $doc := <html> Order {$output.OrderID} has been submitted for {$input.CustomerEmail}. <br/> <b>Order details for your records.</b> <br/><br/> Item Cost: {$temp.InventoryDetails[1]/ItemCostPrice} Item Count: {$temp.InventoryDetails[1]/ItemCount } Item Sell Price: {$temp.InventoryDetails[1]/ItemSellingPrice } Commission Percentage: {$temp.InventoryDetails[1]/SalesCommissionInPercentage } <br/><br/> <b>Margins</b> Overall Profit: {$output.Calculate_Margin_ServiceResponse[1]/MarginBeforeCommission} Sales Commission: {$output.Calculate_Margin_ServiceResponse[1]/SalesCommission} Profit after Commission: {$output.Calculate_Margin_ServiceResponse[1]/MarginAfterCommission} </html> return serialize($doc)
  • If the HTML content contains valid XML, use the XQuery function
    util:toXML
    in the Expression Editor to serialize the content into the String format.
    For example, if the HTML content is as follows:
    <html> <head>TaskDetails</head> <body> <table> <tbody> <tr> <td>Task Name</td> <td>Job Id</td> <td>Status</td> <td>Start Time</td> <td>End Time</td> </tr> <tr> <td>Williams</td> <td>John</td> <td>{fn:current-date()}</td> </tr> </tbody> </table> </body> </html>
    Use the following content in the Expression Editor to serialize the content into the String format:
    util:toXML(<html> <head>TaskDetails</head> <body> <table> <tbody> <tr> <td>Task Name</td> <td>Job Id</td> <td>Status</td> <td>Start Time</td> <td>End Time</td> </tr> <tr> <td>Williams</td> <td>John</td> <td>{fn:current-date()}</td> </tr> </tbody> </table> </body> </html>)
  • If the HTML content does not contain valid XML, you must convert the HTML content to valid XML. Sometimes even if the HTML content contains valid XML, you do not receive a valid formatted email. In this case, you must use the String Concat function.
    For example, if the HTML content is as follows:
    <html> <table> <tr> <th>Task Property</th> <th>Property Value</th> </tr> <tr> <td>Task Name</td> <td>{$temp.DataTask1[1]/output[1]/Object_Name}</td> </tr> <tr> <td>Task Status</td> <td>{$temp.DataTask1[1]/output[1]/Task_Status}</td> </tr> <tr> <td>Error Message</td> <td>{$temp.DataTask1[1]/output[1]/Error_Message}</td> </tr> </table> </html>
    Use the following content in the Expression Editor with the String Concat function to send a valid formatted email:
    fn:concat(fn:concat(fn:concat(fn:concat(fn:concat("Task Details: <br/><br/>",$temp.DataTask1[1]/output[1]/Object_Name), "<br/><br/>"), $temp.DataTask1[1]/output[1]/Task_Status), "<br/><br/>"), $temp.DataTask1[1]/output[1]/Error_Message)
  • If the HTML content does not contain valid XML, you must either convert the HTML content to valid XML or use the String Concat function with an escape character.
    The following example shows how to use the String Concat function with an escape character:
    fn:concat("&lt;html&gt;
    &lt;head&gt;TaskDetails&lt;/head&gt;
    &lt;body&gt;
    &lt;table&gt;
    &lt;tbody&gt;
    &lt;tr&gt;
    &lt;td&gt;Task Name&lt;/td&gt;
    &lt;td&gt;Job Id&lt;/td&gt;
    &lt;td&gt;Status&lt;/td&gt;
    &lt;td&gt;Start Time&lt;/td&gt;
    &lt;td&gt;End Time&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td&gt;Williams&lt;/td&gt;
    &lt;td&gt;John&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;/body&gt;
    &lt;/html&gt;","")

0 COMMENTS

We’d like to hear from you!