Skip to content

Commit

Permalink
0003049: Update the documentation for BeanShell Script Transform to talk
Browse files Browse the repository at this point in the history
about how to access "other" columns
  • Loading branch information
maxwellpettit committed Apr 17, 2017
1 parent 4f780ed commit 2d45e4a
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions symmetric-assemble/src/asciidoc/configuration/transforms/types.ad
Expand Up @@ -249,18 +249,18 @@ Some variables are provided to the script:

|===

.Tranform Expression Example Returning a String
.Transform Expression Example Returning a String
====
----
if (currentValue > oldValue) {
return currentValue * .9
return currentValue * .9;
} else {
return PRICE
return PRICE;
}
----
====

.Tranform Expression Example Returning a NewAndOldValue object
.Transform Expression Example Returning a NewAndOldValue object
====
----
if (currentValue != null && currentValue.length() == 0) {
Expand All @@ -270,6 +270,22 @@ if (currentValue != null && currentValue.length() == 0) {
}
----
====

.Transform Expression Example Accessing Old/New Values for the Additional Column 'path'
====
----
String newFilePath = PATH;
String oldFilePath = null;
if (transformedData.getOldSourceValues() != null) {
oldFilePath = transformedData.getOldSourceValues().get("path");
}
if (oldFilePath == null) {
return newFilePath;
} else {
return oldFilePath;
}
----
====
ifndef::pro[]
[source, SQL]
----
Expand Down

0 comments on commit 2d45e4a

Please sign in to comment.