Skip to main content
Question

How to store feature attribute and reuse within works pace?


Hi,

I am querying a DB table for some records and filtering few of them to create an XML string then sending this to an web service through HTTPCaller.After successfully sent this XML,i would like to update the table back with status filed = 'Y' for all the records i have fetched initially.

The records i am fetching has got ID field which i would like to use for matching purpose but how could i store this ID within the workspace initially after fetching from DB and reuse for my update at the end of my process?

Any help would be much appreciated.

Thanks,

reachmj

4 replies

takashi
Influencer
  • August 9, 2017

Hi @reachmj, the feature entered into the HTTPCaller would be output via the Output port, if the HTTP request was successful. If the input feature has the ID as an attribute, it will be propagated to the output feature, so I think you can just connect a writer to the port in order to update the database. The FeatureWriter, SQLExecutor, or DatabaseUpdater could also be used to update DB instead of a writer.


  • Author
  • August 9, 2017
takashi wrote:

Hi @reachmj, the feature entered into the HTTPCaller would be output via the Output port, if the HTTP request was successful. If the input feature has the ID as an attribute, it will be propagated to the output feature, so I think you can just connect a writer to the port in order to update the database. The FeatureWriter, SQLExecutor, or DatabaseUpdater could also be used to update DB instead of a writer.

Hi Takashi,

 

Thanks for your quick response.The HTTPCaller got 2 input features

 

1.First one is XML textline where no ID field (Run time order 1)

 

2.ID value from the initial SQL executor (Run time order 2)

 

First input XML message successfully output through Output Port

 

But unfortunately the second inputs are rejected through the HTTPCaller's Rejected port as because its got only ID field,so i am unable to do mapping.

 

Any clue please?

 

 

Thanks,

 

reachmj

 

 


takashi
Influencer
  • August 9, 2017
takashi wrote:

Hi @reachmj, the feature entered into the HTTPCaller would be output via the Output port, if the HTTP request was successful. If the input feature has the ID as an attribute, it will be propagated to the output feature, so I think you can just connect a writer to the port in order to update the database. The FeatureWriter, SQLExecutor, or DatabaseUpdater could also be used to update DB instead of a writer.

If you have only two features, you can just merge them unconditionally before the HTTPCaller, with a FeatureMerger (set a constant value e.g. "1" to Join On for both Requestor and Supplier) or an Aggregator (Accumulation Mode: Merge Incoming Attributes).

 

 


david_r
Celebrity
  • August 9, 2017

There's also the VariableSetter and VariableRetriever that can be very helpful sometimes.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings