Skip to main content
Solved

Can we set a condition to only run a reader based on the results from another reader?


benvk
Contributor
Forum|alt.badge.img+7
  • Contributor

 

I have a workbench that has two ESRI Geodatabase (ArcSDE GeoDB) readers. The first (TableA) is a table containing updates that have been made, there could be up to 500 rows found.

 

The other (TableB) is the table that needs to be manipulated based on the updates found in TableA, this table has 500,000 rows. 

 

For efficiency sake, I am hoping to only read the TableB if there are rows returned from TableA. Can we tell the workbench to run the TableA reader first, IF rows found in TableA, then read TableB and continue through workbench processes, ELSE end workbench.

 

Any thoughts on if this is a possibility?

Best answer by gazza

Use a FeatureReader to read in the second table rather than a regular reader and you can control it with the output from the first reader.

View original
Did this help you find an answer to your question?

5 replies

gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • Best Answer
  • December 9, 2021

Use a FeatureReader to read in the second table rather than a regular reader and you can control it with the output from the first reader.


hkingsbury
Celebrity
Forum|alt.badge.img+55
  • Celebrity
  • December 9, 2021
gazza wrote:

Use a FeatureReader to read in the second table rather than a regular reader and you can control it with the output from the first reader.

Have a look here re comparisons of the two

https://community.safe.com/s/question/0D74Q000008sD75/detail?s1oid=00D30000000ePES&s1nid=0DB0c000000Gmzx&emkind=chatterCommentNotification&s1uid=0054Q00000EwvQs&emtm=1639003549101&fromEmail=1&s1ext=0


benvk
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • December 10, 2021
gazza wrote:

Use a FeatureReader to read in the second table rather than a regular reader and you can control it with the output from the first reader.

Thanks for the replies, that's exactly what I needed to do.

This will drastically reduce run time on the majority of executions as it is only every other week that there will be updates needing actioning!

 

Thanks


benvk
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • December 10, 2021
gazza wrote:

Use a FeatureReader to read in the second table rather than a regular reader and you can control it with the output from the first reader.

@Gary Nicholson​, Just thinking this through, if my first TableA returns 10 entries, wont this trigger a read of TableB 10 times?

I am thinking I will need to add a sampler to only allow the first feature found to pass through to initiate the Feature Reader?

image


gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • December 10, 2021
benvk wrote:

@Gary Nicholson​, Just thinking this through, if my first TableA returns 10 entries, wont this trigger a read of TableB 10 times?

I am thinking I will need to add a sampler to only allow the first feature found to pass through to initiate the Feature Reader?

image

It depends on what you are reading in from TableB. If you want to read in the entire TableB then yeah, a sampler will allow you to only read it in once. If you are using the output from TableA to just read in one record from TableB at a time then you will want all ten features to flow through.


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