Table of Contents

Search

  1. Preface
  2. Workflows
  3. Workflow Variables
  4. Workflow Parameters
  5. Cluster Tasks
  6. Command Task
  7. Human Task
  8. Mapping Task
  9. Notification Task
  10. Gateways
  11. Workflow Recovery
  12. Workflow Administration

Developer Workflow Guide

Developer Workflow Guide

Assign a Value with an Assignment Task

Assign a Value with an Assignment Task

An Assignment task assigns a value to a user-defined workflow variable.
When you create a user-defined workflow variable, you enter an initial value. The Data Integration Service uses the initial value of the variable when the workflow starts. You can add an Assignment task to the workflow to assign another value to the variable. The Data Integration Service uses the assigned value for the variable during the remainder of the workflow.
For example, you create a counter variable and set the initial value to 0. In the Assignment task, you increment the variable by setting the variable to its current value plus 1.
When you add an Assignment task to a workflow, you select the user-defined variable whose value you want to change. Then, you write an expression to assign a value to the selected variable.
The following table lists the values that you can assign to a user-defined variable:
Value
Example
Literal value
For example, to assign the value 500 to a user-defined variable, enter the following value in the expression:
500
Workflow parameter
For example, to assign the value of a workflow parameter to a user-defined variable, enter the following value in the expression:
$par:MyParameter
Workflow system or user-defined variable
For example, to assign the value of a workflow system or user-defined variable to another user-defined variable, enter the following value in the expression:
$var:MyVariable
Any valid expression using the transformation language functions and operators
The expression must return a boolean, date, integer, or string value. Use a conversion function to convert a return value with another datatype to one of the supported datatypes.
For example, to assign the value of an expression to a user-defined variable, enter the following value in the expression:
LENGTH('test')
If you use the equality operator (=) in the expression, the Data Integration Service checks whether both sides of the expression are equal and returns true or false. For example, the following expression assigns either true or false to the selected user-defined variable:
$var.MyVariable = 7 + 5
You cannot assign values to system workflow variables.

0 COMMENTS

We’d like to hear from you!