Creating a routine - 7.1

Talend Big Data Studio User Guide

English (United States)
Talend Big Data
Talend Studio
Design and Development

In this procedure, create a custom routine to execute the algorithm for password encryption.


  1. In the Repository tree view of your Talend Studio, expand the Code node, right-click Routines and select Create routine from the contextual menu to create a new routine named MyRoutine.
  2. In the new routine that opened in the routine editor, add a function named decrypt and define the specify mechanism to decrypt the encryption string of the password.
    The code of the function reads as follows:
    public class MyRoutine {
        public static String decrypt(String encryptedPassword) {
            StringBuffer output = new StringBuffer();
            for (int i = 0; i < encryptedPassword.length(); i++) {
                char c = encryptedPassword.charAt(i);
                if (c >= 'a' && c <= 'm')
                    c += 13;
                else if (c >= 'A' && c <= 'M')
                    c += 13;
                else if (c >= 'n' && c <= 'z')
                    c -= 13;
                else if (c >= 'N' && c <= 'Z')
                    c -= 13;
            return output.toString();
  3. When done, click Ctrl+S to save your routine.