Skip to main content
Solved

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

  • December 9, 2021
  • 5 replies
  • 17 views

benvk
Contributor
Forum|alt.badge.img+8
  • Contributor
  • 60 replies

 

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.

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.

5 replies

gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • 132 replies
  • 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+63
  • Celebrity
  • 1620 replies
  • 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.

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+8
  • Author
  • Contributor
  • 60 replies
  • December 10, 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.

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+8
  • Author
  • Contributor
  • 60 replies
  • December 10, 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.

@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
  • 132 replies
  • December 10, 2021

@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.