Question

Run a workbench multiple times based on outputs of a Tester


Badge +1
Hi,

 

 

I have a workbench where, at the start of it a number of features are selected through a Tester that fulfill a certain criteria.

 

 

I then want to run the workbench multiple times, each time using one of the features.  But I don't want all the features to go through the workbench at the same time as this will not work in the way it is set up.

 

 

Is there a transformer that will enable me to run it one feature at a time?

 

 

Thanks,

10 replies

Userlevel 4
Hi,

 

 

I guess you've already seen the WorkspaceRunner. In the workspace that you call, you can publish the WHERE-clause of the reader and set it to read a certin feature that way. Example

 

 

WHERE-clause: OBJECTID=12345

 

 

David
Badge +3
You can also set up the WorspaceRunner  to push a value to a vaiable.

 

This variable must be set up on the workspace that is called.

 

These are exposed into the caller as soon as you attach the worskpace to be called.

 

 

So

 

1 workspace to select the feature wich calls

 

2 a workspace where feature selector is read into a parameter.

 

 

 
Badge +1
Ok thanks, seems like WorkspaceRunner is the way to go!  I haven't actually used it before and having a look at it now I'm not sure how to get it to do what I want.

 

 

My current set-up is, I have a Tester in my Main workspace that selects a number of polygons that meet a certain criteria.  I then assign these polygons a Counter so they have a unique ID.  How would I get the Workspace Runner to run the workspace on each of these polygons?

 

 

Are you able to be a bit more specific than with your answers above as unfortunately I'm not quite sure how to implement what you've advised.

 

 

Thanks

 

 
Badge +1
My main issue is that I can't have all the selected features going through the main workspace at the same time, I need them to go through separately.  But I can't work out how to set the Workspace Runner to do this.

 

 
Badge +1
Ok I ended up using a Loop in a Custom Transformer that contains the WorkspaceRunner in order to run through each polygon feature separately.

 

 

This works successfully, however I would also like to call a variable that I set in the main workspace, into the WorkspaceRunner workspace before it loops through the first time.  I use VariableRetriever to call the variable I set in the main workspace but it is not pulling the value through - it comes up blank.  Any ideas?
Badge +3
Yes i have,

 

 

1 Create a Published Parameter in the Workspace u are calling (not main that is.)

 

Of course u need to chance the locations in the bench where it is used to this new Parameter.

 

 

2 Reattach (browse button) the workspace to the WorkspaceRunner.

 

This should add the newly created parameter.

 

3 Choose the variable or attribute in the main as its input.
Badge +3
btw Aquamarine,

 

 

I posted a solution for the Variable Setter Retriever question you posted a while ago.

 

 

A little "waiter" custom transformer to wait for the variable to arrive before retrieving it.

 

Did u read this?
Badge +1
Thanks Gio, yep I did see that response to the Variable Setter Retriever.  I will test out your suggestions.  Thanks again :)
Badge +3
btw,

 

 

You dont need to loop.

 

The WorkspaceRunner is  triggered for every feature upass ot it (with or without geometry). The WorkspaceRunner itself does not pass geomtry (alas?).

 

In the main workspace u select features, selected ID's go to the WorkspaceRunner. For this u need to create a parameter in the main workspace to receive this ID. Wich then will be exposed on the Runner.

 

In the Workspace wich is called these ID's are used to selet the features  (you read them again in this workspace for actual acquisition of the features) for further processing.

 

 

Main Workspace is actually just to call the workspace based on some trigger/ event or whatever.
Badge +1
ah ok, thanks for that!

Reply