Skip to main content
Question

How to store feature attribute and reuse within works pace?

  • August 9, 2017
  • 4 replies
  • 72 views

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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

takashi
Celebrity
  • 7842 replies
  • 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
  • 6 replies
  • 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.

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
Celebrity
  • 7842 replies
  • 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.

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
  • 8391 replies
  • August 9, 2017

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