Five Stars PK
Five 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

1 ACCEPTED SOLUTION

Accepted Solutions
Twelve Stars TRF
Twelve 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
6 REPLIES
Twelve Stars TRF
Twelve 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
Five Stars PK
Five 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"}

Twelve Stars TRF
Twelve 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
Five Stars PK
Five 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

Twelve Stars TRF
Twelve 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
Five Stars PK
Five Stars

Re: Reading xml with encrypted data

Hi,

 

Thanks for your help. IT worked.