Reading xml with encrypted data

Highlighted
Six Stars PK
Six Stars

Reading xml with encrypted data

Hi,

I have requirement to read a xml where data is encrypted. I also have a program to decrypt the data i have attached the screenshot. 

How can i integrate this program in talend job. Output of this command should be captured as value to column.

 

Capture.PNG

I will appreciate anyone one help.

 

Regards

PK


Accepted Solutions
Fifteen Stars TRF
Fifteen Stars

Re: Reading xml with encrypted data

Sorry, the mistake was mine.

You must change from flow to iterate before to go in the tSystem component.

The job should look like this (here I change tFileInputDelimited by tFixedFlowInput just for the example):

Capture.PNG

The tFixedFlowInput generate 2 lines with the values "One" and "Two" I'll use later on as parameters for the tSystem.

The tFlowToIterate generates 1 global variable per input field and each variable will have the values from the input flow.

In my example, the schema in the tFixedFlowInput just contains 1 field called "Parameter". 

So, the  global variable will be called "row49.Parameter" because I used the default configuration for tFlowToIterate but you can choose the variable name if you uncheck the "Use the default (key, value) in global variables" option.

Now the tSystem component can get the parameter from the global variable:

Capture.PNG

Here is what the command field must look like:

"cmd /c C:/parameter.bat " + ((String)globalMap.get("row49.Parameter"))

And here is the result:

 

Capture.PNG

You got it?


TRF

All Replies
Fifteen Stars TRF
Fifteen Stars

Re: Reading xml with encrypted data

Hi,

 

If you need to run this program from the command line you need to use the tSystem component.

Follow this link to know how to get the result.

 

Hope this helps.


TRF
Six Stars PK
Six Stars

Re: Reading xml with encrypted data

Thanks for your reply.

 

How can i pass input column to tSystem command, when i trying to pass as row2.accountNumber i am getting error which i have attached.Error.PNG

 

new String[]{"cmd","/c","C:\\Users\\212600982\\Desktop\\XML_TEST\\Decription_Xml\\rsa-example-jre_7\\rsa-example-1.0-SNAPSHOT\\bin\\rsa-example.bat C:\\rsa\\private row2.accountNumber"}

Fifteen Stars TRF
Fifteen Stars

Re: Reading xml with encrypted data

If you want to fill the "Command" field dynamicaly you nedd to use the syntax:

 

 

"cmd /c" C:\\Users\\212600982\\Desktop\\XML_TEST\\Decription_Xml\\rsa-example-jre_7\\rsa-example-1.0-SNAPSHOT\\bin\\rsa-example.bat C:\\rsa\\private" + row2.accountNumber

As you can see row2.accountNumber must be outside from the "" to get the value of the field, not the string row2.accountNumber.

 


TRF
Six Stars PK
Six Stars

Re: Reading xml with encrypted data

Thanks for your reply. I tried to pass and test but but no luck, i am getting null for any column i want to pass dynamically, please find screenshot.

 

tsystem coomand :  "cmd /c echo " + row2.accountNumber

 

 

Capture1.PNG

Fifteen Stars TRF
Fifteen Stars

Re: Reading xml with encrypted data

Sorry, the mistake was mine.

You must change from flow to iterate before to go in the tSystem component.

The job should look like this (here I change tFileInputDelimited by tFixedFlowInput just for the example):

Capture.PNG

The tFixedFlowInput generate 2 lines with the values "One" and "Two" I'll use later on as parameters for the tSystem.

The tFlowToIterate generates 1 global variable per input field and each variable will have the values from the input flow.

In my example, the schema in the tFixedFlowInput just contains 1 field called "Parameter". 

So, the  global variable will be called "row49.Parameter" because I used the default configuration for tFlowToIterate but you can choose the variable name if you uncheck the "Use the default (key, value) in global variables" option.

Now the tSystem component can get the parameter from the global variable:

Capture.PNG

Here is what the command field must look like:

"cmd /c C:/parameter.bat " + ((String)globalMap.get("row49.Parameter"))

And here is the result:

 

Capture.PNG

You got it?


TRF
Six Stars PK
Six Stars

Re: Reading xml with encrypted data

Hi,

 

Thanks for your help. IT worked.

 

 

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

APIs for Dummies

View this on-demand webinar about APIs....

Watch Now