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.
If the If connector condition is not met, processing stops. Here is the code for the tFileInputJSON component.
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.
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 |
JSON Paths in a tFileInputJSON |
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