Lead your team forward
OCT 24 / 9AM ET Register nowRead File Variables
Reads workflow variables from a source file.
Source files contain properties defined as key-value pairs (syntax property.key=property.value
) with one property per line.
If a line is not correctly structured, the property is skipped. Using whitespaces in values is allowed at any position in the string, for example, 'key= value ' or 'key=va lue'. For more information about how source files are parsed, see the Java documentation on the Properties class.
If the source file contains duplicated keys, the task fails.
In case the limit set in maxLines
is exceeded or a property value cannot be converted to one of input data types, a warning is issued.
You can also specify which properties should be read from the source file along with a specific data type and format parameters (see xref:File variable strategy). Once the data is loaded, you can reuse the values across the workflow using the following syntax:
${ewfGetTaskVariable("task_name", "key")}
For more information about working with workflow variables, see Workflow Variables.
Properties
Name | Type | Description | Expression support |
---|---|---|---|
Source File |
mandatory |
Source file that the task should read.
The default extension is |
none |
Encoding |
mandatory |
Encoding used in the source file. The possible encodings are all encodings supported by the target Java platform. Some commonly used encodings are: ISO-8859-1, ISO-8859-2, and UTF-8. |
none |
Max Lines |
optional |
Maximum number of lines that the task reads from the source file.
Default value: |
none |
File variable strategy
Name | Type | Description | Expression support |
---|---|---|---|
Implementation |
mandatory |
Type of file variable strategy.
Must be set to |
none |
Variables
Name | Type | Description | Expression support |
---|---|---|---|
Name |
mandatory |
Name of the variable. |
none |
Type |
mandatory |
Defines how to read the variable value. Currently supported types are: STRING, INTEGER, LONG, FLOAT, DAY, DATETIME, BOOLEAN. |
none |
Data Format Parameters |
optional |
Default data format parameters for the correct formatting of data in the source file. For more information, see Data format parameters. |
none |
Data format parameters
Name | Type | Description | Expression support |
---|---|---|---|
Array Separator |
optional |
Defines which character is used as the array separator. |
none |
Date Format Local |
optional |
Defines the locale for parsing non-numerical data (for example, short forms of months in dates, such as Sep 18, 1999). The value is the same as the value of the corresponding locale in Java (see Java locales). |
none |
Date Time Format |
optional |
Defines the format that should be used for processing DATETIME data.
The template is based on |
none |
Day Format |
optional |
Defines the format that should be used for processing DAY data.
The template is based on |
none |
Decimal Separator |
optional |
Defines which character is used as the decimal separator. Escaped string property. |
none |
False Value |
optional |
String value representing a logical |
none |
Thousand Separator |
optional |
Defines the string that represents the thousands separator (used in numbers). A non-escaped character is expected. Numbers do not need to contain this separator, but when the separator is present, it is processed (stripped) accordingly. Escaped string property. Default value: |
none |
True Value |
optional |
String value representing a logical |
none |
Example
<?xml version='1.0' encoding='UTF-8'?>
<EwfTaskElement>
<acceptMode>ALL_VALID</acceptMode>
<executable maxLines="1000" encoding="UTF-8" className=.ataccama.adt.task.exec. sourceFile="variables.ewfv">
<fileVariableStrategy className=.ataccama.adt.variables.read.>
<variables>
<variableMapping name="variable1" type="STRING">
<dataFormatParameters falseValue="false" dateTimeFormat="yy-MM-dd HH:mm:ss" decimalSeparator="." dayFormat="yy-MM-dd" trueValue="true" dateFormatLocale="en_US" thousandsSeparator=""/>
</variableMapping>
<variableMapping name="variable2" type="STRING">
<dataFormatParameters falseValue="false" dateTimeFormat="yy-MM-dd HH:mm:ss" decimalSeparator="." dayFormat="yy-MM-dd" trueValue="true" dateFormatLocale="en_US" thousandsSeparator=""/>
</variableMapping>
</variables>
</fileVariableStrategy>
</executable>
<id>read_variable</id>
<priority>0</priority>
</EwfTaskElement>
Was this page useful?