Record To Record Service

Record to Record service takes inputs record by record and processes them according to the defined logic using java programming construct, and gives the output one record at a time. User can write Java logic that will be executed in this service. The Java logic has access to Record to Record script service, context of the process flow this service belongs to, input and output Stream handlers, which allow Java logic to access and manipulate input data to generate output and pass it to another service in the process flow. 

Prerequisites

  • Layout service must be created before creating Record to Record Service.

Steps to create Record to Record service

  1. Click Configure > DATA TRANSFORMATION > Record to Record.

  2. Click Create Record to Record.

  3. On the Create Record to Record window, enter the name and description of the new Record to Record service in the Name and Description fields.



  4. Enter the sample Java script as explained below to perform the desired transformation.

    Template Script:

    Note: the complete script is executed for each record.
     // Setting Process Flow variable (nextRecord) value
     context.put("nextRecord","no");
     // Setting one record into Process Flow Context
     context.put("RecordData",record);
     // Wait for Process Flow variable(nextRecord) value to be changed to 'yes'
     while(true)
     {
     try
     {
     String recordExist = (String)context.get("nextRecord");
     if(recordExist.equalsIgnoreCase("no"))
     { Thread.sleep(1000); }
     else
     break; }
     }
     catch (InterruptedException e)
     { e.printStackTrace(); }
     }

     

  5. Select input and output format as either XML or Native (non XML) from the Input Format and Output Format drop-down lists respectively.
  6. Select the source layout service from the Schema Name (Input data) drop-down list.

    If any XML Layout is selected in the Schema Name(Input data) drop-down list then the Input Format must be selected as XML.
  7. Expand the Advanced Properties section and select the Project from Project drop-down list.

  8. Click Save.