-
Notifications
You must be signed in to change notification settings - Fork 83
transformer
Icon |
|
---|---|
Use When |
An attribute in a model based message needs transformed in one way or another (trim, substring, constants, etc.) |
Samples |
|
Description |
The transformer component allows transformation functions to be applied to record elements from inbound messages. |
Inbound Message Type |
Model Based Message |
Output Message Type |
Model Based Message |
Control Message Handling |
Input: Entity messages are processed as they are received, if a control message is received and 'Pass Along Control Messages' is checked then the control message is also forwarded. Output: A single control message will be forwarded to downstream components once all messages have been processed through this step unless the 'Pass Along Control Messages' property is checked (see below) then all control messages are forwarded. |
Name | Description |
---|---|
Whether to forward failed messages and continue processing. This is the name of a linked component to forward the failed messages to. |
|
Pass Along Control Messages |
Whether to pass all input control messages to output links |
Double clicking on the Transformer in the flow will result in the Transformer editor being displayed as shown below.
The editor displays a row for every entity and attribute in the input model, and allows and allows transform functions to be applied to each. The following transform functions are available:
Function | Description |
---|---|
abbreviate(maxwidth) |
Abbreviates the attribute using ellipses. This will turn "Now is the time for all good men" into "Now is the time for…" |
currentdate() |
Replaces the attribute with the current date and time |
currentdate(format) |
Replaces the attribute with the current system date and time formatted based on the format expression. See Date Format Expression for details on the date format specification. |
daysFromNow(numberDays) |
Replaces the attribute with the date of current date + numberDays |
flowParameter(parameterName) |
Replaces the attribute wih the flow parameter specified by name parameterName |
format(spec) |
Formats the attribute into a string according to the provided spec. See Java Formatter class for details on the specification string |
formatdate(pattern) |
Formats the date attribute according to the pattern parameter. See Date Format Expression for details on the date format specification. |
getAttributeValueByName(attributeName) |
Gets the value of the specified attribute. Could be used to reference a different attribute from within the current one. |
integer() |
Converts the attribute to an integer |
left(length) |
Truncates the attribute to the left-most length digits |
lower() |
Converts the attribute to lower case |
lpad(padChar,length) |
Left pads the attribute with length padChar characters |
messageParameter(paramterName) |
Replaces the attribute with the given message parameter specified by name parameterName |
nullvalue() |
Replaces the attribute with the null value |
nvl(substituteForNull) |
Conditionally replaces the attribute with substituteForNull value if the attribute is null |
parseAndFormatDate(parsePattern,formatPattern) |
Parses the string attribute into a date based on the parsePattern and then formats it into a date time string according to the formatPattern parameter |
parseBigDecimal() |
Parses the string attribute into a Big Decimal |
parseDouble() |
Parses the string attribute into a Double |
parseInt() |
Parses the string attribute into an Integer |
parseLong() |
Parses the string attribute into a Long |
parsedate(pattern) |
Parses the string into a Date based on the pattern. See Date Format Expression for details on the parse pattern |
replace(searchString,replacement) |
Find and replace searchString with replacement. Tip: You can chain replace() calls. e.g., replace("1","a").replace("2","b") |
right(length) |
Truncates the attribute to the right-most length digits |
rpad(padChar,length) |
Right pads the attribute with length padChar characters |
sequence(seedValue, incrementValue, breakField) |
Increments a sequence by incrementValue starting at seedValue. Restarts at seedValue when breakField changes. breakField is an attribute name for the current entity record. |
substr(start,end) |
Returns the substring of the value beginning with the character at the specified start index and extends to the end index - 1 |
stringConstant(value) |
Replaces the attribute value with the constant value provided |
trim() |
Removes leading and trailing whitespace |
upper() |
Converts the attribute to uppercase |
Format and parse expressions for dates can be defined using the following designations.
Letter | Date or Time Component | Presentation | Examples |
---|---|---|---|
G |
Era designator |
Text |
AD |
y |
Year |
Year |
1996; 96 |
M |
Month in year |
Month |
July; Jul; 07 |
w |
Week in year |
Number |
27 |
W |
Week in month |
Number |
2 |
D |
Day in year |
Number |
189 |
d |
Day in month |
Number |
10 |
F |
Day of week in month |
Number |
2 |
E |
Day in week |
Text |
Tuesday; Tue |
a |
Am/pm marker |
Text |
PM |
H |
Hour in day (0-23) |
Number |
0 |
k |
Hour in day (1-24) |
Number |
24 |
K |
Hour in am/pm (0-11) |
Number |
0 |
h |
Hour in am/pm (1-12) |
Number |
12 |
m |
Minute in hour |
Number |
30 |
s |
Second in minute |
Number |
55 |
S |
Millisecond |
Number |
978 |
z |
Time zone |
General time zone |
Pacific Standard Time; PST; GMT-08:00 |
Z |
Time zone |
RFC 822 time zone |
-0800 |