tRESTClient job producing errors

One Star

tRESTClient job producing errors

I have a job that is using tRESTClient to post some data to a web service. I am able to use tREST to do a GET command and confirm that the connection to the webservice works fine. When I try to compile another job using tRESTClient as I need to post some data from  a tMDMTriggerInput component I get the error below. Files with screen shots of the job and the various component details are attached below. Any help is appreciated.
org.talend.commons.exception.PersistenceException: org.talend.designer.runprocess.ProcessorException: Job compile errors 
At least job "location_update_rest" has a compile errors, please fix and export again.
Error Line: 1618
Detail Message: long_name cannot be resolved or is not a field
There may be some other errors caused by JVM compatibility. Make sure your JVM setup is similar to the studio.
Community Manager

Re: tRESTClient job producing errors

Hi 
tMDMTriggerInput returns a Document, you are not able to access its element on tRestClient directly, try to redesign the job like this:
tMDMTriggertInput--main--tXMLMap1-out1--tFlowToIterate--tfixedFlowInput--main--tXMLMap2--tRestClient--main-->
on tFixedFlowInput and tRestClient, you are able to access element value like:
(String)globalMap.get("out1.columnName")
Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: tRESTClient job producing errors

Hi 
tMDMTriggerInput returns a Document, you are not able to access its element on tRestClient directly, try to redesign the job like this:
tMDMTriggertInput--main--tXMLMap1-out1--tFlowToIterate--tfixedFlowInput--main--tXMLMap2--tRestClient--main-->
on tFixedFlowInput and tRestClient, you are able to access element value like:
(String)globalMap.get("out1.columnName")
Regards
Shong

Thank you for the quick response!
Would it be possible to share an example of how these components should be set up to work? 
For example, tFixedFlowInput what settings should be used and how to map the columns through the workflow?
I am not able to find any relevant information in the documentation.
Community Manager

Re: tRESTClient job producing errors

Hi 
tXMLMap1 will extract the data from the incoming document, tFixedFlowInput will generate a input flow contains the data that extracted on tXMLMap1, for example, define a column called ID, and its value as:
//for int/Integer type:
(Integer)globalMap.get("out1.ID")   
//for String type:
(String)globalMap.get("out1.ID")   
Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: tRESTClient job producing errors

Here is what I have so far:
tMDMTriggerInput ---main-->tXMLMap----output(Main)---->tFlowToIterate-----iterate--->tFixedFlowInput.
In the tXMLMap I have a MDMRecieve table "locationReceive" in the main:row1 on the left hand side with the Update report and the item set to "location" by right clicking on MDM_message and selecting "import from repository" and selecting the "locationReceive" from my Talend MDM repository. Then on the output created as a result of connecting to tFlowToIterate, I mapped all of the columns from the "location" to the "locations(loop)" body on the right hand side (output).  ( it is really a shame that I can't load any screen shots here!).
I have the tFlowToIterate connected on iterate to tFixedFlowInput.  I did not make any edits to tFlowToIterate, I could not see what I need to do.
Then in tFixedFlowInput, I clicked on "edit Schema" using the built in option and created all of the columns for location.
Then under mode, I picked "Use Single Table"
Then for each column when I hit "CTRL -Space" I see a list of variables, but none of them look like global variables that you mention above. Something is still missing here, since none of the global variables are visible here. I see tMDMTrigger and tFlowToIterate related variables. 
Any help with more details  will be appreciated.
Community Manager

Re: tRESTClient job producing errors

Hi  
The global variables defined by tFlowToIterate are not available in the pop-up windows, you need to input them manually. Define the columns which you need to pass them to tXMLMap2 on tFixedFlowInput, and set the values like:
//for int/Integer type:
(Integer)globalMap.get("out1.ID")   

//for String type:
(String)globalMap.get("out1.ID")   
Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: tRESTClient job producing errors

It gives compile errors. This is not helping. I have uploaded to files here using the upload button above to show screen shots.
I could not attach anything below, as the functionality appears broken. Let me know if you cannot see the two files.
Community Manager

Re: tRESTClient job producing errors

Hello
On tXMLMap1, you should extract the fields which will be required later, rather than outputting a Document. 

Rebuild the Document on tXMLMap2.
Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business