SDI April2023 Taskflows en
SDI April2023 Taskflows en
April 2023
Taskflows
Informatica Data Integration - Free & PayGo Taskflows
April 2023
© Copyright Informatica LLC 2022, 2023
This software and documentation are provided only under a separate license agreement containing restrictions on use and disclosure. No part of this document may be
reproduced or transmitted in any form, by any means (electronic, photocopying, recording or otherwise) without prior consent of Informatica LLC.
U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial
computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such,
the use, duplication, disclosure, modification, and adaptation is subject to the restrictions and license terms set forth in the applicable Government contract, and, to the
extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License.
Informatica, Informatica Cloud, Informatica Intelligent Cloud Services, PowerCenter, PowerExchange, and the Informatica logo are trademarks or registered trademarks
of Informatica LLC in the United States and many jurisdictions throughout the world. A current list of Informatica trademarks is available on the web at https://
www.informatica.com/trademarks.html. Other company and product names may be trade names or trademarks of their respective owners.
Portions of this software and/or documentation are subject to copyright held by third parties. Required third party notices are included with the product.
The information in this documentation is subject to change without notice. If you find any problems in this documentation, report them to us at
infa_documentation@informatica.com.
Informatica products are warranted according to the terms and conditions of the agreements under which they are provided. INFORMATICA PROVIDES THE
INFORMATION IN THIS DOCUMENT "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING WITHOUT ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT.
Chapter 1: Taskflows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Table of Contents 3
Subtaskflow step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Decision step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Parallel Paths step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Jump step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
End step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Wait step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Throw step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Throw step properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
4 Table of Contents
Chapter 9: Using the Validation panel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Table of Contents 5
Preface
Use Taskflows to learn how to set up dynamic taskflows to run Data Integration tasks in a specific order at
the designated time.
Informatica Resources
Informatica provides you with a range of product resources through the Informatica Network and other online
portals. Use the resources to get the most from your Informatica products and solutions and to learn from
other Informatica users and subject matter experts.
Informatica Documentation
Use the Informatica Documentation Portal to explore an extensive library of documentation for current and
recent product releases. To explore the Documentation Portal, visit https://docs.informatica.com.
If you have questions, comments, or ideas about the product documentation, contact the Informatica
Documentation team at infa_documentation@informatica.com.
https://network.informatica.com/community/informatica-network/products/cloud-integration
Developers can learn more and share tips at the Cloud Developer community:
https://network.informatica.com/community/informatica-network/products/cloud-integration/cloud-
developers
https://marketplace.informatica.com/
6
Data Integration connector documentation
You can access documentation for Data Integration Connectors at the Documentation Portal. To explore the
Documentation Portal, visit https://docs.informatica.com.
To search the Knowledge Base, visit https://search.informatica.com. If you have questions, comments, or
ideas about the Knowledge Base, contact the Informatica Knowledge Base team at
KB_Feedback@informatica.com.
Subscribe to the Informatica Intelligent Cloud Services Trust Center to receive upgrade, maintenance, and
incident notifications. The Informatica Intelligent Cloud Services Status page displays the production status
of all the Informatica cloud products. All maintenance updates are posted to this page, and during an outage,
it will have the most current information. To ensure you are notified of updates and outages, you can
subscribe to receive updates for a single component or all Informatica Intelligent Cloud Services
components. Subscribing to all components is the best way to be certain you never miss an update.
For online support, click Submit Support Request in Informatica Intelligent Cloud Services. You can also use
Online Support to log a case. Online Support requires a login. You can request a login at
https://network.informatica.com/welcome.
The telephone numbers for Informatica Global Customer Support are available from the Informatica web site
at https://www.informatica.com/services-and-training/support-services/contact-us.html.
Preface 7
Chapter 1
Taskflows
Use a taskflow to control the execution sequence of a data transfer task or mapping task based on the
output of the previous task.
For example, you want to run two mapping tasks in sequence. However, you do not want to run the second
mapping task as soon as the first task ends if you get a warning on the first mapping task. Instead, you want
to run the second mapping task to run after two hours. You can create a taskflow to orchestrate this
scenario.
Note: Before you create a taskflow, you must have the task that you want to use ready. You cannot create a
task during the taskflow creation process.
You can invoke and run a taskflow from the taskflow designer. You can also run a taskflow on a schedule.
8
Chapter 2
Taskflow steps
Use taskflow steps to add and orchestrate data integration tasks. You can add different types of steps to a
taskflow. To add a step to a taskflow, drag a step from the palette on the left.
Use an Assignment step to set a value for a field. A field is a data holder that carries data around a
taskflow. You can use input fields and temporary fields to set a value for a field.
Input fields provide input when you run the taskflow. The taskflow uses temporary fields internally to
handle data.
Data Task
Use a Data Task step to add a data transfer task or mapping task to a taskflow. You can configure how
the taskflow handles errors and warnings, perform actions based on a schedule, and override runtime
parameters.
Notification Task
You can configure the Notification Task step to send an email notification. For example, you can send an
email notification to inform recipients about the number of success rows and error rows that were
encountered in a Data Task step of a taskflow.
Command Task
Use a Command Task step to run shell scripts or batch commands from multiple script files on the
Secure Agent machine. For example, you can use a command task to move a file, copy a file, zip or unzip
a file, or run clean scripts or SQL scripts as part of a taskflow.
You can use the Command Task outputs to orchestrate subsequent tasks in the taskflow.
Subtaskflow
Use a Subtaskflow step to embed and reuse an existing taskflow. You can configure input fields to
provide input when you run the taskflow. You can also enable fault handling to determine the reason for
a taskflow failure.
Decision
Use a Decision step when you want a taskflow to take different paths based on the value of a specific
field.
Parallel Paths
Use a Parallel Paths step when you want a taskflow to run multiple items at the same time. For example,
you can run three mapping tasks simultaneously. The taskflow runs all items in the Parallel Paths step
and then moves to the next step.
9
Jump
Use a Jump step when you want to jump from one part of the taskflow to another.
Throw
Use a Throw step to catch a fault, return the fault details, and prevent the execution of the subsequent
steps in a taskflow. The Throw step is an interrupting step, which means that if a fault occurs, the Throw
step stops the execution of the taskflow and sets the taskflow status to failed.
Wait
Use a Wait step when you want to pause taskflow execution for a specific duration.
End
Use an End step to define the HTTP status code that must be used when a taskflow completes.
• API Task
• File Watch Task
• Ingestion Task
These steps are not used.
Creating a taskflow
Create a taskflow from scratch or use a taskflow template.
1. In Data Integration, click New > Taskflows > Taskflow > Create.
2. Set general properties, start properties, input fields, and temporary fields for the taskflow. Optionally, add
notes.
3. Add steps to the taskflow.
For example, you can use the Data Task step to add a data transfer task or mapping task. You can use
the Subtaskflow step to embed and reuse an existing taskflow.
4. Validate and save the taskflow. You cannot run a taskflow that is not valid.
Taskflow templates
Use a taskflow template instead of creating a taskflow from scratch. Select from pre-created templates
based on your business needs.
Click New > Taskflows to open the New Asset dialog box.
11
When you select a taskflow template in the New Asset dialog box, the Data Integration page opens with a
copy of the taskflow template.
For example, if you want to run multiple tasks consecutively, use a Sequential Tasks template. After the
consecutive tasks, if you then need the taskflow to pause for a time and then take different paths, add a Wait
step and a Parallel Paths step to the template.
When you modify a taskflow template, you only modify that instance. The template remains unchanged.
Basic
Select Taskflow when you need a basic canvas with a Start step and an End step. You can create and
configure a taskflow that suits your needs.
Parallel Tasks
Select the Parallel Tasks template if your major requirement is to run two or more data integration tasks in
parallel. You start with a taskflow that contains a Start step, a Parallel Paths step, and an End step.
Sequential Tasks
Select the Sequential Tasks template if your major requirement is to run two data integration tasks, one after
the other. You start with a taskflow that contains a Start step, two Data Task steps, and an End step.
You start with a taskflow that contains a Start step, two Data Task steps, a Decision step, and an End step.
Single Task
Select the Single Task template if your major requirement is to run one data integration task on a daily or
weekly schedule, for example. You start with a taskflow that contains a Start step, a Data Task step, and an
End step.
To set taskflow properties, create a taskflow, click the Start step and access the Properties section.
Optionally, click the empty area of the canvas to access the Properties section.
Define the general properties, taskflow binding and access details, input fields, output fields, temporary
fields, advanced properties, and notes for a taskflow.
General properties
You can specify the following general properties for a taskflow:
Property Description
Override API Don't select this option. This opition is not used.
Name
API Name Don't enter an API name. This property is not used.
Location The project and folder in which you want to save the taskflow. Click Select to navigate to a folder.
You must create a project and folder before you create a taskflow. You cannot create a project or
folder from the taskflow creation page.
If the Explore page is currently active and a project or folder is selected, the default location for
the asset is the selected project or folder. Otherwise, the default location is the location of the
most recently saved asset.
Start properties
Don't configure start properties for a taskflow. Taskflow start properties are not used.
14
Input fields
Use the Input Fields section to add fields that a taskflow uses at the beginning of a step.
You can define the input fields that you want to pass when you run a taskflow. You can create input fields of
the following types:
Simple type
Create a simple type field to use common data types such as Checkbox, Date, Date Time, Time, Number,
Integer, or Text.
Custom type
Create a custom type field to use an object that is added to the taskflow.
Enter the following properties for each input field that you create:
Property Description
Type The type of the input field. For example, select Checkbox, Date, Date Time, Time, Number, Integer, or
Text.
You can also add an input field of a simple type or custom type. To do this, select More types, and then
in the Edit Type dialog box, select the Category as Simple Types or Custom Types.
Required Indicates whether the input field is required for the taskflow to run.
Initial Value The value that is assigned to the input field when you start the taskflow execution. You can enter text
or use a formula to set the initial value.
1. On the Explore page, navigate to the taskflow for which you want to create an input field with a custom
type.
2. Add steps to the taskflow. For example, add a Data Task step.
3. Click the Start step of the taskflow.
4. Click the Input Fields tab.
5. Click the Add icon.
6. In the Type column, select More types.
The Edit Type dialog box appears.
The following image shows the Edit Type dialog box:
Input fields 15
7. From the Category list, select Custom Types.
A list of objects available in the taskflow appears in the Types section.
8. Select the object that you want to pass as an input and click OK.
Output fields
Use the Output Fields section to add output fields to a taskflow.
You can use the output fields of a subtaskflow as variables in the subsequent steps of the parent taskflow.
However, if the subtaskflow fails, the output field values of the subtaskflow are not sent to the parent
taskflow. When you run the parent taskflow, you can view the output fields of the Subtaskflow step on the My
Jobs page in Data Integration, and the All Jobs page and Running Jobs page in Monitor.
Simple type
Create a simple type field to use common data types such as Checkbox, Date, Date Time, Time, Number,
Integer, or Text.
Custom type
Create a custom type field to use an object that is added to the taskflow.
Property Description
Type The type of the output field. For example, select Checkbox, Date, Date Time, Time, Number, Integer, or
Text.
You can also add an output field of a simple type or custom type. To do this, select More types, and
then in the Edit Type dialog box, select the Category as Simple Types or Custom Types.
Temporary fields
Create temporary fields for use in a taskflow step. A taskflow uses temporary fields internally. Temporary
fields do not appear in the input or output of a taskflow.
For example, you might define temporary fields if the taskflow has a Decision step.
Property Description
Type The type of the temporary field. For example, select Checkbox, Date, Date Time, Time, Number, Integer,
or Text.
You can also add a temporary field of a simple type or custom type. To do this, select More types, and
then in the Edit Type dialog box, select the Category as Simple Types or Custom Types.
Initial Value The value that is assigned to the temporary field when you start the taskflow execution. The value can
change during the taskflow run. You can use text or a formula to set the initial value for a temporary
field.
Some temporary fields appear without you specifically adding them. When you add a task to a taskflow, a
corresponding temporary field appears. The Name of the temporary field is the name of the Data Task step.
The Type of the temporary field is the name of the task you add to the Data Task step. Enter a Description
and select Required, if needed.
If you included a Data Task step in a taskflow, the Data Task fields appear on the Temp Fields tab of the Start
step. The Data Task fields represent the input parameters of the task.
Temporary fields 17
Advanced properties
You can configure a taskflow to disable concurrent execution. You can also configure a taskflow to suspend
on a fault at the taskflow level and send an email notification to specified recipients when it is suspended.
Property Description
Suspend on Fault Suspends the taskflow on a fault that occurs at the taskflow level.
The Suspend on Fault property takes precedence over the following properties that you define in a
Data Task step:
- Fail taskflow on completion - if this task fails
- Fail taskflow on completion - if this task does not run
Send Email on Sends an email notification when the taskflow is suspended on a fault.
Suspension When you select the Send Email on Suspension option, the Email To, Email Cc, Email Subject, and
Email Body fields become available.
Email To Defines the primary recipients for the email notification. Enter one or more valid recipient email
addresses. Separate email addresses with a comma (,) or a semicolon (;).
Required if you configure the taskflow to send an email notification on suspension.
Email Cc Defines the recipients who need to be sent a copy of the email notification. Enter one or more
valid recipient email addresses. Separate email addresses with a comma (,) or a semicolon (;).
Email Subject Specifies a short and descriptive subject that introduces the email.
Email Body Defines the content that you want to send in the email.
Click Edit Content to open a rich text editor and use formatting options such as bold, italics,
underlines, lists, indentations, and fonts. You can also insert tables and links.
• When a previous taskflow instance is in a suspended state, even if you run the taskflow again, Data
Integration does not run the taskflow instance.
• When a taskflow instance is running, you can run a previous taskflow instance from a step that ran
successfully using the Run from here option on the My Jobs page in Data Integration, and the All Jobs
and Running Jobs page in Monitor.
• The parent taskflow and subtaskflow run independently. For example, you have a taskflow that contains a
subtaskflow with the Disable concurrent execution option enabled for both the taskflows. When you run
the parent taskflow, the child taskflow runs as a subtask. When you run a taskflow or subtaskflow
independently, it runs for the first time without any issue. However, if you run the same taskflow or
subtaskflow again while the previous instance is still running, an error occurs.
Notes
Use the Notes field to add information that you or other users might need.
The notes that you enter here appear on the Data Integration page. You do not see these notes when you run
the taskflow.
For example, use the Notes field to add a reminder about a task that you need to complete before you run the
taskflow.
Notes 19
Chapter 5
Assignment step
When you add an Assignment step, you can configure the following properties:
Name
The fully qualified field name. The name can contain only alphanumeric characters, underscores (_),
spaces, and Unicode characters.
You select a field name from the list of fields you defined under Start > Fields.
Assignments
The source from which the field takes values. The fields that you see depend on the data type you
defined for the Start > Properties > Input Fields or Temporary Fields.
For example, you define the data type in the Input Fields as Date Time. The following Value options
appear for that field in the Assignment step:
• Specific date
• Time from now
• Days from today
• Days before/after
• Field
• Formula
For information about runtime parameters, see Runtime Parameters in Taskflows on page 45.
20
General
In the general properties, you can specify a descriptive name for the Data Task step.
The name can contain only alphanumeric characters, underscores (_), spaces, and Unicode characters.
Data Task
In the Data Task step properties, select the task from a list of existing tasks that you want to add to the
taskflow.
Note: You must have an existing task to add to a taskflow. You cannot create a task during the taskflow
creation process.
When you add a mapping task to a Data Task step, you see a description, input fields, and output fields. The
input fields show the in-out parameters that the mapping task uses. The output fields show the output fields
that the mapping task returns after the taskflow runs.
When you click the Add icon on the Data Task step, you see one of the following views:
• If the Data Task step contains a task, a non-editable view of the task opens.
• If the Data Task step does not contain a task, you see a dialog box from which you can choose a task.
When you add a task to a Data Task step, a corresponding taskflow temporary field of type Text is created.
When you add a task to the Data Task step, the temporary field type is the name of the task. See “Temporary
fields” on page 17 for details.
Input Fields
The Input Fields section appears when you add a task to the taskflow.
In the Max Wait (Seconds) field, you can configure the maximum length of time in seconds that the Data
Task step waits for the data integration task to complete. Specify a value between 1 and 604800 seconds.
Default is 604800 seconds, which is 7 days. If the task is not completed within the maximum time specified
in the field, the task stops running and the subsequent task in the taskflow starts running.
Note: If the specified value is lesser than 1 or greater than 604800, the maximum wait time is automatically
set to 604800 seconds.
If the task contains parameters that you can override, you can add input fields. You can set properties for an
input field to override Data Integration runtime parameters. For information about runtime parameters, see
“Overriding parameters or parameter files in a Data Task step” on page 46.
If the Data Task step uses a mapping task, you can override the values of input parameters and in-out
parameters of the task.
If the Data Task step uses a mapping task, you can perform the following override actions:
• If the mapping task contains a parameter file available on the Secure Agent machine, you can override the
parameter file directory and parameter file name.
• If the mapping task contains a parameter file available in a cloud-hosted repository, you can override the
parameter file connection and parameter file object. Data Integration supports only the Amazon S3 V2,
Azure Data Lake Store Gen2, and Google Storage V2 connection types for mapping tasks.
• If the mapping task uses data formatting options, you can override the data formatting and default
precision values of the source data. These options are available in the input fields only if the formatting
file is uploaded to the mapping task and not to the mapping. The precision value set in the default
precision field takes precedence over the precision set in the data format field or the mapping task. The
default precision value is applied to all the columns in the formatting file.
• If the mapping task contains a Lookup transformation, you can override the values of the lookup object
and lookup condition.
Output Fields
The Output Fields section is an exhaustive list of output data fields that appear when the task runs.
If you use a data transfer task, you see the following fields:
To view the values of each output field, run the taskflow and go to the Taskflow Instance Detail page. For
more information about the Taskflow Instance Detail page, see Monitor.
For example, create a temporary field with value Formula and use the following expression to assign data to
the field:
if(
($temp.DataTask1[1]/output[1]/Failed_Target_Rows < 0 or
$temp.DataTask1[1]/output[1]/Task_Status = '1')
and
($temp.DataTask2[1]/output[1]/Success_Target_Rows > 0
and $temp.DataTask2[1]/output[1]/Failed_Target_Rows = 0)
and $temp.DataTask3[1]/output[1]/Success_Target_Rows > 0)
then 'Pass'
else 'Fail'
When you use the temporary field in a Decision step, the taskflow takes the Pass path if the following
conditions are met:
• Data Task 1 has no failed target rows or Data Task 1 runs successfully.
• Data Task 2 has at least one successful target row.
• Data Task 2 has zero failed target rows.
• Data Task 3 has at least one successful target row.
Use a Timer event to perform an action based on a schedule. The action could be either at a specific time or
after an interval.
When you add a timer to a Data Task step, a new branch appears. Add an event to this branch and specify
whether you want the event to run At a specific time or After an interval.
In the following image, the event on the timer branch, a Data Decision step, occurs five minutes after the
main data task:
When a timer fires, the taskflow always runs through the entire timer branch. If Data Task 1 finishes before
Decision 1, the timer branch is not executed.
Select Interrupting if you want the timer to interrupt the main data task. When you set an interrupting timer,
the main data task is interrupted and the taskflow only runs the event on the timer set.
The following image shows an interrupting timer set to occur five minutes after the main data task starts:
When the event on the timer branch, Data Task 2, executes, Data Task 1 is interrupted. The taskflow follows
the timer branch. That is, the taskflow runs Data Task 2 and then ends.
If you delete the End step on the timer branch of an interrupting timer, the timer branch rejoins the main
branch.
The following image shows an interrupting timer branch with the End step deleted:
The timer event, Data Task 2, executes after 5 minutes and interrupts Data Task 1. The timer branch rejoins
the main branch. The taskflow executes Data Task 2, a Parallel Paths step, and then ends.
If you use an interrupting timer, the main data task has no output with respect to this taskflow instance. You
see no output fields for the main data task in the job details for the taskflow.
Error Handling
Use the Error Handling section to indicate how you want the taskflow to behave when a Data Task step
encounters a warning or an error. You can also configure the taskflow behavior when the task associated
with a Data Task step fails or does not run.
After you select a task, enter the following error handling properties:
Property Description
On Warning The path that a taskflow takes when it encounters a warning in a Data Task step.
A warning occurs when a Data Task step completes incorrectly or incompletely. For example, you see
a warning if the Data Task step copies only 20 out of 25 rows from table A to table B.
You can choose from the following options:
- Select Ignore to ignore the warning and move to the next step.
Note: If you select Ignore for a Data Task step with a subsequent Notification Task step and the
data task fails, the email notification that you receive does not contain the fault details. To get the
fault details in the email, select Custom error handling.
- Select Suspend Taskflow to move the taskflow to the suspended state when it encounters a
warning. You can resume the taskflow instance from the All Jobs, Running Jobs, or My Jobs page.
The taskflow resumes from the step at which it was suspended. If you know the reason for the
warning, correct the issue and then resume the taskflow.
Default: Ignore
On Error The path that a taskflow takes when it encounters an error in a Data Task step.
An error occurs when a Data Task step fails. For example, you see an error if the Data Task does not
copy table A to table B.
You can choose from the following options:
- Select Ignore to ignore the error and move to the next step.
- Select Suspend Taskflow to move the taskflow to the suspended state when it encounters an
error. You can resume the taskflow instance from the All Jobs, Running Jobs, or My Jobs page.
The taskflow resumes from the step at which it was suspended. If you know the reason for the
error, correct the issue and then resume the taskflow.
- Select Custom error handling to handle the error in a manner you choose. If you select Custom
error handling, two branches appear. The first branch is the path the taskflow follows if no error
occurs. The second branch is the custom path the taskflow follows if an error occurs.
Default: Suspend Taskflow
Fail taskflow The taskflow behavior when the task associated with the Data Task step fails or does not run.
on completion You can configure a taskflow to fail on its completion if the task associated with the Data Task step
fails or does not run. If the task fails or does not run, the taskflow continues running the subsequent
steps. However, after the taskflow completes, the taskflow status is set to failed.
Note: If you configure both the Suspend on Fault taskflow advanced property and the Fail taskflow
on completion property, the Suspend on Fault property takes precedence. In this case, if the task
associated with the Data Task step fails or does not run, the taskflow is suspended. The taskflow
does not run the subsequent steps after the Data Task step.
The following image shows a Custom error handling path with an Assignment step and another Data Task
step:
You can configure the Notification Task step to send an email notification. For example, you can send an
email notification to inform recipients about the number of success rows and error rows that were
encountered in a Data Task step of a taskflow.
You can define properties for the Notification Task step to configure the email recipients and email content.
You cannot use distribution lists in the Email To, Email Cc, and Email Bcc fields.
General properties
In the general properties, you can specify a descriptive name for the Notification Task step.
The name can contain only alphanumeric characters, underscores (_), spaces, and Unicode characters.
Notification Method
The value of this field is set to Email by default. You cannot edit this value. The other values are reserved
for future use.
Email To
Use one of the following options to specify the value for this field:
• Content. Enter one or more valid recipient email addresses. Separate email addresses with a comma
(,) or a semicolon (;).
• Field. Select the field that the Taskflow Designer uses to write the email addresses into this field
when this step executes. You can select an input field or a temporary field that was added in any
other step in the taskflow.
• Formula. Open the formula editor to specify a formula that calculates the value for this field.
Default is Content.
Email Cc
• Content. Enter one or more valid recipient email addresses. Separate email addresses with a comma
(,) or a semicolon (;).
• Field. Select the field that the Taskflow Designer uses to write the email addresses into this field
when this step executes. You can select an input field or a temporary field that was added in any
other step in the taskflow.
• Formula. Open the formula editor to specify a formula that calculates the value for this field.
Default is Content.
Email Bcc
The additional recipients who need to be sent a copy of the email notification. The recipients in the Email
To and Email Cc fields will not be able to see the recipients in the Email Bcc field. If the field contains
more than one recipient, the recipients will not be able to see the other recipients in the Email Bcc field.
Use one of the following options to specify the value for this field:
• Content. Enter one or more valid recipient email addresses. Separate email addresses with a comma
(,) or a semicolon (;).
• Field. Select the field that the Taskflow Designer uses to write the email addresses into this field
when this step executes. You can select an input field or a temporary field that was added in any
other step in the taskflow.
• Formula. Open the formula editor to specify a formula that calculates the value for this field.
Default is Content.
Email Subject
Use one of the following options to specify the value for this field:
Default is Content.
The type of formatting that you want to use for the email content.
• HTML. Select HTML to use formatting options such as bold, italics, underlines, lists, indentations, and
fonts. You can also insert tables and links.
• Plain Text. Select Plain Text to add regular text without any formatting and special layout option.
Email Body
Default is Content.
If you selected the email content type as HTML, you can click Edit Content to open a rich text editor for
formatting the content.
For example, you might pass the following XQuery expression for a taskflow that contains two data tasks
named <DataTask1> and <DataTask2>:
<html>
<head>Taskflow Tasks Status Summary</head>
<body>
<table>
<tr>
<td>Task Name</td>
<td>Job Id</td>
<td>Status</td>
<td>Start Time</td>
<td>End Time</td>
</tr>
{
let $dataTasks := ($temp.DataTask1, $temp.DataTask2)
for $dataTask in $dataTasks
return
<tr>
<td>{ local-name($dataTask) }</td>
<td>{ $dataTask/Output/RunId }</td>
<td>{ sff:getTaskStatus($dataTask/Output/Status) }</td>
<td>{ $dataTask/Output/StartTime }</td>
<td>{ $dataTask/Output/EndTime }</td>
</tr>
}
</table>
</body>
</html>
https://knowledge.informatica.com/s/article/DOC-19342
• 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>
For example, you can use a command task to move a file, copy a file, zip or unzip a file, or run clean scripts or
SQL scripts as part of a taskflow. You can use the Command Task outputs to orchestrate subsequent tasks
in the taskflow.
To use the Command Task step, you must have the appropriate license.
When you add a Command Task step to a taskflow, you configure the following properties:
General Properties
In the general properties, you can specify a descriptive name for the Command Task step.
Input Fields
You can use the following system variables in the input fields to define the script file name, input argument,
and work directory:
• $PMRootDir
• $PMLookupFileDir
• $PMSessionLogDir
• $PMBadFileDir
• $PMCacheDir
• $PMStorageDir
• $PMSourceFileDir
• $PMExtProcDir
• $PMTempDir
• $PMWorkflowLogDir
These variables are pre-defined for the Data Integration Server service in Administrator. To use the system
variables in the Command Task step, the Common Integration Components and Data Integration Server
services must be enabled and up and running on the Secure Agent.
You can use environment variables in the input fields to define the script file name, input arguments, and
work directory. To use environment variables, the Secure Agent must have the Common Integration
Components service version 14 or later and the command executor package version 140 or later.
When you use multiple script files, you can configure a Command Task step to fail if any script fails.
When you configure one or more scripts in a Command Task step and select this option, if any script
fails, the status of the Command Task step is set to failed and the taskflow does not run further scripts
or the subsequent steps.
When you configure one or more scripts in a Command Task step and disable this option, the taskflow
runs all the scripts. If any script fails, the status of the failed script is set to failed and the status of the
Command Task step is set to warning on the All Jobs, Running Jobs, and My Jobs pages. However, Data
Integration treats the Command Task step execution as a success.
Runtime Environment
Required. The runtime environment that runs the command. This selection can be for a runtime
environment or serverless runtime environment.
Use one of the following options to specify the value for this field:
In the Max Wait (Seconds) field, you can configure the maximum length of time in seconds that the
Command Task step waits for the task to complete. Specify a value between 1 and 86400 seconds.
Default is 86400 seconds. If the task is not completed within the maximum time specified in the field,
the task stops running and the subsequent task in the taskflow starts running.
Note: If the specified value is lesser than 1 or greater than 86400, the maximum wait time is
automatically set to 86400 seconds.
Scripts
In a Command Task step, you can add multiple scripts. You can configure a script by specifying the
script file name, input arguments, and work directory.
To add more scripts, click the Add icon from the Scripts panel. If you have multiple scripts in the
command task, you can drag and drop the scripts to reorder the scripts.
To run scripts from different Secure Agent groups, you must add separate Command Task steps for
different runtime environments.
You can view all the scripts in a taskflow instance as subtasks of the command task from the All Jobs,
Running Jobs, or My Jobs page. If a script fails, you can also download the log file to understand the
reason for the script failure.
Required. The path and name of the script file that you want to run.
In a serverless runtime environment, you must put your files in a folder named command_scripts.
This folder can have subfolders. Informatica Intelligent Cloud Services synchronizes files at regular
intervals within the command_scripts directory to the Secure Agent, specifically to the agent install
directory apps/Common_Integration_Components/data/command/serverless/command_scripts. If
you update files in the remote storage location (for example Amazon S3), Informatica Intelligent
Cloud Services automatically synchronizes them to the Secure Agent.
Use one of the following options to specify the value for this field:
• Content. Enter the path to the script that you want to run.
• Field. Select the field that the Taskflow Designer uses to write the script file name into this field
when this step executes. You can select a script file name that was added as an input field,
temporary field, or output field in any other step in the taskflow.
• Formula. Create an expression for the script file.
You can use system variables to define the script file that you want to run.
For example, to run the script.bat file located in the root directory, you can enter the value as
$PMRootDir/script.bat.
You can use an environment variable to define the script file path based on the operating system.
For example, you have a java_script.bat file located in the following directory:
C:\Scripts
You have created an environment variable named ScriptHome for the directory. To run the
java_script.bat file, you can enter the value as %ScriptHome%\java_script.bat for Windows and
$ScriptHome\java_script.bat for Linux.
You can also create an environment variable for the full path including the script file name.
For example, you can log output of a command to a file and copy the file to the mounted directories.
aws s3 ls > log_out.txt
cp log_out.txt /mountDir/logfileName.txt
You can also provide the EFS or NFS mounted directories including the script file name to run the
scripts.
For example, you have an aws_script1.sh file located in the following EFS or NFS directory:
mountDir/scripts
To run the aws_script1.sh file, you can enter the value as /mountDir/scripts/aws_script1.sh.
For more information about EFS and NFS, see Runtime Environments in the Administrator help.
Input Arguments
Optional. The arguments that you want to pass to the script when it is executed.
Use one of the following options to specify the value for this field:
• Content. Enter one or more arguments that you want to pass to the script. Enclose each
argument and values in double quotes (") and separate arguments with a comma (,).
For example, if you want to execute the following command:
./ cli.sh runAJobCli -u <username>-p <password> -bu https://dm-
us.informaticacloud.com/ma -un <sample_value> -t TASKFLOW -w true
Enter the input arguments within double quotes as shown in the following example:
"runAJobCli", "-u", "<username>", "-p", "<password>", "-bu", "https://dm-
us.informaticacloud.com/ma", "-un", "<sample_value>", "-t", "TASKFLOW", "-w",
"true"
You must pass cli.sh in the script name.
• Field. Select the field that the Taskflow Designer uses to write the input arguments into this field
when this step executes. You can select an input argument that was added as an input field,
temporary field, or output field in any other step in the taskflow.
• Formula. Create an expression for the input arguments. Enclose each argument in double quotes
(") and separate arguments with a comma (,).
You can use system variables to define the input arguments that you want to pass to the script
when it is executed. For example, to pass the arguments from the root directory or the temp
directory, enter the following value:
"$PMRootDir","$PMTempDir"
You can use an environment variable to define the input arguments based on the operating
system. For example, you have created an environment variable named ScriptHome for the
following directory:
To pass the arguments from this directory, enter the value as "%ScriptHome%" for Windows and
"$ScriptHome" for Linux.
Work Directory
Optional. The path to the working directory where the output of the script is saved. By default, the
output is saved in the path where the script is saved.
Use one of the following options to specify the value for this field:
• Content. Enter the path to the working directory where you want to save the output of the script.
• Field. Select the field that the Taskflow Designer uses to write the working directory into this
field when this step executes. You can select a work directory that was added as an input field,
temporary field, or output field in any other step in the taskflow.
• Formula. Create an expression for the work directory.
You can use system variables to define the working directory where you want the output of the
script to be saved.
For example, if you want to use the source file directory as the working directory, you can enter the
value as $PMSourceFileDir.
You can use an environment variable to define the working directory based on the operating system.
For example, you created an environment variable named ScriptHome for the following directory:
C:\Scripts
To use this directory as the working directory, you can enter the value as %ScriptHome% for Windows
and $ScriptHome for Linux.
Note: When you use curly brackets {} in the script or in the input fields, you must add an additional set of
curly brackets {{}}. Otherwise, an error occurs. This is because curly brackets are considered as special
characters in XQuery.
Output Fields
When you run a taskflow, the following output fields are generated for the Command Task step:
Start Time Date Time The start time of the command task.
End Time Date Time The end time of the command task.
Exit Code Integer The exit code returned after command task execution. The exit code can have one of
the following values:
- 0. Indicates that the command task was executed successfully.
- 1. Indicates that the command task failed.
Execution Status Text Displays the status of the command task as successful.
To view the values of each output field, run the taskflow and go to the Taskflow Instance Detail page in
Monitor. For more information about the Taskflow Instance Detail page, see Monitor.
Events
Configure the Events properties to add timers to a command task.
Use a Timer event to perform an action based on a schedule. The action could be either at a specific time or
after an interval.
When you add a timer to a Command Task step, a new branch appears. Add an event to this branch and
specify whether you want the event to run At a specific time or After an interval.
In the following image, the event on the timer branch is a Data Decision step (Decision 1) that occurs five
minutes after the main command task (Command Task 1) starts:
1. Main branch
2. Timer branch
In the example, the timer branch runs five minutes after Command Task 1 starts. If Command Task 1 finishes
before Decision 1, the timer branch is not executed.
You can select the Interrupting option if you want the timer to interrupt the main command task.
The following image shows an interrupting timer set to occur five minutes after the main command task
starts:
1. Main branch
2. Timer branch
If Command Task 1 completes before the timer, the taskflow executes only Command Task 1 and ends.
If you delete the End step on the timer branch of an interrupting timer, the timer branch rejoins the main
branch.
The following image shows an interrupting timer branch with the End step deleted:
1. Main branch
2. Timer branch
In the example, Command Task 2 executes after five minutes and interrupts Command Task 1. The timer
branch rejoins the main branch. The taskflow executes Command Task 2, a Decision step, a Parallel Paths
step, and then ends.
If Command Task 1 completes before the timer, the taskflow executes Command Task 1, a Decision step, a
Parallel Paths step, and then ends.
Error Handling
Use the Error Handling tab to indicate how you want the taskflow to behave when a Command Task step
encounters an error. You can also configure the taskflow behavior when the Command Task step fails or
does not run.
After you select a task, configure the following error handling properties:
On Error
The path that a taskflow takes when it encounters an error in a Command Task step.
An error occurs when a Command Task step fails. You can choose from the following options:
• Select Ignore to ignore the error and move to the next step.
Note: If you select Ignore for a Command Task step with a subsequent Notification Task step and the
command task fails, the email notification that you receive does not contain the fault details. To get
the fault details in the email, select Custom error handling.
• Select Suspend Taskflow to move the taskflow to the suspended state when it encounters an error.
You can resume the taskflow instance from the All Jobs, Running Jobs, or My Jobs page.
The taskflow resumes from the step at which it was suspended. If you know the reason for the error,
correct the issue and then resume the taskflow.
• Select Custom error handling to handle the error in a manner you choose. If you select Custom error
handling, two branches appear. The first branch is the path the taskflow follows if no error occurs.
The second branch is the custom path the taskflow follows if an error occurs.
The taskflow behavior when the Command Task step fails or does not run.
If you configure both the Suspend on Fault taskflow advanced property and the Fail taskflow on
completion property, the Suspend on Fault property takes precedence. In this case, if the Command
Task step fails or does not run, the taskflow is suspended. The taskflow does not run the subsequent
steps after the Command Task step.
The following image shows a Custom error handling path with an Assignment step and another Command
Task step:
Fault
The fault fields are displayed only if the command task fails due to a script failure. The details help you
analyze the reason for the fault. You can then take an appropriate action on the faulted command task and
proceed with the execution of the taskflow.
You can add the details in fault fields as parameters to the subsequent steps of the taskflow as shown in the
following image:
If the command task has faulted, you see the following fault details:
Start Time Date Time The start time of the command task.
End Time Date Time The end time of the command task.
Exit Code Integer The exit code returned after the command task execution. The exit code can have
values between 0 and 255. The value 0 indicates that the command task ran
successfully.
A failed command returns a non-zero value. The value can be based on the error type
or pre-configured code in the shell script.
Execution Status Text Displays the status of the command task as failed.
Subtaskflow step
When you add a Subtaskflow step, you can embed and reuse an existing taskflow.
You can use a subtaskflow to reuse the same orchestration flow across multiple branches of a taskflow or
across different taskflows. You can then invoke the taskflow with different sets of parameters. The
subtaskflow is published when you publish its parent taskflow.
When you have a taskflow that contains numerous steps, consider splitting the orchestration logic across
multiple smaller taskflows. You can then simplify the design by using the Subtaskflow step to embed the
smaller taskflows in the parent taskflow. This not only leads to modular design, but also helps with faster
loading when you open the taskflow for editing.
You can define properties for the subtaskflow. The following sections describe the Subtaskflow step
properties:
General properties
In the general properties, you can specify a descriptive name for the Subtaskflow step.
The name can contain only alphanumeric characters, underscores (_), spaces, and Unicode characters.
Subtaskflow properties
On the Subtaskflow tab, select the taskflow that you want to embed. Data Integration displays the location,
description, input fields, and output fields for the embedded taskflow.
Input Fields
The Input Fields section appears when you add a subtaskflow to the taskflow.
If the taskflow contains parameters that you can override, you can add input fields. You can set properties for
an input field to override Data Integration run-time parameters.
Catch faults
Select this option to enable fault handling for the Subtaskflow step.
Default is faultInfo.
Defines the behavior when the subtaskflow associated with the Subtaskflow step fails or does not run.
By default, when the subtaskflow associated with the Subtaskflow step fails, the parent taskflow also
fails.
To configure a taskflow to fail on its completion when the subtaskflow fails, select the Catch faults
option and the If this subtaskflow fails option. To configure a taskflow to fail on its completion when the
subtaskflow does not run, select the If this subtaskflow does not run option. In these cases, when the
subtaskflow fails or does not run, the taskflow continues running the subsequent steps. However, after
the taskflow completes, the taskflow status is set to failed.
Note: If you configure both the Suspend on Fault taskflow advanced property and the Fail taskflow on
completion property, the Suspend on Fault property takes precedence. In this case, if the subtaskflow
associated with the Subtaskflow step fails or does not run, the taskflow is suspended. The taskflow
does not run the subsequent steps after the Subtaskflow step.
Decision step
When you add a Decision step, you set some properties.
Name
The name of the Decision step. The name can contain only alphanumeric characters, underscores (_),
spaces, and Unicode characters.
Decision
The taskflow takes a decision based on the fields and paths you define here.
Select a field name from the list of fields you define under Start > Fields.
Enter conditions and values that you want the Decision step to base a decision on.
For example, if you select a field of type Simple > Text, the following conditions are available:
• Equals
• Starts With
• Ends With
• Starts with any of
• Contains
You can enter text values against the conditions you select.
You can add multiple conditions to a Decision step. Each condition is a potential data path.
For each path that you add, a corresponding branch appears on the UI. Drag branches to rearrange the
order in which the branches appear on the UI.
Decision step 39
Most Decision steps have an Otherwise path. This path handles execution if no data meets the
conditions in your tests.
Evaluating Paths
A taskflow evaluates conditions based on the criteria you specify. Ensure that you construct paths with non-
intersecting conditions.
For example, you create a Data Decision step with the following paths:
If the integer field for which the Data Decision step was created has a value of 25, the Data Decision step
takes path 1. This is because 25 is less than 100 and path 1 is the first option.
To ensure that the Data Decision step follows the "Field less than or equal to 25" path, re-create the paths
with the following criteria:
Important: The taskflows evaluates conditions in a top-down manner. Ensure that the Otherwise branch is the
last path.
A Decision step can lead to another Decision step. For example, a branch could run if an annual income
exceeds $100,000. The next decision test along the same path could test if the city is Boston, or otherwise.
Using this technique, you use Boolean AND logic because you base the test for the second condition on the
true branch of the first condition. In this example, you use the Decision step to set the condition "Annual
Revenue exceeds $100,000 AND city is Boston".
Similarly, to support Boolean OR logic, you can add a test for the second condition on any branch.
When the Data Task step of a taskflow fails, you can make decisions based on the output fields of the data
task.
You can select the output fields when one of the following conditions are met:
The name of the Parallel Paths step. The name can contain only alphanumeric characters, underscores
(_), spaces, and Unicode characters.
Parallel Paths
You can add multiple steps to each branch. To add steps to a branch, drag and drop a step from the
pallette on the left.
You can run the same mapping task in multiple branches of the Parallel Paths step if the mapping task is
configured to run simultaneously.
When you use the Jump step in conjunction with the Parallel Path step, you can only jump to another
step on the same Parallel Path branch.
Keep in mind the following restrictions when you use the Jump step and the Parallel Path step together:
• If you are in a Parallel Path step, you cannot jump to a step on another branch of the same Parallel
Path step.
• If you are in a Parallel Path step, you cannot jump to any step outside the Parallel Path step.
• If you are outside a Parallel Path step, you cannot jump to any step inside the Parallel Path step.
Jump step
When you add a Jump step, you configure the To field to define the target of the jump. You can select from a
list of available steps.
More than one step can jump to the same target step. To see how many Jump steps have a particular step as
their target, place the cursor over the arrow next to the target step.
When you use the Jump step in conjunction with the Parallel Path step, you can only jump to another step on
the same Parallel Path branch.
Keep in mind the following restrictions when you use the Jump step and the Parallel Path step together:
• If you are in a Parallel Path step, you cannot jump to a step on another branch of the same Parallel Path
step.
• If you are in a Parallel Path step, you cannot jump to any step outside the Parallel Path step.
• If you are outside a Parallel Path step, you cannot jump to any step inside the Parallel Path step.
End step
An End step indicates the end of the taskflow. When execution reaches this step, the taskflow completes.
Name
Jump step 41
Ending Type
The default value is End of Process. You cannot edit this value.
HTTP Status
The HTTP response status code. The default value is 200 OK. You can edit this value.
Wait step
When you add a Wait step, you set some properties.
Name
The name of the Wait step. The name can contain only alphanumeric characters, underscores (_),
spaces, and Unicode characters.
Wait
Properties that determine when and for how long the taskflow pauses.
Use the following criteria to decide if you want the taskflow to pause At a Specific Time or After a wait
period:
• Select At a Specific Time to pause the taskflow at a particular time. Enter the Time you want the
taskflow to pause at, and optionally, a Delay. The Delay value can be an integer or a field that you
define.
For example, set the taskflow to pause at 2:00 am after three days. 2:00 am is the Time and three
days is the Delay.
• Select After a wait period to pause the taskflow after a period. The period begins when the taskflow
reaches the Wait step. Enter the Wait Period that you want the taskflow to pause for. The Wait Period
value can be an integer or a field that you define.
For example, set the taskflow to pause for one hour from the time that the taskflow reaches the Wait
step.
Throw step
Use a Throw step to catch a fault, return the fault details, stop the execution of the taskflow, and set the
taskflow status to failed.
You can use a Throw step for the following use cases:
You can add a Throw step to the main path of a taskflow to catch faults in a taskflow and return the fault
details. You cannot add a step after the Throw step because the Throw step is an interrupting step. If a
fault occurs, the Throw step stops the execution of the taskflow and sets the taskflow status to failed.
When you enable custom error handling for a taskflow step, you can use a Throw step in the error
handling path to act as a boundary event for the step. A boundary event is an event that catches an error
that occurs within the scope of the step where it is defined.
You can add a Throw step to the error handling path of the following steps because they support custom
error handling:
• Data Task
• Command Task
You can also add a Throw step to the error handling path of a Subtaskflow step if you configure the
Subtaskflow step to catch faults. If the taskflow that is contained within the Subtaskflow step fails, the
parent taskflow also fails. When you view the execution details of the parent taskflow in Monitor, you
can click the Throw step that is associated with the Subtaskflow step to understand why the
subtaskflow failed.
When you add a Throw step to the error handling path, the error handling path breaks off from the main
path of the taskflow. If a fault occurs, the taskflow takes the path that you define for handling the error.
For example, in the error path, you might add a Notification Task step to send an email notification
followed by a Throw step to catch the fault and stop the taskflow execution.
In the error handling path, you cannot add a step after the Throw step because the Throw step is an
interrupting step. If a fault occurs, the Throw step stops the execution of the taskflow and sets the
taskflow status to failed. The subsequent steps in the main path of the taskflow that exist after the step
that is associated with the Throw step are not executed.
Throw step 43
The Subtaskflow step is configured to catch faults. If a fault occurs, an email notification is sent as
configured in the Notification Task step. The Throw step then stops the execution of the taskflow,
returns the fault details specifying why the subtaskflow failed, and sets the taskflow status to failed. The
Data Task step is not executed.
General properties
In the general properties, you can specify a descriptive name for the Throw step.
The name can contain only alphanumeric characters, underscores (_), spaces, and Unicode characters.
Fault fields
You can configure the following fault fields:
Code
Use one of the following options to specify the value for this field:
Detail
Use one of the following options to specify the value for this field:
Reason
Use one of the following options to specify the value for this field:
Runtime parameters
You can configure parameters in the following ways:
Parameters
Parameters are placeholders that represent values in a mapping task. You can use a taskflow to pass
input parameters and in-out parameters to a task.
Parameter files
If the parameter file contains sections and parameters for taskflows and mapping tasks, you can save
the parameter file in the location where the Data Integration job runs. For more information about
parameter files, see Mappings.
Parameters in taskflows
You can use a taskflow to pass input parameters and in-out parameters to a task.
You can design a mapping with input parameters or in-out parameters. When you add a mapping task to a
taskflow, you can override the parameter values. The mapping task passes these parameters to the mapping.
You can use the parameterized mapping task in different scenarios.
The following section explains input and in-out parameters and how you can use them in a taskflow:
Input parameters
An input parameter is a placeholder for a value or values in a mapping task. You define the value of the
parameter when you configure the mapping task. For more information about input parameters, see
Mappings and Tasks.
You can use a taskflow to override the following subset of mapping input parameters:
• String. Changes the string value to be used as input for the mapping task.
• Source object. Changes the object that the mapping task reads from.
• Source connection. Changes the connection that the mapping task uses to read from the source.
• Target connection. Changes the connection that the mapping task uses to write to the target.
• Target object. Changes the object that the mapping task writes to.
• Source_dataFormat. Changes the data format for a precision value or any other value for a particular
column in the formatting file.
• Source_defaultPrecision. Changes the precision value for all the columns in the formatting file.
45
For example, consider a fully parameterized mapping task. The mapping task uses an SQL connection to
read from the employeeaddress table and a JDBC connection to write to the employeedetails table.
You can create a taskflow and override parameters in the mapping task. For example, you can use a
Salesforce connection to read from the employeeincome table and a flat file connection to write to the
file income.txt.
In-Out parameters
An in-out parameter is a placeholder for a value that can you can pass in to or out of a mapping task.
Unlike input parameters, an in-out parameter can change each time a task runs. You can use a taskflow
to override any type of in-out parameters that a mapping task supports. For more information about in-
out parameters, see Mappings and Tasks.
For example, consider a mapping that keep tracks of how many rows it processes using an in-out
parameter named lastprocessedindex. Every time you run the mapping, it resumes processing from
this index. And also, let us say that every time the mapping is executed, it processes 5000 rows.
You can configure the taskflow such that the mapping task runs till it reaches records number, say,
50000.
Perform the following steps to use a Data Task step to override a Data Integration parameter or parameter
file:
• Use the Data Task step to override input parameters. However, in advanced cases, you can override input
parameters with an Assignment step.
Parameters in taskflows 47
• If you define a field to override the same parameter in both the Assignment step and the Data Task step,
the taskflow considers the value assigned in the Data Task step.
• If you use a Data Task step to assign values to input or in-out parameters, the assignments must be
independent of each other. If you use an Assignment step to assign values to input or in-out parameters,
an assignment operation can use the result of a previous assignment operation in the same step.
For example, you have two source objects, SO1 and SO2. You want to override SO1 with the value Account
and override SO2 with the value SO1. Use the Assignment step to override the parameters.
The following image shows the source object SO2 overridden with the value of SO1:
• When you configure the Data Task step to override the parameter file connection and parameter file
object, you must ensure that both the parameters, that is, source object and source connection are
passed either through the parameter file or taskflow. Otherwise, an error occurs.
• If you define a field to override the same parameter in both the Assignment step and the Data Task step,
the taskflow considers the value assigned in the Data Task step.
• Use the Data Task step to override in-out parameters unless your use case specifically demands the
usage of the Assignment step.
• You can get the current value of the in-out parameter only after the taskflow executes the Data Task step.
You cannot get this value before the taskflow runs the Data Task step.
• The source data object parameter, MySourceObject, with default value input.txt.
• The source connection parameter, MySourceConnection, with default value My File Connection.
• The target connection parameter, MyTargetConnection, with default value My File Connection.
• The target data object parameter, MyTargetObject, with default value output5.txt.
MyMT uses My File Connection to read from the input.txt file and My File Connection to write to the
output5.txt file.
You want MyMT to use My File Connection read from the input.txt file and use table and then use My File
Connection to write to another output file, output10.txt file.
To do this, perform the following steps to override the default value of MyTargetObject with a Data Task
step:
You have overridden the target data object parameter, MyTargetObject from the default value output5.txt to
output10.txt.
Note: You only need to add parameters that you want to override to the Input Fields section. In this example,
you only override MyTargetObject. However, you have the option of overriding MySourceObject,
MySourceObject, and MyTargetConnection as well.
Parameters in taskflows 49
Chapter 7
If you assign the value Formula to a field, you must create a formula or an expression for the field to take
data from. Use the Expression Editor to create expressions.
In the following image, fields str and str2 have the value Formula:
To open the Expression Editor, click f(x) next to a field with the value Formula.
• Section 1, the Fields section. A list of input, output, and temporary fields that you define appears here.
50
• Section 2, the Functions section. A list of common XQuery functions appears here. Select a function to
view its meaning.
• Section 3, the Operators section. A list of operators that you can use to build an expression appears here.
• Section 4, the Expression section. The Expression you build appears here. The conditions and operators
that you use are case sensitive.
The expression in the image defines a temporary field, Total Status, as Pass if three tasks that run in parallel
succeed.
Next, the taskflow uses Total Status in a Data Decision step. If the value of Total Status is Pass, the taskflow
runs another Data Task. If the value of Total Status is Fail, the taskflow ends.
The following image shows the taskflow that uses Total Status:
• To add a field, click the Fields tab, drill down to the field that you want to use, and click Add.
• To add an operator, click an operator in the Operators section. You can also manually enter an operator.
For example, manually enter the If operator.
• To add a function, click the Functions tab, drill down to the function you want to use, and click Add.
• To add a comment, enter the comment in the Expression section with the following syntax:
(:<comment>:).
For example, enter (:This is a sample comment:).
Use comments to give descriptive information about the expression or to specify a URL to access
business documentation about the expression.
The Expression Editor validates the expression as you enter it. You cannot save an expression that is not
valid.
51
Tips: Using XQuery 3.0 to create expressions
Use XQuery version 3.0 to create expressions in the Expression Editor. The samples in this topic show you
the syntax and the elements that you use to construct single statement and multi statement XQuery
expressions.
• concat is a function that joins two or more values into a single string.
• "hello", " " $input.n1 are the parameters of the function concat.
- "hello" is a string. Always include a string within quotes. You may use single or double quotes.
However, ensure that you use the same style within an expression.
- n1 is an input variable. When you add it to an expression, the Expression Editor converts it to $input.n1.
Always prefix a variable with a $. Do not add quotes around variables.
- The parameter " " denotes space.
• Include parameters within parentheses.
• Separate parameters with commas.
If you run:
concat("Hello", " ",$input.n1)
you get the following output:
Hello World
Multi-statement expression
The following expression is a multi-statement expression:
• First, you declare the variables $n1 and $n2. Use the operator := to assign a value.
Note: Even if you defined $n1 and $n2 as integers in an Assignment step, you must declare them as
numbers in the Expression Editor.
• You can use XQuery keywords such as let, if, then, and else. They are case sensitive.
Important: If you start an expression with the keyword let, you must end the expression with the keyword
return.
- If the value of $n1 is less than the value of $n2, $r1 takes the value: Less: N1 < N2.
- If the values of $n1 and $n2 are the same, $r1 takes the value: Same.
Assume that the value of $n1 is 20 and the value of $n2 is 250.
If you run:
Keyboard shortcuts
You can use keyboard shortcuts when you create an expression.
To use keyboard shortcuts, place the pointer inside the Expression section.
The following keyboard shortcuts are available:
Action Shortcut
Undo Ctrl+Z
Redo Ctrl+Y
Copy Ctrl+C
Cut Ctrl+X
Paste Ctrl+V
Find Ctrl+F
Code Completion, that is, show a list of available insertions. The insertions might be name spaces, Ctrl+Space
functions, fields, or common code fragments.
Keyboard shortcuts 53
Chapter 8
Taskflow functions
You can use several functions in the Taskflow Expression Editor.
You can use the following asset detail functions from the Miscellaneous section of the Expression
Editor:
• getAssetLocation
• getAssetName
• getInstanceStartTime
Character functions
You can use the following character functions from the Strings section of the Expression Editor:
• instr
• lpad
• ltrim
• rtrim
Conversion functions
You can use the following conversion functions from the Dates and Times, Miscellaneous, or String
sections of the Expression Editor:
• toChar(Numbers)
• toDate
• toDecimal
• toInteger
You can use the following data cleansing function from the Miscellaneous section of the Expression
Editor:
• in
Date functions
You can use the following date functions from the Dates and Times section of the Expression Editor:
• addToDate
• dateDiff
• getDatePart
54
• lastDay
• trunc
Numeric functions
You can use the following numeric function from the Numbers section of the Expression Editor:
• round(Numbers)
You can use the following organization detail functions from the Miscellaneous section of the
Expression Editor:
• getDefaultFailureEmailNotification
• getDefaultSuccessEmailNotification
• getDefaultWarningEmailNotification
Test functions
You can use the following test functions from the Miscellaneous section of the Expression Editor:
• decode
• iif
• isNull
addToDate
Adds a specified amount to one part of a datetime value, and returns a date in the same format as the date
you pass to the function. The addToDate function accepts positive and negative integer values. Use
addToDate to change the following parts of a date:
• Year. Enter a positive or negative integer in the amount argument. Use any of the year format strings: Y,
YY, YYY, or YYYY. The following expression adds 10 years to all dates in the SHIP_DATE column:
date:addToDate(xs:dateTime('SHIP_DATE'), 'YY', 10)
• Month. Enter a positive or negative integer in the amount argument. Use any of the month format strings:
MM, MON, MONTH. The following expression subtracts 10 months from each date in the SHIP_DATE
column:
date:addToDate(xs:dateTime('SHIP_DATE'), 'MONTH', -10)
• Day. Enter a positive or negative integer in the amount argument. Use any of the day format strings: D, DD,
DDD, DY, and DAY. The following expression adds 10 days to each date in the SHIP_DATE column:
date:addToDate(xs:dateTime('SHIP_DATE'), 'DD', 10)
• Hour. Enter a positive or negative integer in the amount argument. Use any of the hour format strings: HH,
HH12, HH24. The following expression adds 14 hours to each date in the SHIP_DATE column:
date:addToDate(xs:dateTime('SHIP_DATE'), 'HH', 14)
• Minute. Enter a positive or negative integer in the amount argument. Use the MI format string to set the
minute. The following expression adds 25 minutes to each date in the SHIP_DATE column:
date:addToDate(xs:dateTime('SHIP_DATE'), 'MI', 25)
• Seconds. Enter a positive or negative integer in the amount argument. Use the SS format string to set the
second. The following expression adds 59 seconds to each date in the SHIP_DATE column:
date:addToDate(xs:dateTime('SHIP_DATE'), 'SS', 59)
addToDate 55
• Milliseconds. Enter a positive or negative integer in the amount argument. Use the MS format string to set
the milliseconds. The following expression adds 125 milliseconds to each date in the SHIP_DATE column:
date:addToDate(xs:dateTime('SHIP_DATE'), 'MS', 125)
• Microseconds. Enter a positive or negative integer in the amount argument. Use the US format string to
set the microseconds. The following expression adds 2,000 microseconds to each date in the SHIP_DATE
column:
date:addToDate(xs:dateTime('SHIP_DATE'), 'US', 2000)
Syntax
date:addToDate(xs:dateTime('date'), 'format', amount)
Note: You must manually add the xs:dateTime phrase and enclose the date values within single quotation
marks.
date Required Date/Time data type. Passes the values that you want to change.
You can enter any valid transformation expression.
format Required A format string that specifies the portion of the date value that you want to change.
Enclose the format string within single quotation marks, for example, 'mm'. The
format string is not case sensitive.
amount Required An integer value that specifies the amount of years, months, days, hours, and so on
by which you want to change the date value. You can enter any valid transformation
expression that evaluates to an integer.
Return Value
Date in the same format as the date you pass to this function.
Examples
The following expressions all add one month to each date in the DATE_SHIPPED column. If you pass a value
that creates a day that does not exist in a particular month, addToDate returns the last day of the month. For
example, if you add one month to Jan 31 1998, addToDate returns Feb 28 1998.
Also, addToDate recognizes leap years and adds one month to Jan 29 2000:
date:addToDate(xs:dateTime('DATE_SHIPPED'), 'MM', 1)
date:addToDate(xs:dateTime('DATE_SHIPPED'), 'MON', 1)
date:addToDate(xs:dateTime('DATE_SHIPPED'), 'MONTH', 1)
The following table shows some sample values and return values:
NULL NULL
The following expressions subtract 10 days from each date in the DATE_SHIPPED column:
date:addToDate(xs:dateTime('DATE_SHIPPED'), 'D', -10)
date:addToDate(xs:dateTime('DATE_SHIPPED'), 'DD', -10)
date:addToDate(xs:dateTime('DATE_SHIPPED'), 'DDD', -10)
date:addToDate(xs:dateTime('DATE_SHIPPED'), 'DY', -10)
date:addToDate(xs:dateTime('DATE_SHIPPED'), 'DAY', -10)
The following table shows some sample values and return values:
NULL NULL
The following expressions subtract 15 hours from each date in the DATE_SHIPPED column:
date:addToDate(xs:dateTime('DATE_SHIPPED'), 'HH', -15)
date:addToDate(xs:dateTime('DATE_SHIPPED'), 'HH12', -15)
date:addToDate(xs:dateTime('DATE_SHIPPED'), 'HH24', -15)
The following table shows some sample values and return values:
NULL NULL
addToDate 57
base64Decode
Returns the base64-decoded version of the input string provided based on the character set specified in the
charSet argument. This function is typically used for attachments.
Syntax
util:base64Decode(data, charSet)
The following table describes the arguments:
data Required String data type. Data that you want to decode.
charSet Optional Character decoding of the data. Taskflows support the character sets that Azul JDK
supports for encoding. For example, US-ASCII, ISO-8859-1, UTF-8, UTF-16BE, UTF-16LE, and
UTF-16.
Default is UTF-8.
Return Value
Decoded value.
Example
You encoded MQSeries message IDs and wrote them to a flat file. You want to read data from the flat file
source, including the MQSeries message IDs. You can use base64Decode to decode the IDs and convert
them to their original string value.
dateDiff
Returns the length of time between two dates. You can specify the format as years, months, days, hours,
minutes, seconds, milliseconds, or microseconds. The dateDiff function subtracts the second date from the
first date and returns the difference.
The dateDiff function calculates the value based on the number of months instead of the number of days. It
calculates the date differences for partial months with the days selected in each month. To calculate the date
difference for the partial month, dateDiff adds the days used within the month. It then divides the value with
the total number of days in the selected month.
The dateDiff function gives a different value for the same period in the leap year period and a non-leap year
period. The difference occurs when February is part of the dateDiff function. The dateDiff function divides the
days with 29 for February for a leap year and 28 if it is not a leap year.
For example, you want to calculate the number of months from September 13 to February 19. In a leap year
period, dateDiff calculates the month of February as 19/29 months or 0.655 months. In a non-leap year
period, dateDiff calculates the month of February as 19/28 months or 0.678 months. The dateDiff function
similarly calculates the difference in the dates for the remaining months and the dateDiff function returns the
total value for the specified period.
Syntax
date:dateDiff(xs:dateTime('date'), xs:dateTime('date'), 'format')
Note: You must manually add the xs:dateTime phrase and enclose the date values within single quotation
marks.
date Required Date/Time data type. Passes the values for the first date that you want to compare.
You can enter any valid transformation expression.
date Required Date/Time data type. Passes the values for the second date that you want to
compare.
You can enter any valid transformation expression.
format Required Format string that specifies the date or time measurement. You can specify years,
months, days, hours, minutes, seconds, milliseconds, or microseconds. You can
specify only one part of the date, such as 'mm'. Enclose the format strings within
single quotation marks. The format string is not case sensitive. For example, the
format string 'mm' is the same as 'MM', 'Mm', or 'mM'.
Return Value
Double value. If the first date is later than the second date, the return value is a positive number. If the first
date is earlier than the second date, the return value is a negative number.
Examples
The following expressions return the number of hours between the DATE_PROMISED and DATE_SHIPPED
columns:
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'HH')
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'HH12')
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'HH24')
The following table lists some sample values and return values:
dateDiff 59
DATE_PROMISED DATE_SHIPPED RETURN VALUE
The following expressions return the number of days between the DATE_PROMISED and the DATE_SHIPPED
columns:
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'D')
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'DD')
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'DDD')
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'DY')
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'DAY')
The following table lists some sample values and return values:
The following expressions return the number of months between the DATE_PROMISED and DATE_SHIPPED
columns:
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'MM')
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'MON')
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'MONTH')
The following table lists some sample values and return values:
The following expressions return the number of months between the DATE_PROMISED and DATE_SHIPPED
columns:
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'MM')
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'MON')
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'MONTH')
The following table lists some sample values and return values:
decode
Searches a column for a value that you specify. If the function finds the value, it returns a result value, which
you define. You can build an unlimited number of searches within a decode function.
If you use decode to search for a value in a string column, you can either trim trailing blank characters with
the rtrim function or include the blanks in the search string.
Syntax
util:decode(value, search1, result1, args, default)
decode 61
The following table describes the arguments:
search1 Required Passes the values for which you want to search.
You can enter any valid transformation expression. You can pass any value with the same
data type as the value argument. The search value must match the value argument. You
cannot search for a portion of a value. Also, the search value is case sensitive.
For example, if you want to search for the string 'Halogen Flashlight' in a particular column,
you must enter 'Halogen Flashlight, not just 'Halogen'. If you enter 'Halogen', the search
does not find a matching value.
To pass a NULL value, you must specify an empty sequence in the following format: ()
result1 Required The value that you want to return if the search finds a matching value.
You can enter any valid transformation expression and pass any data type except Binary.
To pass a NULL value, you must specify an empty sequence in the following format: ()
args Required Pairs of search values and result values separated by a comma.
For example, use the following syntax:
util:decode(value, search1, result1, search2, result2, searchn,
resultn, default)
To pass a NULL value, you must specify an empty sequence in the following format: ()
default Required The value that you want to return if the search does not find a matching value.
You can enter any valid transformation expression and pass any data type except Binary.
To pass a NULL value, you must specify an empty sequence in the following format: ()
Return Value
result1 if the search finds a matching value.
NULL if you omit the default argument and the search does not find a matching value.
Even if multiple conditions are met, decode returns the first matching result.
Examples
You might use decode in an expression that searches for a particular ITEM_ID and returns the ITEM_NAME:
util:decode( ITEM_ID, 10, 'Flashlight',
14, 'Regulator',
20, 'Knife',
40, 'Tank',
'NONE' )
The following table lists some sample values and return values:
10 Flashlight
14 Regulator
17 NONE
20 Knife
25 NONE
NULL NONE
40 Tank
The decode function returns the default value of NONE for items 17 and 25 because the search values did not
match the ITEM_ID. Also, decode returns NONE for the NULL ITEM_ID.
The following expression tests multiple columns and conditions, evaluated in a top to bottom order for TRUE
or FALSE:
util:decode( TRUE,
Var1 = 22, 'Variable 1 was 22!',
Var2 = 49, 'Variable 2 was 49!',
Var1 < 23, 'Variable 1 was less than 23.',
Var2 > 30, 'Variable 2 was more than 30.',
'Variables were out of desired ranges.')
The following table lists some sample values and return values:
decode 63
Var1 Var2 RETURN VALUE
getAssetLocation
Returns the location where the taskflow that uses the function is stored.
For example, you can use the function to find the taskflow location for debugging purposes.
Syntax
util:getAssetLocation()
The getAssetLocation function does not use an argument.
Return Value
Location where the taskflow that uses the function is stored.
Example
If you use the getAssetLocation function in a taskflow that is stored under Default\Orders, the function
returns the following value:
Default\Orders
getAssetName
Returns the name of the taskflow that uses the function.
For example, you can use the function in a Notification Task step to include the taskflow name in a taskflow
failure email notification that you send to stakeholders.
Syntax
util:getAssetName()
The getAssetName function does not use an argument.
Return Value
Name of the taskflow that uses the function.
Example
If you use the getAssetName function in a taskflow that is named Order Management, the function returns
the following value:
Order Management
Syntax
date:getDatePart(xs:dateTime('date'), 'format')
Note: You must manually add the xs:dateTime phrase and enclose the date values within single quotation
marks.
format Required A format string that specifies the portion of the date value that you want to return.
Enclose format strings within single quotation marks, for example, 'mm'. The format
string is not case sensitive.
For example, if you pass the date Apr 1 1997 to getDatePart, the format strings 'Y',
'YY', 'YYY', or 'YYYY' all return 1997.
Return Value
Integer representing the specified part of the date.
Examples
The following expressions return the hour for each date in the DATE_SHIPPED column. 12:00:00AM returns 0
because the default date format is based on the 24 hour interval:
date:getDatePart(xs:dateTime('DATE_SHIPPED'), 'HH')
date:getDatePart(xs:dateTime('DATE_SHIPPED'), 'HH12')
date:getDatePart(xs:dateTime('DATE_SHIPPED'), 'HH24')
The following table lists some sample values and return values:
NULL NULL
The following expressions return the day for each date in the DATE_SHIPPED column:
date:getDatePart(xs:dateTime('DATE_SHIPPED'), 'D')
date:getDatePart(xs:dateTime('DATE_SHIPPED'), 'DD')
date:getDatePart(xs:dateTime('DATE_SHIPPED'), 'DDD')
getDatePart 65
date:getDatePart(xs:dateTime('DATE_SHIPPED'), 'DY')
date:getDatePart(xs:dateTime('DATE_SHIPPED'), 'DAY')
The following table lists some sample values and return values:
NULL NULL
The following expressions return the month for each date in the DATE_SHIPPED column:
date:getDatePart(xs:dateTime('DATE_SHIPPED'), 'MM')
date:getDatePart(xs:dateTime('DATE_SHIPPED'), 'MON')
date:getDatePart(xs:dateTime('DATE_SHIPPED'), 'MONTH')
The following table lists some sample values and return values:
NULL NULL
The following expressions return the year for each date in the DATE_SHIPPED column:
date:getDatePart(xs:dateTime('DATE_SHIPPED'), 'Y')
date:getDatePart(xs:dateTime('DATE_SHIPPED'), 'YY')
date:getDatePart(xs:dateTime('DATE_SHIPPED'), 'YYY')
date:getDatePart(xs:dateTime('DATE_SHIPPED'), 'YYYY')
The following table lists some sample values and return values:
NULL NULL
getInstanceStartTime
Returns the start date and start time of the running instance of the taskflow that uses the function.
For example, you can use the function to find when a taskflow started running and abort the taskflow if it has
been running beyond the expected duration.
Return Value
Start date and start time of the running instance of the taskflow that uses the function.
The return value is in the Coordinated Universal Time (UTC) format as follows:
YYY-MM-DDTHH:mm:ss.sssZ
Example
If you use the getInstanceStartTime function in a taskflow that was started on January 19, 2021, the function
returns the following value:
2021-01-19T10:11:21.047Z
iif
Returns one of two values that you specify based on the results of a condition.
Syntax
util:iif(condition, val1 ,val2)
The following table describes the arguments:
val1 Required The value that you want to return if the condition is TRUE. The return value is always the
data type specified by this argument.
You can enter any valid transformation expression, including another iif expression. You
can pass any data type except Binary.
val2 Optional The value that you want to return if the condition is FALSE.
You can enter any valid transformation expression, including another iif expression. You
can pass any data type except Binary.
The FALSE (val2) condition in the iif function is not required. If you omit val2, the function returns one of the
following values when the condition is FALSE:
iif 67
The following table lists some sample values and return values:
Return Value
val1 if the condition is TRUE.
For example, the following expression includes the FALSE condition NULL so decode returns NULL for each
row that evaluates to FALSE:
util:iif(SALES > 100, EMP_NAME, NULL)
The following table lists some sample values and return values:
Syntax
util:in(valueToSearch, values, caseFlag)
The following table describes the arguments:
valueToSearch Required Can be a string, date, or numeric value. Input value that you want to match
against a comma-separated list of values.
To pass a NULL value, you must specify an empty sequence in the following
format: ()
values Required Can be a string, date, or numeric value. Comma-separated list of values that you
want to search for. Values can be columns. There is no limit to the maximum
number of values that you can list.
To pass a NULL value, you must specify an empty sequence in the following
format: ()
caseFlag Optional Must be an integer. Determines whether the arguments in this function are case
sensitive. You can enter any valid transformation expression.
When caseFlag is a number other than 0, the function is case sensitive.
When caseFlag is a null value or 0, the function is not case sensitive.
Return Value
TRUE (1) if the input value matches the list of values.
FALSE (0) if the input value does not match the list of values.
Example
The following expression determines if the input value is a safety knife, chisel point knife, or medium titanium
knife. The input values do not have to match the case of the values in the comma-separated list:
util:in(ITEM_NAME, ‘Chisel Point Knife’, ‘Medium Titanium Knife’, ‘Safety Knife’, 0)
The following table lists some sample values and return values:
NULL
in 69
instr
Returns the position of a character set in a string, counting from left to right.
Syntax
sff:instr(str, search, start, occurrence, comparison_type)
The following table describes the arguments:
search Required The set of characters that you want to search for.
You can enter any valid transformation expression. If you want to search for a
character string, enclose the characters that you want to search for within single or
double quotation marks.
The value must match a part of the string. For example, if you use instr('Alfred
Pope', 'Alfred Smith') the function returns 0.
The value is case sensitive.
start Optional The position in the string where you want to start the search. You can enter any
valid transformation expression. The value must be an integer.
The default is 1, meaning that instr starts the search at the first character in the
string.
If the start position is 0, instr searches from the first character in the string. If the
start position is a positive number, instr locates the start position by counting from
the beginning of the string. If the start position is a negative number, instr locates
the start position by counting from the end of the string. If you omit this argument,
the function uses the default value of 1.
occurrence Optional You can enter any valid transformation expression. If the search value appears
more than once in the string, you can specify which occurrence you want to search
for. For example, you would enter 2 to search for the second occurrence from the
start position.
You can enter a positive integer that is greater than 0.
If you omit this argument, the function uses the default value of 1, which means that
instr searches for the first occurrence of the search value. If you pass a decimal
value, the function rounds it to the nearest integer value. If you pass a negative
integer or 0, the function is not valid.
Return Value
Integer if the search is successful. Integer represents the position of the first character in the search
argument, counting from left to right.
Examples
The following expression returns the position of the first occurrence of the letter ‘a’, starting from the
beginning of each company name:
sff:instr( COMPANY, 'a' )
The following table lists some sample values and return values:
Scuba Gear 5
Because the search argument is case sensitive, it skips the ‘A’ in ‘Blue Fin Aqua Center’, and returns the
position for the ‘a’ in ‘Aqua’.
instr 71
The following expression returns the position of the second occurrence of the letter ‘a’, starting from the
beginning of each company name:
sff:instr( COMPANY, 'a', 1, 2 )
The following table lists some sample values and return values:
Scuba Gear 9
Because the search argument is case sensitive, it skips the ‘A’ in ‘Blue Fin Aqua Center’, and returns 0.
The following expression returns the position of the second occurrence of the letter ‘a’ in each company
name, starting from the last character in the company name.
sff:instr( COMPANY, 'a', -1, 2 )
The following table lists some sample values and return values:
Scuba Gear 5
Because the search argument is case sensitive, it skips the ‘A’ in 'Blue Fin Aqua Center’, and returns 0.
The following expression returns the position of the first character in the string ‘Blue Fin Aqua Center’,
starting from the last character in the company name:
sff:instr( COMPANY, 'Blue Fin Aqua Center', -1, 1 )
The following table lists some sample values and return values:
Scuba Gear 0
isNull
Returns whether a value is NULL.
Syntax
util:isNull(value)
The following table describes the argument for this command:
value Required Passes the rows that you want to evaluate. You can enter any valid transformation
expression. You can pass a value of any data type except Binary.
Return Value
TRUE (1) if the value is NULL.
Example
The following example checks for NULL values in the items table:
util:isNull( ITEM_NAME )
The following table lists some sample values and return values:
Flashlight 0 (FALSE)
NULL 1 (TRUE)
lastDay
Returns the date of the last day of the month for each date in a column.
isNull 73
Syntax
date:lastDay(date)
The following table describes the argument for this command:
date Required Date/Time data type. Passes the date for which you want to return the last day of
the month.
You can enter any valid transformation expression that evaluates to a date.
Return Value
Date. The last day of the month for the date value that you pass to this function.
Example
The following expression returns the current date as the last day:
date:lastDay(fn:current-dateTime('DATE'))
The following table lists some sample values and return values:
The following expression returns the last day of the previous month for each date in the DATE column:
date:lastDay(date:addToDate(fn:current-dateTime('DATE','MM',-1))
The following table lists some sample values and return values:
NULL NULL
You can nest toDate to convert string values to a date. toDate function always includes time information. If
you pass a string that does not have a time value, the date returned will include the time 00:00:00.
The following example returns the last day of the month for each date in the same format as the string:
date:lastDay(toDate('DATE', 'MON-DD-YYYY'))
The following table lists some sample values and return values:
NULL NULL
date:lastDay(date:toDate("DATE", "YYYY-MM-DD"))
The following table lists some sample values and return values:
NULL NULL
lpad
Adds a set of blank characters to the beginning of a string to set the string to a specified length.
Syntax
sff:lpad(first_string, length, second_string)
The following table describes the arguments:
first_string Required Can be a character string. Passes the string that you want to change. You can enter any
valid transformation expression.
To pass a NULL value, you must specify an empty sequence in the following format: ()
length Required Must be a positive integer literal. This argument specifies the length that you want for
each string. When length is a negative number, lpad returns NULL.
second_string Optional Can be any string value. The characters that you want to append to the left-side of the
first_string values. You can enter any valid transformation expression. You can enter a
specific string literal. However, enclose the characters you want to add to the beginning
of the string within single quotation marks, as in 'abc'. This argument is case sensitive.
If you omit the second_string, the function pads the beginning of the first string with
blank characters.
To pass a NULL value, you must specify an empty sequence in the following format: ()
Return Value
String of the specified length.
lpad 75
Example
The following expression standardizes numbers to six digits by padding them with leading zeros.
sff:lpad(PART_NUM, 6, '0')
The following table lists some sample values and return values:
702 000702
1 000001
0553 000553
484834 484834
lpad counts the length from left to right. If the first string is longer than the length, lpad truncates the string
from right to left. For example, lpad(‘alphabetical’, 5, ‘x’) returns the string ‘alpha’.
If the second string is longer than the total characters needed to return the specified length, lpad uses a
portion of the second string:
sff:lpad(ITEM_NAME, 16, '*..*')
The following table lists some sample values and return values:
Flashlight *..**.Flashlight
Compass *..**..**Compass
The following expression shows how lpad handles negative values for the length argument for each row in
the ITEM_NAME column:
sff:lpad(ITEM_NAME, -5, '.')
The following table lists some sample values and return values:
Flashlight NULL
Compass NULL
ltrim
Removes leading spaces or characters from the beginning of a string.
If you use ltrim to remove characters from a string, ltrim compares the trim_set to each character in the str
argument, character-by-character, starting from the left side of the string. If the character in the string
matches any character in the trim_set, ltrim removes it. The ltrim function continues comparing and removing
characters until it fails to find a matching character in the trim_set. Then it returns the string, which does not
include matching characters.
Syntax
sff:ltrim(str, trim_set)
The following table describes the arguments:
str Required Any string value. Passes the strings that you want to modify. You can enter any valid
transformation expression. Use operators to perform comparisons or concatenate strings
before removing characters from the beginning of a string.
You must enclose the string value within single or double quotation marks.
To pass a NULL value, you must specify an empty sequence in the following format: ()
trim_set Optional Any string value. Passes the characters that you want to remove from the beginning of the
first string. You can enter any valid transformation expression. You can also enter a
character string.
You must enclose the trim set value within single or double quotation marks.
To pass a NULL value, you must specify an empty sequence in the following format: ()
The ltrim function is case sensitive. For example, if you want to remove the 'A' character
from the string 'Alfredo', you would enter 'A', not 'a'.
Return Value
String. The string values with the specified characters in the trim_set argument removed.
NULL if a value passed to ltrim is NULL. If the trim_set is NULL, ltrim returns NULL.
Example
The following expression removes the characters ‘S’ and ‘.’ from the strings in the LAST_NAME column:
sff:ltrim( LAST_NAME, 'S.')
The following table lists some sample values and return values:
Nelson Nelson
Osborne Osborne
NULL NULL
S. MacDonald MacDonald
Sawyer awyer
ltrim 77
LAST_NAME RETURN VALUE
H. Bender H. Bender
Steadman teadman
The ltrim function removes ‘S.’ from S. MacDonald and the ‘S’ from both Sawyer and Steadman, but not the
period from H. Bender. This is because ltrim searches, character-by-character, for the set of characters you
specify in the trim_set argument. If the first character in the string matches the first character in the trim_set,
ltrim removes it. Then, ltrim looks at the second character in the string. If it matches the second character in
the trim_set, ltrim removes it, and so on. When the first character in the string does not match the
corresponding character in the trim_set, ltrim returns the string and evaluates the next row.
In the example of H. Bender, H does not match either character in the trim_set argument, so ltrim returns the
string in the LAST_NAME column and moves to the next row.
You can also remove multiple sets of characters by nesting ltrim. For example, to remove leading blank
spaces and the character 'T' from a column of names, you might create an expression as follows:
sff:ltrim( sff:ltrim( NAMES ), 'T' )
round (Numbers)
Rounds numbers to a specified number of digits or decimal places. You can also use round to round dates.
• Returns the number without the fractional part that is closest to the argument.
• If there are two numbers that are close to the argument, then the number that is closest to the positive
infinity is returned.
• If the data type of the argument is one of the four numeric data types, xs:float, xs:double, xs:decimal, or
xs:integer, then the data type of the result is the same as the data type of the argument.
• If the data type of the argument is a data type derived from one of the numeric data types, then the result
is an instance of the base numeric data type.
Syntax
fn:round(arg)
arg Required Must be a numeric data type. You can enter any valid transformation expression.
Use operators to perform arithmetic before you round the values.
To pass a NULL value, you must specify an empty sequence in the following
format: ()
The function rounds to the nearest integer, truncating the decimal portion of the
number. For example, round(12.99) returns 13 and round(15.20) returns 15.
Return Value
Numeric value.
Example
The following expression returns the rounded values in the Price column.
fn:round(PRICE)
The following table lists some sample values and return values:
12.99 13.0
-15.99 -16.0
-18.99 -19.0
56.95 57.0
NULL NULL
If you want to be more specific with the precision and round the number to the nearest integer or truncate the
decimal portion, it is recommended to use round-half-to-even function.
fn:round-half-to-even(arg, precision)
If you enter a positive precision, the function rounds to this number of decimal places. For example,
round(12.99, 1) returns 13.0 and round(15.44, 1) returns 15.4.
If you enter a negative precision, the function rounds this number of digits to the left of the decimal point,
returning an integer. For example, round(12.99, -1) returns 10 and rounds(15.99, -1) returns 20.
The value returned is the nearest, that is, numerically closest value to the argument that is a multiple of ten to
the power of minus precision. If two such values are equally near, that is, if the fractional part in the argument
is exactly .500..., the function returns the one whose least significant digit is even.
Example
The following expression returns the values in the Price column rounded to three decimal places.
fn:round-half-to-even(PRICE, 3)
round (Numbers) 79
The following table lists some sample values and return values:
12.9936 12.994
15.9949 15.995
-18.8678 -18.868
56.9561 56.956
NULL NULL
You can round digits to the left of the decimal point by passing a negative integer in the precision argument:
fn:round-half-to-even(PRICE, -2)
The following table lists some sample values and return values:
13242.99 13200.0
1435.99 1400.0
-108.95 -100.0
NULL NULL
If you pass zero in the precision argument, the function rounds to the nearest integer:
fn:round-half-to-even(PRICE, 0)
The following table lists some sample values and return values:
12.99 13.0
-15.99 -16.0
-18.99 -19.0
56.95 57.0
NULL NULL
rtrim
Removes blank characters or characters from the end of a string.
If you do not specify a trim_set parameter in the expression, rtrim removes both single-byte and double-byte
spaces from the end of a string.
If you use rtrim to remove characters from a string, rtrim compares the trim_set to each character in the
string argument, character-by-character, starting with the right side of the string. If the character in the string
Syntax
sff:rtrim(str, trim_set)
The following table describes the arguments:
string Required Any string value. Passes the values that you want to trim. You can enter any valid
transformation expression. Use operators to perform comparisons or concatenate strings
before removing blank characters from the end of a string.
You must enclose the string value within single or double quotation marks.
To pass a NULL value, you must specify an empty sequence in the following format: ()
trim_set Optional Any string value. Passes the characters that you want to remove from the end of the string.
You can also enter a text literal.
You must enclose the string value within single or double quotation marks.
To pass a NULL value, you must specify an empty sequence in the following format: ()
The rtrim function is case sensitive. For example, if you want to remove the 'o' character
from the string 'Alfredo', you would enter 'o', not 'O'.
Return Value
String. The string values with the specified characters in the trim_set argument removed.
NULL if a value passed to rtrim is NULL. If the trim_set is NULL, rtrim returns NULL.
Example
The following expression removes the characters ‘re’ from the strings in the LAST_NAME column:
sff:rtrim( LAST_NAME, 're')
The following table lists some sample values and return values:
Nelson Nelson
Page Pag
Osborne Osborn
NULL NULL
Sawyer Sawy
H. Bender H. Bend
Steadman Steadman
The rtrim function removes ‘e’ from Page even though ‘r’ is the first character in the trim_set. This is because
rtrim searches, character-by-character, for the set of characters you specify in the trim_set argument. If the
last character in the string matches the first character in the trim_set, rtrim removes it. If, however, the last
rtrim 81
character in the string does not match, rtrim compares the second character in the trim_set. If the second
from last character in the string matches the second character in the trim_set, rtrim removes it, and so on.
When the character in the string fails to match the trim_set, rtrim returns the string and evaluates the next
row.
In the last example, the last character in Nelson does not match any character in the trim_set argument, so
rtrim returns the string 'Nelson' and evaluates the next row.
You can also remove multiple sets of characters by nesting rtrim. For example, to remove trailing blank
characters and the character ‘t’ from the end of each string in a column of names, you might create an
expression similar to the following:
sff:trim( sff:rtrim( NAMES ), 't' )
toChar (Numbers)
Converts numeric values to text strings.
Syntax
sff:toChar(xs:double(val))
Note: After you add the function, you must manually add the phrase (xs:double) in the syntax. Otherwise, the
taskflow fails.
val Required The numeric value that you want to convert to a string. You can enter any valid
transformation expression.
• Converts double values of up to 16 digits to strings and provides accuracy up to 15 digits. If you pass a
number with more than 15 digits, toChar rounds the number based on the sixteenth digit and returns the
string representation of the number in scientific notation. For example, 1234567890123456 double value
converts to '1.23456789012346e+015' string value.
• Returns decimal notation for numbers in the ranges (-1e16,-1e-16] and [1e-16, 1e16). toChar returns
scientific notation for numbers outside these ranges. For example, 10842764968208837340 double value
converts to '1.08427649682088e+019' string value.
toChar converts decimal values to text strings as follows:
1010.99 '1010.99'
-15.62567 '-15.62567'
236789034569723 '236789034569723'
0 '0'
33.15 '33.15'
NULL NULL
2378964536789761 '2378964536789761'
1234567890123456789012345679 '1234567890123456789012345679'
1.234578945469649345876123456 '1.234578945469649345876123456'
0.999999999999999999999999999 '0.999999999999999999999999999'
12345678901234567890123456799 '12345678901234567890123456799'
23456788992233456678458934567123465239 '23456788992233456678458934567123465239'
423456789012345678901234567991234567899 '4.23456789012346e+038'
(greater than 38)
The following table lists some sample values and return values when the precision is greater than 28:
2378964536789761 '2378964536789761'
toChar (Numbers) 83
SALES RETURN VALUE
1234567890123456789012345679 '1234567890123456789012345679'
1.234578945469649345876123456 '1.234578945469649345876123456'
0.999999999999999999999999999 '0.999999999999999999999999999'
12345678901234567890123456799 '1.23456789012346e+028'
(greater than 28)
The toChar (Dates) function converts a Date/Time datatype to a string with the format you specify. You can
convert the entire date or a part of the date to a string.
Note: Use double quotation marks to separate ambiguous format strings, for example D"D""DDD. The empty
quotation marks do not appear in the output.
toDate
Converts a character string to a Date/Time data type. You use the toDate format strings to specify the format
of the source strings.
If you are converting two-digit years with toDate, use either the RR or YY format string. Do not use the YYYY
format string.
Syntax
date:toDate(xs:dateTime('date'), 'format')
Note: You must manually add the xs:dateTime phrase and enclose the date values within single quotation
marks.
date Required Must be a string data type. Passes the values that you want to convert to dates. You
can enter any valid transformation expression.
format Required Enter a valid toDate format string. The format string must match the parts of the
dare argument. For example, if you pass the date 'Mar 15 1998 12:43:10AM', you
must use the format string 'MON DD YYYY HH12:MI:SSAM'.
Return Value
Date.
The toDate function always returns a date and time. If you pass a string that does not have a time value, the
date returned always includes the time 00:00:00.000000000. You can map the results of this function to any
target column with a datetime data type.
Examples
date:toDate(xs:dateTime('DATE_PROMISED'), 'MM/DD/YY')
The following table lists some sample values and return values:
NULL NULL
NULL NULL
The following expression converts strings in the SHIP_DATE_MJD_STRING port to date values:
date:toDate(xs:dateTime('SHIP_DATE_MJD_STR'), 'J')
The following table lists some sample values and return values:
SHIP_DATE_MJD_STR RETURN_VALUE
Because the J format string does not include the time portion of a date, the return values have the time set to
00:00:00.000000000.
The following expression converts a string to a four-digit year format. The current year is 1998:
date:toDate(xs:dateTime('DATE_STR'), 'MM/DD/RR')
toDate 85
The following table lists some sample values and return values:
The following expression converts a string to a four-digit year format. The current year is 1998:
date:toDate(xs:dateTime('DATE_STR'), 'MM/DD/YY')
The following table lists some sample values and return values:
Note: For the second row, RR returns the year 2005 and YY returns the year 1905.
The following expression converts a string to a four-digit year format. The current year is 1998:
date:toDate(xs:dateTime('DATE_STR'), 'MM/DD/Y')
The following table lists some sample values and return values:
The following expression converts a string to a four-digit year format. The current year is 1998:
date:toDate(xs:dateTime('DATE_STR'), 'MM/DD/YYY')
The following table lists some sample values and return values:
The following expression converts strings that includes the seconds since midnight to date values:
date:toDate(xs:dateTime('DATE_STR'), 'MM/DD/YYYY SSSSS')
The following table lists some sample values and return values:
DATE_STR RETURN_VALUE
Syntax
util:toDecimal(value, scale)
The following table describes the arguments:
value Required Must be a string or numeric data type. Passes the value that you want to convert to
decimals.
You can enter any valid transformation expression.
scale Optional Must be an integer literal between 0 and 28, inclusive. Specifies the number of digits
allowed after the decimal point. If you omit this argument, the function returns a value with
the same scale as the input value.
Return Value
Decimal of precision and scale between 0 and 28, inclusive.
Example
This expression uses values from the column IN_TAX. The data type is decimal with precision of 10 and
scale of 3:
util:toDecimal(IN_TAX, 3)
The following table lists some sample values and return values:
'15.6789' 15.679
'60.2' 60.200
'118.348' 118.348
NULL NULL
'A12.3Grove' 0
This expression uses values from the column Sales. The data type is decimal with precision of 10 and scale
of 2:
util:toDecimal(Sales, 2)
The following table lists some sample values and return values:
'1234' 1234
toDecimal 87
Sales RETURN VALUE
'1234.01' 1234.01
If you want the return value in 1234.00 format, you can use the following expression:
format-number(util:toDecimal('1234', 2), '0.00')
The toDecimal function support up to 28 precision. If you pass a value with precision greater than 28, such as
32, you will encounter an issue even after enabling high precision.
If you want a 32-digit value intact from the source to the target, you must define the value as string from
source to target with 32 precision. You will be able to load the value to the target database even if that
database has a numeric data type and the target definition has a string data type. However, you must ensure
that the data type of the column in the target database accepts a precision of 32.
Decimal overflow
If the size of the number on the left hand side of the decimal point exceeds the precision, the decimal
operation overflows.
To resolve this, modify the scale and/or precision of the expression port and connect downstream ports of
the mapping to accommodate the size of the input data in the expression.
For example:
If a numeric field is defined to be size 28 with scale of 15, this accepts 13 numbers on the left side of the
decimal and 15 on the right. So the following numbers would be valid for a number of 28,15:
1234567890123.11143
13575.123451234567891
111112222233333.4444
123.1111122222333334
toInteger
Converts a string or numeric value to an integer. The toInteger syntax contains an optional argument that you
can choose to round the number to the nearest integer or truncate the decimal portion. The toInteger function
ignores leading spaces.
Syntax
util:toInteger(value, flag)
value Required Must be a string or numeric data type. Passes the value that you want to convert to
an integer.
You can enter any valid transformation expression.
flag Optional Specifies whether to truncate or round the decimal portion. The flag must be an
integer literal or the constants TRUE or FALSE:
- toInteger truncates the decimal portion when the flag is TRUE or a number other
than 0.
- toInteger rounds the value to the nearest integer if the flag is FALSE or 0 or if you
omit this argument.
Return Value
Integer.
Example
The following expressions use values from the column IN_TAX:
util:toInteger(IN_TAX, fn:boolean(1))
The following table lists some sample values and return values:
'15.6789' 15
'60.2' 60
'118.348' 118
NULL NULL
'A12.3Grove' 0
'-15.6789' -15
'-15.23' -15
If a bigint column is mapped to a column with integer data type, an issue occurs.
To avoid this issue, you must have the data type of the column same throughout the mapping. If you need to
assign bigint to the integer column, ensure that the data being passed does not exceed the range of integer.
toInteger 89
trunc
Truncates dates to a specific year, month, day, hour, minute, second, or millisecond. You can also use trunc
to truncate numbers.
• Year. If you truncate the year portion of the date, the function returns Jan 1 of the input year with the time
set to 00:00:00.000000000. For example, the following expression returns 1/1/1997 00:00:00.000000000:
date:trunc(xs:dateTime('12/1/1997 3:10:15'), 'YY')
• Month. If you truncate the month portion of a date, the function returns the first day of the month with the
time set to 00:00:00.000000000. For example, the following expression returns 4/1/1997
00:00:00.000000000:
date:trunc(xs:dateTime('4/15/1997 12:15:00'), 'MM')
• Day. If you truncate the day portion of a date, the function returns the date with the time set to
00:00:00.000000000. For example, the following expression returns 6/13/1997 00:00:00.000000000:
date:trunc(xs:dateTime('6/13/1997 2:30:45'), 'DD')
• Hour. If you truncate the hour portion of a date, the function returns the date with the minutes, seconds,
and subseconds set to 0. For example, the following expression returns 4/1/1997 11:00:00.000000000:
date:trunc(xs:dateTime('4/1/1997 11:29:35'), 'HH')
• Minute. If you truncate the minute portion of a date, the function returns the date with the seconds and
subseconds set to 0. For example, the following expression returns 5/22/1997 10:15:00.000000000:
date:trunc(xs:dateTime('5/22/1997 10:15:29'), 'MI')
• Second. If you truncate the second portion of a date, the function returns the date with the milliseconds
set to 0. For example, the following expression returns 5/22/1997 10:15:29.000000000:
date:trunc(xs:dateTime('5/22/1997 10:15:29.135'), 'SS')
• Millisecond. If you truncate the millisecond portion of a date, the function returns the date with the
microseconds set to 0. For example, the following expression returns 5/22/1997 10:15:30.135000000:
date:trunc(xs:dateTime('5/22/1997 10:15:30.135235'), 'MS')
Syntax
date:trunc(xs:dateTime('date'), 'format')
Note: You must manually add the xs:dateTime phrase and enclose the date values within single quotation
marks.
date Required Date/Time data type. The date values that you want to truncate. You can enter any
valid transformation expression that evaluates to a date.
To pass a NULL value, you must specify an empty sequence in the following format:
()
format Required Enter a valid format string. The format string is not case sensitive.
To pass a NULL value, you must specify an empty sequence in the following format:
()
Return Value
Date.
Examples
The following expressions truncate the year portion of dates in the DATE_SHIPPED column:
date:trunc(xs:dateTime('DATE_SHIPPED'), 'Y')
date:trunc(xs:dateTime('DATE_SHIPPED'), 'YY')
date:trunc(xs:dateTime('DATE_SHIPPED'), 'YYY')
date:trunc(xs:dateTime('DATE_SHIPPED'), 'YYYY')
The following table lists some sample values and return values:
NULL NULL
The following expressions truncate the month portion of each date in the DATE_SHIPPED column:
date:trunc(xs:dateTime('DATE_SHIPPED'), 'MM')
date:trunc(xs:dateTime('DATE_SHIPPED'), 'MON')
date:trunc(xs:dateTime('DATE_SHIPPED'), 'MONTH')
The following table lists some sample values and return values:
NULL NULL
The following expressions truncate the day portion of each date in the DATE_SHIPPED column:
date:trunc(xs:dateTime('DATE_SHIPPED'), 'D')
date:trunc(xs:dateTime('DATE_SHIPPED'), 'DD')
date:trunc(xs:dateTime('DATE_SHIPPED'), 'DDD')
date:trunc(xs:dateTime('DATE_SHIPPED'), 'DY')
date:trunc(xs:dateTime('DATE_SHIPPED'), 'DAY')
The following table lists some sample values and return values:
trunc 91
DATE_SHIPPED RETURN VALUE
NULL NULL
The following expressions truncate the hour portion of each date in the DATE_SHIPPED column:
date:trunc(xs:dateTime('DATE_SHIPPED'), 'HH')
date:trunc(xs:dateTime('DATE_SHIPPED'), 'HH12')
date:trunc(xs:dateTime('DATE_SHIPPED'), 'HH24')
The following table lists some sample values and return values:
NULL NULL
The following expression truncates the minute portion of each date in the DATE_SHIPPED column:
date:trunc(xs:dateTime('DATE_SHIPPED'), 'MI')
The following table lists some sample values and return values:
NULL NULL
93
Chapter 10
Running a taskflow
Use a taskflow to control the execution sequence of multiple Data Integration tasks.
To run a taskflow from the taskflow designer, open the taskflow and click Run in the upper-right part of
the page.
According to a schedule
To run a taskflow on a schedule, create a schedule in Administrator and associate the taskflow with the
schedule.
Publishing a taskflow
If you want to schedule a taskflow, you need to publish it first.
• Run the taskflow from the taskflow designer. When you run a taskflow, it gets published automatically.
• Click Publish in the taskflow designer.
• Navigate to the taskflow from the Explore page and select Publish from the Actions menu.
If you change a scheduled taskflow, you need to republish it so that Data Integration runs the updated
taskflow.
94
Scheduling a taskflow
To schedule a taskflow, associate the taskflow with an existing schedule or create a new schedule.
You can create a new schedule in Data Integration and Administrator. For more information about creating a
schedule in Administrator, see Organization Administration.
Before you schedule a taskflow, you must publish the taskflow. A scheduled taskflow runs only if the
taskflow was published at least once.
If you schedule an outdated taskflow that contains unpublished changes, Data Integration schedules the last
published taskflow version.
If you unpublish a scheduled taskflow, the scheduled taskflow jobs will not run.
You can view the scheduled jobs by selecting Scheduled Jobs from the Actions menu.
Note: To delete a scheduled job, select the job and click Delete.
4. In the Job Name field, enter a name for this combination of taskflow and schedule.
The name can contain alphanumeric characters, spaces, and the following special characters: _ . + -
5. Perform one of the following steps:
• To assign an existing schedule, select a schedule from the Schedule list and click Assign Schedule.
Scheduling a taskflow 95
• To create a schedule, click New Schedule, enter the schedule details, and click Save. The schedule
that you created is selected in the Schedule list. Click Assign Schedule to assign the schedule to the
taskflow.
Note: If you remove a taskflow from a schedule as the taskflow runs, the job completes. Data Integration
cancels any additional runs associated with the schedule.
A G
addToDate function getAssetLocation function
description 55 description 64
getAssetName function
description 64
C getDatePart function
description 65
character functions getInstanceStartTime function
instr 70 description 66
ltrim 76
rtrim 80
character strings
converting to dates 84
I
characters iif function
adding to strings 75 description 67
removing from strings 76, 80 in function
Cloud Application Integration community description 69
URL 6 Informatica Global Customer Support
Cloud Developer community contact information 7
URL 6 Informatica Intelligent Cloud Services
conversion functions web site 6
toChar (numbers) 82 instr function
toDate 84 description 70
toDecimal 87 integers
toInteger 88 converting other values 88
isNull function
description 73
D
data cleansing functions
in 69
L
Data Integration community lastDay function
URL 6 description 73
date functions lpad function
addToDate 55 description 75
dateDiff 58 ltrim function
getDatePart 65 description 76
lastDay 73
trunc 90
date/time values
adding 55
M
dateDiff function maintenance outages 7
description 58 month
dates returning last day 73
truncating 90
decimal values
converting 87
decode function
N
description 61 Notification Task step
configuring properties 25
rules and guidelines 28
F NULL values
checking for 73
format isNull 73
from character string to date 84
97
numbers taskflow functions (continued)
rounding 78 getAssetName 64
numeric functions getInstanceStartTime 66
round (numbers) 78 taskflows
numeric values creating a taskflow 11
converting to text strings 82 expression editor 50
overview 8
parameters in taskflows 45
R running a taskflow 94
taskflow properties 14
round (numbers) function taskflow step properties 20
description 78 taskflow steps 9
rounding taskflow templates 11
numbers 78 validation panel 93
rtrim function test functions
description 80 isNull 73
text strings
converting numeric values 82
W
T web site 6
taskflow functions
getAssetLocation 64
98 Index