Solved

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

  • 9 December 2021
  • 5 replies
  • 1 view

Badge +7

 

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?

icon

Best answer by gazza 9 December 2021, 23:12

View original

5 replies

Badge +5

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.

Userlevel 5
Badge +29

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

Badge +7

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

Badge +7

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

Badge +5

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

Reply