Solved

Using Counter and TestFilter Transformers to Generate a message


I am trying to create a workflow that checks a spreadsheet with new updated information against an older feature class. I am using FeatureJoiner to determine if there are any new or added rows to the spreadsheet so that ultimately, i will be able to add the coordinate points for any new rows. I have connected the unjoined left port of the FeatureJoiner to a counter transformer to determine how many new rows were added to the spreadsheet and therefore show the user how many new coordinate pairs need to be added to update the feature class. So far I have been able to generate an error message using a logger transformer (FeatureJoiner > Counter > TestFilter) to indicate if there are new additional rows, however I would also like to generate a message if there are no new rows added so that the user knows and so that they can be directed to another workflow. I have set the TestFilter so that if the counter transformer attribute has value it will lead to one Logger, otherwise it will lead to a second logger with a different message.The issue seems to be in the counter - if there are no new changes the counter won't be able to pick up on this.

icon

Best answer by rahulsharma 12 July 2018, 00:14

View original

6 replies

Badge +22

It sounds like you need to add a NoFeatureTester to the Joined port of the FeatureJoiner, send the results of the Input port to the counter and NoInput to the second logger.

Badge +8

@maryrichards364, yes NoFeatureTester will do the trick in this case.

@maryrichards364, yes NoFeatureTester will do the trick in this case.

@rahulsharma and @jdh - Thank you so much for your help! The NoFeatureTester works well! Would you also happen to know if there is a way to initiate workflows from this NoFeaturesTester? As in, if there are changes, this initiates a workflow (using the same readers - the updated spreadsheet and the old feature class) that prompts the user to enter coordinate points for the added rows, and if there are no changes, this prompts a different workflow (still using the same readers)? Would WorkspaceRunner be the best option?
Badge +8

@maryrichards364, yes NoFeatureTester will do the trick in this case.

@maryrichards364

 

This is good starting point https://knowledge.safe.com/questions/4144/select-different-feature-type-each-time-workspace.html
Badge +8

@maryrichards364

The workflow would look something similar like this, there is an option to use Workspace runner or to continue the workflow in the same workspace.

 

Hope this helps

@maryrichards364

The workflow would look something similar like this, there is an option to use Workspace runner or to continue the workflow in the same workspace.

 

Hope this helps

@rahulsharma - I have been trying to work with Python Caller, but have been unsure about the correct syntax, would you be able to provide more details about the Python Caller transformer you included in the above image? Is there a way that would allow the user to enter in the correct number of coordinate pairs (determined by the number of unjoined features?)

 

Reply