Featured Post

Applying Email Validation to a JavaFX TextField Using Binding

This example uses the same controller as in a previous post but adds a use case to support email validation.  A Commons Validator object is ...

Tuesday, July 5, 2011

BRules 1.1 Released for Talend Open Studio

BRules is a collection of routines for Talend Open Studio, that validates, converts, and shortens Java expressions.

BRules 1.1 adds functions for testing JSON.  isJSON() and hasJSONPath() examine JSON strings before running the tFileInputJSON component.

This job runs custom code in a tJava component. The If condition checks the hasPath flag.  Processing continues with a tFixedFlowInput (an adapter) directed to a tFileInputJSON.

Using BRules hasJSONPath() Routine
 If the If connector condition is not met, processing stops.  Here is the code for the tFileInputJSON component.

JSON Paths in a tFileInputJSON
In the normal mode of operation, if input JSON doesn't contain objects referenced by the specified JSONPath queries, an error would be thrown.  This happens in cases where the input is empty.

Other Notes

BRules uses Java 6 scripting features for the JSON processing.  If you try to use JRE 5, isJSON() and hasJSONPath() will throw exceptions.  The other functions like isCharset() and all() are available.

No comments:

Post a Comment