CDI July2021 Taskflows en
CDI July2021 Taskflows en
July 2021
Taskflows
Informatica Cloud Data Integration Taskflows
July 2021
© Copyright Informatica LLC 2006, 2021
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://
[Link]/[Link]. 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@[Link].
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 2: Taskflows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Taskflow steps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Creating a taskflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Taskflow templates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Basic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Parallel Tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Parallel Tasks with Decision. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Sequential Tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Sequential Tasks with Decision. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Single Task. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Setting taskflow properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
General properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Start properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Input fields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Temporary fields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Advanced properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Notes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Setting taskflow step properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Assignment step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Data Task step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Notification Task step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Command Task step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
File Watch Task step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Ingestion Task step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Subtaskflow step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Decision step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Parallel Paths step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Table of Contents 3
Jump step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
End step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Wait step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Throw step. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Parameters in taskflows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Overriding parameters in a taskflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Guidelines and best practices for using parameters in a taskflow. . . . . . . . . . . . . . . . . . . . 46
Example: Overriding parameters with a Data Task step. . . . . . . . . . . . . . . . . . . . . . . . . . . 47
The Expression Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Tips: Using XQuery 3.0 to create expressions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Keyboard shortcuts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Taskflow functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
addToDate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
dateDiff. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
decode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
getAssetLocation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
getAssetName. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
getDatePart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
getInstanceStartTime. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
iif. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
in. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
instr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
isNull. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
lastDay. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
lpad. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
ltrim. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
round (Numbers). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
rtrim. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
toChar (Numbers). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
toDate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
toDecimal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
toInteger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
trunc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Using the Validation panel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Running a taskflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Running a taskflow from the taskflow designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Running a taskflow using taskflow inputs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Creating a taskflow input. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Running a taskflow with taskflow inputs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Deleting a taskflow input. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Running a taskflow as an API. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Passing inputs through a browser. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
4 Table of Contents
Passing inputs through a REST client. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Running a taskflow using RunAJob utility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Invoking a taskflow through a connector file listener. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Scheduling a taskflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Monitoring taskflow status with the status resource. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Taskflow example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Table of Contents 5
Preface
Use Taskflows to learn how to set up dynamic and linear 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 [Link]
If you have questions, comments, or ideas about the product documentation, contact the Informatica
Documentation team at infa_documentation@[Link].
[Link]
Developers can learn more and share tips at the Cloud Developer community:
[Link]
developers
[Link]
6
Data Integration connector documentation
You can access documentation for Data Integration Connectors at the Documentation Portal. To explore the
Documentation Portal, visit [Link]
To search the Knowledge Base, visit [Link] If you have questions, comments, or
ideas about the Knowledge Base, contact the Informatica Knowledge Base team at
KB_Feedback@[Link].
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
[Link]
The telephone numbers for Informatica Global Customer Support are available from the Informatica web site
at [Link]
Preface 7
Chapter 1
Taskflow
Use a taskflow to control the execution sequence of a Data Integration task. You can run tasks in
parallel, use advance decision making criteria, time tasks, and perform other advanced orchestrations.
Linear taskflow
Use a linear taskflow to run multiple tasks serially in the order that you specify.
8
Chapter 2
Taskflows
Use a taskflow to control the execution sequence of a mapping task or a synchronization 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 mapping task or the synchronization task that you
want to use ready. You cannot create a mapping task or a synchronization task during the taskflow creation
process.
You can invoke and run a taskflow from the taskflow designer, as an API, or through a connector file listener.
You can also run a taskflow on a schedule.
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 mapping task, synchronization task, or PowerCenter 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.
9
Command Task
Use a Command Task step to run shell scripts or batch commands from a file 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.
Use a File Watch Task step to listen to files in a defined location and monitor file events. In the File
Watch Task step, you can select an existing file listener with the connector source type. You can use file
events to orchestrate taskflow execution. For example, you can wait for a file to arrive at a particular
location and then consume the file in a subsequent step.
Ingestion Task
Use an Ingestion Task step to leverage a file ingestion task for taskflow orchestration. In the Ingestion
Task step, you can select an existing file ingestion task.
You might want to perform data integration operations after moving files to an intermediate location and
before transferring the files to the target. In this scenario, you can use the Ingestion Task step in
conjunction with the Data Task step.
For example, you can use the Ingestion Task step to read a large number of files from a source location
and write them to an intermediate location. You can then use the Data Task step to perform data
integration operations on the files and use another Ingestion Task step to write the updated files to the
final target location.
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.
Jump
Use a Jump step when you want to jump from one part of the taskflow to another.
End
Use an End step to define the HTTP status code that must be used when a taskflow completes.
Wait
Use a Wait step when you want to pause taskflow execution for a specific duration.
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.
10 Chapter 2: Taskflows
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 mapping task or a synchronization 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.
Creating a taskflow 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.
12 Chapter 2: Taskflows
Sequential Tasks with Decision
Select the Sequential Tasks with Decision template if your major requirement is to run two Data Integration
consecutive tasks and then make a decision based on the output of either task. 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, 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 Optional. Overrides the API name that is auto generated when you publish the taskflow with a name
Name that you specify. When you select this option, the API Name field becomes available.
API Name Required if you select the Override API Name option.
A unique API name to override the auto-generated API name for the taskflow. The API name that you
specify in this field is used in the generated service URLs.
The API name can contain only alphanumeric characters, underscores (_), and hyphens (-), and must
not exceed 80 characters.
To change the API name of a published taskflow, you must first unpublish the taskflow. Then,
change the API name and republish the taskflow.
If you override the API name and import the taskflow, the imported taskflow uses the API name that
you specified. However, if there is an existing taskflow with the same API name that you specified,
Data Integration uses an auto-generated API name for the copied or imported taskflow to avoid
duplication. Data Integration also disables the Override API Name field. Similarly, if you copy the
taskflow, Data Integration uses an auto-generated API name for the copied taskflow to avoid
duplication and also disables the Override API Name field.
If you override the API name and move the taskflow to a different location, Data Integration retains
the API name that you specified.
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
Use the Start tab to define the binding type and access details for a taskflow.
Taskflow binding
The Binding property defines how a taskflow is invoked and run. You can select one of the following values:
REST/SOAP
If you select the REST/SOAP binding type, you can run the taskflow by using a REST or SOAP endpoint.
You can use the Allowed Groups and the Allowed Users fields to define the user groups and users who
can run a published taskflow as an API.
The following image shows the binding set to REST/SOAP, and the Allowed Groups and Allowed Users
fields:
14 Chapter 2: Taskflows
Event
If you select the Event binding type, the taskflow is invoked when the specified event occurs. For
example, a taskflow can be invoked upon an event such as arrival of a file in a file system. The Event
Source Name field is available where you can select the file listener that you created for the event.
The following image shows the binding set to Event and the Event Source Name field:
Taskflow access
If the taskflow uses the REST/SOAP binding type, you can define the user groups and users who can run a
published taskflow as an API in the Allowed Groups and the Allowed Users fields. If a user falls into either of
these categories, the user will have access to the taskflow service URL at run time.
If you do not configure both the Allowed Groups and the Allowed Users fields, Data Integration does not
generate the taskflow service URL. You can run and schedule the taskflow. However, you cannot run the
taskflow as an API.
Note: The Allowed Groups and the Allowed Users fields define the access details for running a taskflow as
an API. To configure permissions for running a taskflow from the taskflow designer or invoking a taskflow
through a file listener, you must create a role in Administrator and assign the required permissions.
Allowed Groups
Defines the groups that have access to the taskflow service URL at run time.
Use the Allowed Groups option when you want a group of users to have access to a taskflow service
URL. For example, you have a group called 'Order Approvers'. If you enter Order Approvers in the
Allowed Groups field, all users within the group will have access to the taskflow service URL.
The following image shows the Order Approvers group added to the Allowed Groups field:
16 Chapter 2: Taskflows
You can specify more than one group in the Allowed Groups field.
Allowed Users
Defines the users that have access to the taskflow service URL at run time.
Use the Allowed Users field when you want a specific user to have access to the taskflow service URL.
The following image shows a user jsmith in the Allowed Users field and the group Order Approvers in
the Allowed Groups field:
Users in the Order Approvers group and the user jsmith will have access to the taskflow service URL.
You can specify more than one user in the Allowed Users field.
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
a simple type or a custom type.
• Simple type: Create a simple type field to use common data types such as Checkbox, Date, Date Time,
Time, Number, Integer, and 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 Date, Date Time, Time, 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.
You can monitor the execution of the file listener and the events that occur on each run job of the file listener.
File listener log entries are listed on the File Transfer Logs page in Monitor.
Note: If you had selected the binding type for a taskflow as REST/SOAP and then change it to Event, Data
Integration deletes the input fields that you had previously added.
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 and an Ingestion 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:
18 Chapter 2: Taskflows
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.
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 Time, Integer, or Date.
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.
Advanced properties
You can configure a taskflow to suspend on a fault that occurs at the taskflow level. You can also configure
the taskflow to send an email notification to specified recipients when it is suspended on a fault.
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.
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.
Assignment step
When you add an Assignment step, you set some properties.
Property Description
Name The fully qualified field name. 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
20 Chapter 2: Taskflows
Data Task step
When you add a Data Task step, you set some properties.
General
Property Description
Data Task
Property Description
Data Task The mapping task, synchronization task, or PowerCenter task you add to the taskflow. Select from a list
of existing tasks.
Note: You must have an existing task to add to a taskflow. You cannot create a task during the taskflow
creation process.
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 19 for details.
Input Fields
The Input Fields section appears when you add a task to the taskflow.
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 45.
If the Data Task step uses a PowerCenter task or 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 override
the parameter file directory and parameter file name of the mapping task.
Output Fields
The Output Fields section appears after you add a task to the taskflow. The Output Fields section is an
exhaustive list of output data fields that appear when the task runs.
Note: For a mapping task that is based on an elastic mapping, success source rows and failed source rows
are not populated when the task runs.
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 the Monitor help.
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.
Timer Events
Enter the following Events properties to add timers to a 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 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:
22 Chapter 2: Taskflows
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 the 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.
If a Data Task step completes before a timer, interrupting or non interrupting, fires no timer will fire for that
Data Task step.
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.
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:
24 Chapter 2: Taskflows
Notification Task step
A Notification Task step sends a notification to specified recipients.
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.
The following sections describe the Notification Task step properties:
General properties
The following table describes the general properties:
Property Description
Property Description
Email Cc The recipients who need to be sent a copy of the email notification.
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 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 A short and descriptive subject that introduces the email.
Use one of the following options to specify the value for this field:
- Content. Enter a subject for the email.
- Field. Select the field that the Taskflow Designer uses to write the email subject into this field
when this step executes. You can select an input field or 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 Content The type of formatting that you want to use for the email content.
Type Select one of the following values:
- 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.
Default is Plain Text.
Email Body The content that you want to send in the email.
Use one of the following options to specify the value for this field:
- Content. Enter content for the email body.
- Field. Select the field that the Taskflow Designer uses to write the email body into this field when
this step executes. You can select an input field or 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.
If you selected the email content type as HTML, you can click Edit Content to open a rich text editor
for formatting the content.
• If the HTML content contains valid XML, use the XQuery function util:toXML in the Expression Editor to
serialize the content into the String format.
For example, if the HTML content is as follows:
<html>
<head>TaskDetails</head>
<body>
<table>
<tbody>
<tr>
<td>Task Name</td>
<td>Job Id</td>
<td>Status</td>
<td>Start Time</td>
<td>End Time</td>
</tr>
<tr>
<td>Williams</td>
<td>John</td>
<td>{fn:current-date()}</td>
</tr>
</tbody>
</table>
</body>
</html>
Use the following content in the Expression Editor to serialize the content into the String format:
util:toXML(<html>
<head>TaskDetails</head>
<body>
<table>
<tbody>
<tr>
<td>Task Name</td>
26 Chapter 2: Taskflows
<td>Job Id</td>
<td>Status</td>
<td>Start Time</td>
<td>End Time</td>
</tr>
<tr>
<td>Williams</td>
<td>John</td>
<td>{fn:current-date()}</td>
</tr>
</tbody>
</table>
</body>
</html>)
• If the HTML content does not contain valid XML, you must either convert the HTML content to valid XML
or use the String Concat function with an escape character.
The following example shows how to use the String Concat function with an escape character:
fn:concat("<html>
<head>TaskDetails</head>
<body>
<table>
<tbody>
<tr>
<td>Task Name</td>
<td>Job Id</td>
<td>Status</td>
<td>Start Time</td>
<td>End Time</td>
</tr>
<tr>
<td>Williams</td>
<td>John</td>
</tr>
</tbody>
</table>
</body>
</html>","")
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:
Property Description
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
• $PMTargetFileDir
• $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.
28 Chapter 2: Taskflows
Configure the following input fields for a Command Task step:
Runtime Required. The runtime environment that runs the command. This selection can be for a runtime
Environment environment or serverless runtime environment.
Use one of the following options to specify the value for this field:
- Content. Select a Secure Agent group.
- Field. Select the field that the Taskflow Designer uses to write the runtime environment into this
field when this step executes. You can select a runtime environment 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 runtime environment.
Script File Required. The path and name of the script file that you want to run.
Name 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 [Link] file located in the root directory, you can enter the value as
$PMRootDir/[Link].
Input Optional. The arguments that you want to pass to the script when it is executed.
Arguments 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
in double quotes (") and separate arguments with a comma (,).
- [Link] 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.
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, you can enter the
value as "$PMRootDir","$PMTempDir".
Work Optional. The path to the working directory where the output of the script is saved. By default, the
Directory output is saved in the path where the script is saved.
In a serverless runtime environment, the working directory is set to /command_scripts.
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.
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 or failed.
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 the Monitor help.
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:
30 Chapter 2: Taskflows
1. Main branch
2. Timer branch
In the example, Command Task 2 executes after five minutes and interrupts Command Task 1. The taskflow
executes only Command Task 2 and then ends. Command Task 1 has no output in this taskflow instance.
You see no output fields for Command Task 1 in the job details for the taskflow.
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.
Property Description
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.
Default is Suspend Taskflow.
The following image shows a Custom error handling path with an Assignment step and another Command
Task step:
Fault
After you run a Taskflow, you can view detailed information about the taskflow instance on the Jobs or My
Jobs page. Click the Command Task step to see properties specific to the task.
If the command task has faulted, you can view see the following fault details:
Property Description
In the File Watch Task step, you can select an existing file listener with the connector source type. You can
use file events to orchestrate taskflow execution. For example, you can wait for a file to arrive at a particular
location and then consume the file in a subsequent step.
32 Chapter 2: Taskflows
When you run a taskflow that contains a File Watch Task step, the associated file listener starts. When a file
event occurs, the file watch task runs and sends the file event details such as a list of arrived, updated, and
deleted files along with the file details. The taskflow then proceeds to the subsequent steps.
If a file event does not occur, by default, the taskflow waits for 5 minutes or for the overridden value defined
in the Time Out field. After that, the File Watch Task step completes and the taskflow proceeds to the
subsequent steps.
The maximum value that you can define in the Time Out field is 7 days. After 7 days, the taskflow status
changes to suspended.
The following sections describe the File Watch Task step properties:
General properties
In the general properties, you can specify a descriptive name for the File Watch Task step.
Input fields
You can add input fields to override the following file listener properties:
Output fields
When you add a file listener to the File Watch Task step, the following output field appears in the Output
Fields section:
Property Description
fileEvents A list of objects that return the file event details such as a list of arrived, updated, and deleted files along
with the file details.
Events
Configure the Events properties to add timers to a file watch 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 File Watch 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 Decision step (Decision 1) that occurs five minutes
after the main file watch task (File Watch Task 1) starts:
You can select the Interrupting option if you want the timer to interrupt the main file watch task.
The following image shows an interrupting timer set to occur five minutes after the main file watch task
starts:
1. Main branch
2. Timer branch
In the example, File Watch Task 2 executes after five minutes and interrupts File Watch Task 1. The taskflow
executes only File Watch Task 2 and then ends. File Watch Task 1 has no output in this taskflow instance.
You see no output fields for File Watch Task 1 in the job details for the taskflow.
If File Watch Task 1 completes before the timer, the taskflow executes only File Watch 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, File Watch Task 2 executes after five minutes and interrupts File Watch Task 1. The timer
branch rejoins the main branch. The taskflow executes File Watch Task 2, a Decision step, a Parallel Paths
step, and then ends.
34 Chapter 2: Taskflows
If File Watch Task 1 completes before the timer, the taskflow executes File Watch Task 1, a Decision step, a
Parallel Paths step, and then ends.
The On Error property defines the path that a taskflow takes when it encounters an error in a File Watch Task
step. An error occurs when a File Watch Task step fails. 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 that the taskflow follows if no error occurs.
The second branch is the custom path that the taskflow follows if an error occurs.
The following image shows a custom error handling path with a File Watch Task step:
Note: File ingestion tasks that use a file listener component as the source are not available for selection.
You might want to perform data integration operations after moving files to an intermediate location and
before transferring the files to the target. In this scenario, you can use the Ingestion Task step in conjunction
with the Data Task step.
For example, you can use the Ingestion Task step to read a large number of files from a source location and
write them to an intermediate location. You can then use the Data Task step to perform data integration
operations on the files and use another Ingestion Task step to write the updated files to the final target
location.
General properties
In the general properties, you can specify a descriptive name for the Ingestion Task step.
• General properties:
- Runtime Environment
- Source Connection
- Target Connection
• Source properties:
- Batch Size
- File Pattern
- Folder Path
- Source Directory
• Target properties:
- Folder Path
- Target Directory
Output fields
When you add a file ingestion task to the Ingestion Task step, the following output fields appear in the Output
Fields section:
Property Description
fileDetails A list of objects that return the file transfer details such as a list of created, updated, and deleted
files along with the file count.
Events
Configure the Events properties to add timers to an ingestion 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 an Ingestion 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 Decision step (Decision 1) that occurs five minutes
after the main ingestion task (Ingestion Task 1) starts:
36 Chapter 2: Taskflows
1. Main branch
2. Timer branch
In the example, the timer branch runs five minutes after Ingestion Task 1 starts. If Ingestion 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 ingestion task.
The following image shows an interrupting timer set to occur five minutes after the main ingestion task
starts:
1. Main branch
2. Timer branch
In the example, Ingestion Task 2 executes after five minutes and interrupts Ingestion Task 1. The taskflow
executes only Ingestion Task 2 and then ends. Ingestion Task 1 has no output in this taskflow instance. You
see no output fields for Ingestion Task 1 in the job details for the taskflow.
If Ingestion Task 1 completes before the timer, the taskflow executes only Ingestion 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, Ingestion Task 2 executes after five minutes and interrupts Ingestion Task 1. The timer
branch rejoins the main branch. The taskflow executes Ingestion Task 2, a Decision step, a Parallel Paths
step, and then ends.
The On Error property defines the path that a taskflow takes when it encounters an error in an Ingestion Task
step. An error occurs when an Ingestion Task step fails. 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 that the taskflow follows if no error occurs.
The second branch is the custom path that the taskflow follows if an error occurs.
The following image shows a custom error handling path with an Ingestion Task step:
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.
You can define properties for the subtaskflow. The following sections describe the Subtaskflow step
properties:
General properties
The following table describes the general properties:
Property Description
Subtaskflow properties
On the Subtaskflow tab, select the taskflow that you want to embed. Data Integration displays the
description, input fields, and output fields for the embedded taskflow.
38 Chapter 2: Taskflows
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.
Property Description
Catch faults Select this option to enable fault handling for the Subtaskflow step.
By default, this option is not selected.
Fault field name Required if you select the Catch faults option.
The name of the field that captures the fault information.
Default is faultInfo.
Decision step
When you add a Decision step, you set some properties
Property Description
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.
The conditions available depend on the field that you select.
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.
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.
Property Description
Parallel The paths that you want the taskflow to run in parallel.
Paths Click Add to add a new branch.
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.
40 Chapter 2: Taskflows
Jump step
When you add a Jump step, you set some properties.
Property Description
End step
An End step indicates the end of the taskflow. When execution reaches this step, the taskflow completes.
Property Description
Title The name of the step. You can edit this value.
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.
Property Description
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.
If a fault occurs in the Notification Task step, the Throw step is executed. 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.
42 Chapter 2: Taskflows
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
• File Watch Task
• Ingestion 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.
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.
Property Description
Fault fields
The following table describes the fault fields that you can configure:
Property Description
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.
If a PowerCenter task uses input parameters or in-out parameters, you can override the parameters in a
taskflow.
The following section explains input and in-out parameters and how you can use them in a taskflow:
44 Chapter 2: Taskflows
Input parameters
An input parameter is a placeholder for a value or values in a mapping or PowerCenter task. You define
the value of the parameter when you configure the mapping task or PowerCenter task. For more
information about input parameters, see Mappings and Tasks.
If a PowerCenter task uses input parameters, you can override the input parameters in a taskflow.
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.
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 [Link].
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 or
PowerCenter 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 or PowerCenter 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:
Parameters in taskflows 45
5. Perform one of the following steps:
a. To override the parameter file directory or parameter file name of a mapping task, expand the
TaskProperties Parameters list. Then, select Parameter File Directory or Parameter File Name.
b. To override an input parameter or in-out parameter of a mapping task or PowerCenter task, expand
the Input Parameters or InOut Parameters list. Then, navigate to and select the parameter that you
want to override.
6. Click Edit.
The Edit Value dialog box appears.
7. Under Source, select Content. For advanced use cases, you might select Field or Formula.
8. Under Value, enter the new parameter file directory, parameter file name, or parameter value that you
want to override the default value with.
9. Click OK.
• Use the Data Task step to override input parameters. However, in advanced cases, you can override input
parameters with an Assignment step.
• 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:
46 Chapter 2: Taskflows
• When you run a taskflow as an API, you can use the connection parameter to pass a connection name or
connection ID at run time.
For example, if you want to use the connection name, you must pass the connection name in the
connection parameter as shown in the following sample:
"source":{
"Source":{
"object":"abc",
"connection":"FileSourceConnectionName"
}
}
If you want to use the connection ID, you must pass the connection ID in the connection parameter as
shown in the following sample:
"source":{
"Source":{
"object":"abc",
"connection":"0100000B000000000004"
}
}
• 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 [Link].
• 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 [Link].
MyMT uses My File Connection to read from the [Link] file and My File Connection to write to the
[Link] file.
You want MyMT to use My File Connection read from the [Link] file and use table and then use My File
Connection to write to another output file, [Link] file.
Parameters in taskflows 47
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 [Link] to
[Link].
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.
48 Chapter 2: Taskflows
The Expression Editor
Use fields, functions, and operators to create expressions in the Expression Editor.
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.
• 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 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.
• 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.
50 Chapter 2: Taskflows
- 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.
• We use the Expression Editor to define the value of a third variable $r1 using the following rules:
- If the value of $n1 is greater than the value of $n2, $r1 takes the value: Greater: N1 > N2.
- 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.
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
52 Chapter 2: Taskflows
• 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
Data cleansing functions
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
• lastDay
• trunc
Numeric functions
You can use the following numeric function from the Numbers section of the Expression Editor:
• round(Numbers)
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)
Taskflow functions 53
• 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)
• 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.
54 Chapter 2: Taskflows
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:
Taskflow functions 55
DATE_SHIPPED RETURN VALUE
NULL NULL
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.
Note: Some databases might use a different algorithm to calculate the difference in dates.
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'.
56 Chapter 2: Taskflows
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:
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:
Taskflow functions 57
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 years between the DATE_PROMISED and DATE_SHIPPED
columns:
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'Y')
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'YY')
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'YYY')
date:dateDiff(xs:dateTime('DATE_PROMISED'), xs:dateTime('DATE_SHIPPED'), 'YYYY')
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')
58 Chapter 2: Taskflows
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)
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: '()'
or "()"
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: '()'
or "()"
Taskflow functions 59
Argument Required/ Description
Optional
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: '()'
or "()"
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: '()'
or "()"
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.
You cannot create a decode function with both string and numeric return values.
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',
60 Chapter 2: Taskflows
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:
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.
Taskflow functions 61
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
getDatePart
Returns the specified part of a date as an integer value. Therefore, if you create an expression that returns
the month portion of the date, and pass a date such as Apr 1 1997 [Link], getDatePart returns 4.
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.
62 Chapter 2: Taskflows
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. [Link]M 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')
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:
Taskflow functions 63
DATE_SHIPPED RETURN VALUE
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.
Syntax
util:getInstanceStartTime()
The getInstanceStartTime function does not use an argument.
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:[Link]
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-19T[Link].047Z
iif
Returns one of two values that you specify based on the results of a condition.
Syntax
util:iif(condition, val1 ,val2)
64 Chapter 2: Taskflows
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:
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:
Taskflow functions 65
SALES EMP_NAME RETURN VALUE
in
Matches input data to a list of values. By default, the match is case sensitive.
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.
66 Chapter 2: Taskflows
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
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.
Taskflow functions 67
Argument Required/ Description
Optional
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
68 Chapter 2: Taskflows
COMPANY RETURN VALUE
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’.
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 )
Taskflow functions 69
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.
70 Chapter 2: Taskflows
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 [Link].
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:
Taskflow functions 71
DATE RETURN VALUE
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.
72 Chapter 2: Taskflows
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 do not specify the trim_set argument in the expression, ltrim removes both single-byte and double-byte
spaces from the beginning of a string.
Taskflow functions 73
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: '()'
or "()"
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: '()'
or "()"
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
74 Chapter 2: Taskflows
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)
The following table describes the argument for this command:
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.
Taskflow functions 75
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)
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)
76 Chapter 2: Taskflows
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
matches any character in the trim_set, rtrim removes it. The rtrim function continues comparing and
removing characters until it fails to find a matching character in the trim_set. It returns the string without the
matching characters.
Syntax
sff:rtrim(str, trim_set)
Taskflow functions 77
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: '()'
or "()"
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: '()'
or "()"
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
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.
78 Chapter 2: Taskflows
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:
Return Value
String.
Taskflow functions 79
Double Conversion Example
The following expression converts the double values in the SALES port to strings:
sff:toChar(xs:double(SALES))
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'
1234567890123456789012345679 '1234567890123456789012345679'
1.234578945469649345876123456 '1.234578945469649345876123456'
80 Chapter 2: Taskflows
SALES RETURN VALUE
0.999999999999999999999999999 '0.999999999999999999999999999'
12345678901234567890123456799 '1.23456789012346e+028'
(greater than 28)
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 [Link]M', 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 [Link].000000000. You can map the results of this function to any
target column with a datetime data type.
Warning: The format of the toDate string must match the format string including any date separators. If it
does not, toDate might return inaccurate values or skip the record.
Examples
date:toDate(xs:dateTime('DATE_PROMISED'), 'MM/DD/YY')
The following table lists some sample values and return values:
Taskflow functions 81
DATE_PROMISED RETURN VALUE
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
[Link].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')
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')
82 Chapter 2: Taskflows
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
toDecimal
Converts a string or numeric value to a decimal value. The toDecimal function ignores leading spaces.
Syntax
util:toDecimal(value, scale)
Taskflow functions 83
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.
You cannot omit this argument in an elastic mapping.
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
'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')
84 Chapter 2: Taskflows
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)
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
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.
Taskflow functions 85
0 if a value passed to the function contains alphanumeric characters.
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.
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 [Link].000000000. For example, the following expression returns 1/1/1997 [Link].000000000:
date:trunc(xs:dateTime('12/1/1997 [Link]'), '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 [Link].000000000. For example, the following expression returns 4/1/1997
[Link].000000000:
date:trunc(xs:dateTime('4/15/1997 [Link]'), 'MM')
• Day. If you truncate the day portion of a date, the function returns the date with the time set to
[Link].000000000. For example, the following expression returns 6/13/1997 [Link].000000000:
date:trunc(xs:dateTime('6/13/1997 [Link]'), '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 [Link].000000000:
date:trunc(xs:dateTime('4/1/1997 [Link]'), 'HH')
86 Chapter 2: Taskflows
• 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 [Link].000000000:
date:trunc(xs:dateTime('5/22/1997 [Link]'), '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 [Link].000000000:
date:trunc(xs:dateTime('5/22/1997 [Link].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 [Link].135000000:
date:trunc(xs:dateTime('5/22/1997 [Link].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:
'()' or "()"
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:
'()' or "()"
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:
Taskflow functions 87
DATE_SHIPPED RETURN VALUE
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:
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')
88 Chapter 2: Taskflows
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
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.
You can also create one or more taskflow inputs and run the taskflow with the inputs. To run the
taskflow using taskflow inputs, open the taskflow, and then from the Actions menu, select Run Using.
As an API
To run a taskflow as an API, you must first publish the taskflow as a service, and then run it. When you
publish a taskflow, Data Integration generates the service URL and the SOAP service URL. You can use
these endpoint URLs to run the taskflow as an API. When you run a taskflow as an API, you can
dynamically provide input parameters for the tasks that the taskflow contains and perform
orchestration.
To run a taskflow using the RunAJob utility, the taskflow must be published. To use the RunAJob utility,
type the RunAJob utility command [Link] runAJobCli followed by arguments.
You can invoke a taskflow through a connector file listener. Within the taskflow, define the binding type
as Event and select the connector file listener as the event source. When you publish the taskflow, the
taskflow subscribes to the connector file listener that is defined in it. When a file event occurs, the
connector file listener invokes the taskflow. For example, if you configure the connector file listener to
listen for new files on a folder, the connector file listener invokes the associated taskflow each time a
new file arrives in the specified folder.
90 Chapter 2: Taskflows
According to a schedule
To run a taskflow on a schedule, create a schedule in Administrator and associate the taskflow with the
schedule.
For more information about schedules, see Schedules in the Administrator help.
To run a taskflow using taskflow inputs, you must include values for Allowed Users and Allowed Groups in
the taskflow designer.
You can create a taskflow input in JSON or XML format. Then, validate and save the taskflow input.
When you export, copy, or move a taskflow that contains taskflow inputs, the taskflow inputs are retained.
1. On the Explore page, navigate to the taskflow for which you want to create a taskflow input.
2. From the Actions menu, select Run Using.
The Test Taskflow Input Collection page opens.
The following image shows the Test Taskflow Input Collection page:
The Custom Type section shows the custom type input fields that the taskflow uses. For more
information about custom type fields, see Creating an input field with a custom typeon page 18.
5. From the Encoding list, select JSON or XML based on the format that you want to work with and specify
the taskflow input.
Note: If the taskflow contains input fields with space characters in them, select JSON as the encoding
type.
6. Click the Validate icon to validate the syntax of the taskflow input.
A confirmation message appears stating if the validation was successful or not. If the validation fails,
correct the syntax of the taskflow input and validate again.
7. Click Save to save the taskflow input.
You can click Save As to save the taskflow input with a different name. You can also click the Reset icon
to reset a taskflow input to the last saved taskflow input.
After you create taskflow inputs, you can run the taskflow with the required inputs.
92 Chapter 2: Taskflows
Running a taskflow with taskflow inputs
After you publish a taskflow and create taskflow inputs, you can run the taskflow with taskflow inputs to test
it. After you run the taskflow, you can view details of the taskflow execution.
1. On the Explore page, navigate to the taskflow that you want to run with one or more taskflow inputs.
2. To run a taskflow with a specific taskflow input or all the taskflow inputs, from the Actions menu, select
Run Using.
The Test Taskflow Input Collection page opens.
The following image shows the Test Taskflow Input Collection page:
Note: The Run Using option is disabled if the taskflow contains unsaved or unpublished changes. To run
the taskflow, you must save and publish the taskflow.
3. Perform one of the following steps:
• To run the taskflow with a specific taskflow input, select the taskflow input and click Run.
• To run the taskflow with all the taskflow inputs, click Run All.
Data Integration runs the taskflow with the specified inputs. After the taskflow execution is complete,
the Taskflow Execution Status page opens displaying details of the successful and unsuccessful
taskflow executions. For long running taskflows, it might take some time for the Taskflow Execution
Status page to appear.
The following image shows the Taskflow Execution Status page:
1. On the Explore page, navigate to the taskflow for which you want to delete a taskflow input.
2. From the Actions menu, select Run Using.
The Test Taskflow Input Collection page opens.
The following image shows the Test Taskflow Input Collection page:
94 Chapter 2: Taskflows
3. Select the taskflow input that you want to delete from the Select the input to run the taskflow with field
and click the Delete icon.
A message appears prompting you to confirm the taskflow input deletion.
4. Click Delete to proceed with the deletion or click Cancel to cancel the deletion.
When you publish a taskflow, Data Integration generates the service URL and the SOAP service URL. You can
use these endpoint URLs to run the taskflow as an API. When you run a taskflow as an API, you can
dynamically provide input parameters for the tasks that the taskflow contains and perform orchestration.
Note: When you run a taskflow from the taskflow designer, Data Integration automatically publishes the
taskflow, and generates the service URL and SOAP service URL.
If you edit a published taskflow, you must publish the taskflow again for the changes to get reflected in the
taskflow API.
To disable a taskflow API that was published as a service, you must unpublish the taskflow. After you make
the necessary changes, publish the taskflow again for the changes to get reflected in the taskflow API.
96 Chapter 2: Taskflows
• If you use a REST client, use the service URL and the API definition available in the Swagger file to
send a request through the REST client.
• If you use a SOAP client, use the SOAP service URL and the API definition available in the WSDL file to
send a request through the SOAP client.
You can pass inputs using the service URL through a browser or a third-party tool. For more information,
see “Passing inputs through a browser” on page 97 or “Passing inputs through a REST client” on page
97.
You receive the taskflow run ID as the response.
6. To monitor the taskflow with the run ID, perform one of the following steps:
• Use the run ID to monitor the taskflow run in the My Jobs page. The instance name uses the
following format:
<taskflow name>-<run ID>
• Use the status resource to query the status of the taskflow based on the run ID. For more information
about using the status resource, see “Monitoring taskflow status with the status resource” on page
101.
1. Open the taskflow and click Actions > Properties Detail > Copy Service URL.
2. Open a text editor and add the input field and value to the service URL as shown below:
<Informatica Intelligent Cloud Service URL>/active-bpel/rt/<API_name>?
<inputfield>=<value>
For example: [Link]
CustomerName=TestConsumer
To pass values for more than one field, use & to separate the input fields as shown below:
[Link]
CustomerName=TestConsumer&CustomerEmail=testconsumer@[Link]&ItemName=item1&ItemCo
unt=2
3. Open a browser and paste the service URL with the input fields and values. If the taskflow uses
authentication, you must enter the allowed user name and password.
The service returns the taskflow run ID as the response. You can monitor the taskflow execution by
using the run ID.
98 Chapter 2: Taskflows
Running a taskflow using RunAJob utility
You can use the RunAJob utility to run jobs or check job status instead of making calls directly through the
Informatica Intelligent Cloud Services REST API.
To run a taskflow using the RunAJob utility, the taskflow must be published and you must include values for
the Allowed Users and Allowed Groups fields in the taskflow designer.
For information about running a taskflow using the RunAJob utility, see Rest API Reference.
Within a taskflow, you can define the binding type as Event and select the connector file listener as the event
source. When you publish the taskflow, the taskflow subscribes to the connector file listener that is defined
in it. When a file event occurs, the connector file listener invokes the taskflow. For example, if you configure
the connector file listener to listen for new files on a folder, the connector file listener invokes the associated
taskflow each time a new file arrives in the specified folder.
You can monitor the execution of the connector file listener and the events that occur on each run job of the
connector file listener. Connector file listener log entries are listed on the File Transfer Logs page in Monitor.
The connector file listener logs show the name, size, last modified date and time, file path, event type, and
event time.
1. Create a connector file listener and define the event that will invoke the taskflow.
2. Start or schedule the connector file listener.
The connector file listener must be running when you publish the taskflow.
3. Create a taskflow.
4. Click the Start step of the taskflow.
5. Click the Start tab.
6. In the Binding field, select Event.
7. In the Event Source Name field, select the connector file listener that you configured.
Data Integration creates an input field to store details of the files that arrived, were updated, or were
deleted as part of the connector file listener event. The input field takes the name of the connector file
listener.
8. Add steps to the taskflow as needed.
9. Save and publish the taskflow.
To unsubscribe from the connector file listener, unpublish the taskflow.
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 Schedules in the Administrator help.
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.
• 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.
GET request
To query the status of a taskflow, use the following URL:
<Informatica Intelligent Cloud Services URL>/active-bpel/services/tf/status/<run ID>
The GET request must be authenticated in one of the following ways:
• Use basic authorization and specify the Informatica Intelligent Cloud Services user name and password.
• Use the INFA-SESSION-ID in the HTTP header. To get the INFA-SESSION-ID, you must use the Platform
REST API version 3 login resource. For more information about the login resource, see REST API
Reference.
You must also specify the following HTTP header: Accept: application/json
GET response
Returns the taskflow status information if successful or an error object if errors occur.
duration String Time in seconds that the taskflow ran before it completed, was suspended, or was
stopped.
endTime Date/time End time for the taskflow run. Uses Coordinated Universal Time (UTC).
location String The project and folder path where the taskflow is located.
runtimeEnvName String Name of the runtime environment where the taskflow runs.
startTime Date/time Start time for the taskflow run. Uses Coordinated Universal Time (UTC).
updateTime Date/time Last time the taskflow run status was updated. Uses Coordinated Universal Time
(UTC).
subtaskDetails String Object that contains status details for all subtasks in the taskflow.
details String Status details. Includes status information for each subtask in the tasks object.
tasks Collection Status information for all subtasks that the taskflow contains.
The tasks object includes the following status information for each subtask that the taskflow contains:
assetType String Type of the subtask. Returns one of the following values:
- MTT. Mapping task.
- DSS. Synchronization task.
duration String Time in seconds that the subtask ran before it completed or was stopped.
endTime Date/time End time for the subtask run. Uses Coordinated Universal Time (UTC).
location String The project and folder path where the subtask is located.
runtimeEnvName String Name of the runtime environment where the subtask runs.
startTime Date/time Start time for the subtask run. Uses Coordinated Universal Time (UTC).
startedBy String User who started the task. This field is the same as the user who started the
taskflow.
subtasks String Reserved for future use. When this field is returned for a subtask, the value is always
0.
successRows String Total number of rows that were processed successfully in a subtask.
updateTime Date/time Last time the subtask run status was updated. Uses Coordinated Universal Time
(UTC).
GET Example
The following example shows a taskflow status request:
GET [Link]
Accept: application/json
INFA-SESSION-ID: 9KA11tLGqxVcGeul8SQBK3
Based on the taskflow configuration and request inputs, the response can be of the following types:
If the request is successful and the taskflow does not contain subtasks, the response includes taskflow
status information as shown in the following example:
{
"assetName": "Empty",
"assetType": "TASKFLOW",
"duration": 2,
"endTime": "2018-12-25T[Link]Z",
"errorMessage": "",
"location": "Default",
"runId": 262247166322413568,
"runtimeEnv": "tf_runtime",
"runtimeEnvName": "",
"startTime": "2018-12-25T[Link]Z",
"startedBy": "sb",
"status": "SUCCESS",
"subtasks": 0,
"updateTime": "2018-12-25T[Link]Z",
"subtaskDetails": {
"details": {}
}
}
The HTTP status code is 200 OK.
If the request is successful and the taskflow contains multiple subtasks, the response includes status
information for each subtask that the taskflow contains as shown in the following example:
{
"assetName": "Taskflow1",
"assetType": "TASKFLOW",
"duration": 89,
"endTime": "2018-12-23T[Link]Z",
"errorMessage": "",
"location": "Default",
"runId": 20262247166322413568,
"runtimeEnv": "tf_runtime",
"runtimeEnvName": "",
"startTime": "2018-12-23T[Link]Z",
"startedBy": "sb",
"status": "SUCCESS",
"subtasks": 2,
"updateTime": "2018-12-23T[Link]Z",
"subtaskDetails": {
"details": {
"tasks": [
{
"assetName": "MTR",
"assetType": "MTT",
"duration": "3",
"endTime": "2018-12-23T[Link]Z",
"errorMessage": "",
"errorRows": "0",
"location": "Default",
"rowsProcessed": "7",
"runId": "4",
"runtimeEnv": "01001Q25000000000002",
"runtimeEnvName": "tf_runtime_devagent",
"startTime": "2018-12-23T[Link]Z",
"startedBy": "sb",
"status": "COMPLETED",
"subtasks": "0",
"successRows": "7",
"updateTime": "2018-12-23T[Link]Z"
},
{
"assetName": "MTR",
"assetType": "MTT",
"duration": "10",
"endTime": "2018-12-23T[Link]Z",
"errorMessage": "",
"errorRows": "0",
"location": "Default",
"rowsProcessed": "7",
"runId": "3",
"runtimeEnv": "01001Q25000000000002",
"runtimeEnvName": "tf_runtime_devagent",
"startTime": "2018-12-23T[Link]Z",
"startedBy": "sb",
"status": "COMPLETED",
"subtasks": "0",
"successRows": "7",
"updateTime": "2018-12-23T[Link]Z"
}
]
}
}
}
The HTTP status code is 200 OK.
Empty run ID
Invalid run ID
Taskflow example
You can add multiple data integration tasks to a taskflow and run them sequentially or in parallel.
The following example shows how to create a taskflow to run two mapping tasks in parallel. The example
assumes that you know how to create a connection, a mapping, and a mapping task.
• A mapping task that maps a flat file database to a flat file database.
• A mapping task that maps a MySQL database to a flat file database.
Perform the following steps to create a taskflow and monitor the progress of the taskflow:
Property Value
Name Taskflow2MT
Location Click Select and browse to the location where you want to save the taskflow.
For this use case, you do not need to enter Input Fields, Temp Fields or Notes properties.
Linear taskflows
You can create a linear taskflow to group multiple data integration tasks. A linear taskflow runs tasks serially
in the order that you specify.
Use linear taskflows when you want to create a simple taskflow. For example, you want to update a list of
contacts on a monthly basis. To do so, you want to upsert recent account information and then upsert
contact information for each account. You create a taskflow with a synchronization task to upsert accounts
followed by a synchronization task to upsert contacts for the accounts. You schedule the linear taskflow to
run each month.
Linear taskflows are a simplified version of the Data Integration taskflow feature. Linear taskflows cannot
control the execution sequence of tasks based on the previous task in the taskflow. If you want to create a
dynamic taskflow, see Chapter 2, “Taskflows” on page 9.
• Synchronization task
• Replication task
• Mapping task
• Masking task
• PowerCenter task
You can edit linear taskflows. If you add a task to a linear taskflow that is currently running, Data Integration
does not run the new task until the next time the linear taskflow runs.
Note: If you want to delete a linear taskflow, be sure that no users in the organization plan to use it. You
cannot retrieve a linear taskflow after you delete it.
108
Scheduling linear taskflow jobs
You can run linear taskflows manually or you can use schedules to run them at a specific time or interval
such as hourly, daily, or weekly.
To run a linear taskflow on a schedule, you associate the linear taskflow with a schedule during
configuration. You can use an existing schedule or create a new schedule.
If you remove a linear taskflow from a schedule as the linear taskflow runs, the job completes. Data
Integration cancels any additional runs associated with the schedule.
For more information about using and creating schedules, see Tasks.
1. To create a linear taskflow, click New > Taskflows > Linear Taskflow, and then click Create.
To edit a linear taskflow, on the Explore page, navigate to the linear taskflow. In the row that contains
the linear taskflow, click Actions and select Edit.
2. Enter the following details for the linear taskflow:
Field Description
Taskflow Name of the linear taskflow. Names can contain alphanumeric characters, spaces, and the
Name following special characters:
_ . + -
Names are not case sensitive.
Location Location of the linear taskflow. Browse to the folder where you want to store the linear taskflow
or use the default location.
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.
Schedule Determines how the task runs. Choose from the following options:
- Manually. You might want to run a linear taskflow manually to verify that the linear taskflow
and tasks are configured properly.
To run the task manually, click Do not run this task on a schedule.
- On a schedule. When you configure a linear taskflow to run on a schedule, include a repeat
frequency to run the linear taskflow on regular intervals.
To associate the task with a schedule, click Run this task on a schedule and select a
schedule.
To create a schedule, click New.
Field Description
Use default email notification Use the email notification options configured for the organization.
options for my organization
Use custom email Use the email notification options configured for the task. You can send an
notification options for this email to different addresses based on whether the task failed, completed with
task errors, or completed successfully.
Use commas to separate a list of email addresses.
When you select this option, Data Integration does not use the email notification
options configured for the organization.
• Manually
To run a linear taskflow manually, on the Explore page, navigate to the taskflow. In the row that contains
the taskflow, click Actions and select Run. Or, you can open a linear taskflow and click Run.
• On a schedule
To run a linear taskflow on a schedule, configure the taskflow to associate it with a schedule.
You can also stop a task that is running in the linear taskflow. You might want to stop a task that is running in
a linear taskflow if the task is running longer than expected. You can't stop a subtask that is running in a
task.
If you stop the last task, the status of the linear taskflow job is Failed.
If you stop a task other than the last task in the linear taskflow, whether the linear taskflow job stops or
continues depends on whether the Stop on Error property is enabled:
• If Stop on Error is enabled, the linear taskflow job stops running. The status of the job is Failed.
• If Stop on Error is not enabled, the linear taskflow job resumes with the next task in the flow. When the job
completes, the status of the job is Warning because all of the tasks in the linear taskflow didn't complete.
For more information about stopping tasks and taskflow jobs, see Tasks. For more information about
monitoring and stopping jobs, see the Monitor help.
A F
addToDate function format
description 53 from character string to date 81
C G
character functions getAssetLocation function
instr 67 description 61
ltrim 73 getAssetName function
rtrim 77 description 62
character strings getDatePart function
converting to dates 81 description 62
characters getInstanceStartTime function
adding to strings 72 description 64
removing from strings 73, 77
Cloud Application Integration community
URL 6
Cloud Developer community
I
URL 6 iif function
components description 64
linear taskflows 108 in function
conversion functions description 66
toChar (numbers) 79 Informatica Global Customer Support
toDate 81 contact information 7
toDecimal 83 Informatica Intelligent Cloud Services
toInteger 85 web site 6
instr function
description 67
D integers
converting other values 85
data cleansing functions isNull function
in 66 description 70
Data Integration community
URL 6
date functions
addToDate 53
J
dateDiff 56 jobs
getDatePart 62 scheduling linear taskflows 109
lastDay 70
trunc 86
date/time values
adding 53
L
dateDiff function lastDay function
description 56 description 70
dates linear taskflows
truncating 86 configuring 109
decimal values description 108
converting 83 running 110
decode function scheduling 109
description 59 stopping 111
lpad function
description 72
lstatus resource
taskflows 101
112
ltrim function subseconds
description 73 processing in trunc function 86
system status 7
M
maintenance outages 7
T
month taskflow functions
returning last day 70 getAssetLocation 61
getAssetName 62
getInstanceStartTime 64
N taskflows
creating a taskflow 11
Notification Task step expression editor 49
configuring properties 25 overview 9
rules and guidelines 26 parameters in taskflows 44
NULL values running a taskflow 90
checking for 70 sample taskflow 105
isNull 70 taskflow properties 13
numbers taskflow step properties 20
rounding 75 taskflow steps 9
numeric functions taskflow templates 11
round (numbers) 75 types of 8
numeric values validation panel 89
converting to text strings 79 taskflows, linear
configuring 109
test functions
R isNull 70
text strings
round (numbers) function converting numeric values 79
description 75 toChar (numbers) function
rounding description 79
numbers 75 toDate function
rtrim function description 81
description 77 toDecimal function
description 83
toInteger function
S description 85
trunc function
scheduling description 86
linear taskflows 109 processing subseconds 86
special functions truncating
decode 59 dates 86
iif 64 trust site
status description 7
Informatica Intelligent Cloud Services 7
string functions
lpad 72
strings
U
adding blanks 72 upgrade notifications 7
adding characters 72
character set 67
converting character strings to dates 81
converting numeric values to text strings 79
W
removing blank characters 73 web site 6
removing blank characters and characters 77
removing characters 73
Index 113