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 ...

Wednesday, January 29, 2014

Installing Routines Hosted on the Talend Exchange

Routines are Java methods that supplement Talend Open Studio.  A Routine is a special packaging of Java that makes methods displayable in the Talend Open Studio IDE and eligible for Talend conveniences like code completion.  This blog post shows the installation procedure for BRules, a collection of Routines hosted on the Talend Exchange.

This procedure is demonstrated with the following job which consists of a tFixedFlowInput feeding a tMap (where a Routine method will be applied).  The tMap echoes its output to the console via a tLogRow.

Test Job Used in BRules Install Procedure
Routines are imported and maintained in the Repository Browser.  Several Routines like TalendDate ship with the Talend Open Studio installation.

Off-the-Shelf Talend Routines
Right-click on the Routines tree item and select "Import Items".  The following dialog will be displayed.

Import Routine Items Screen
Select the "archive file" radio button which activates the Browse TalendExchange button.  Press the Browse TalendExchange button.

Routines Available for 5.4.1 on the Talend Exchange
A list of the Routines available on the Talend Exchange is displayed.  Note that there may be other Routines available, but have not been flagged as working for your particular version.  If you know of a Routine that you'd like for the current or previous version, let the author know.  He or she may be able to simply log on and set a version item if the Routine is compatible.

Select "Brules 1.2" and press finish.


Contents of BRules Archive
The contents of the BRules archive are displayed in the window.  Only the most current item under Routines > bekwam needs to be seleted.  There are several jobs included in the distribution.  These are unit test jobs demonstrating the usage of the functions. They aren't required to use BRules.

Finally, the Routines can be used in a component like tMap.  This tFixedFlowInput sends a single-character String of "1" to the tMap.

Input for the Test Job
All of the components have a single-field schema with field "field1" defined as a String.  Here is the configuration for the tMap.  A Routine method "pad" is applied.  Note that the BRules class name is prepended to to the method name (pad).  Talend Open Studio's code completion is available.  Type in BRules into a tMap schema cell and press Control-Space.  A listbox of selections will appear.  Select "User Defined.pad".

Application of Third-Party Routine
Here is the output.  There are spaces in front of the single-character "1" making the input the three characaters "  1".

Results of Using a BRules Routine Method
Routines are productive ways to apply functionality to transformations involving components like tMap.  This blog post showed how you can use third-party Routines hosted on the Talend Exchange.  The blog post installed BRules in your local IDE.  Look for a new version of BRules in the coming week to greatly broaden its library.









No comments:

Post a Comment