Skip to main content

Hi,

I have two workstreams in my workspace:

  1. Check data integrity, culminating in any errors appearing out of the NotMatched port of a Matcher.
  2. Writes the data out.

The two workstreams are separate from eachother.

Is there a way to prevent the writer from executing if features appear in the NotMatched port of the other workstream?

At present, I disable the writer and run the workspace repeatedly (correcting errors in the NotMatched port) until the data is ready to be written. Not very efficient... Would appreciate any help!

I can think of two ways to do this,

 

 

A) use a variableSetter on the data integrity stream, and a variableRetriever on the data stream. You may need to use a FeatureHolder prior to the variableRetriever if you can't guarantee that the data features will only arrive after any potential integrity features are output. Test the variable, if it exists don't write out the features, if it doesn't write them out.

 

 

B) use a featureMerger with 1,1 as the join, with the NotMatched port of the Matcher as your Supplier and your data stream as the Requestor, only hook up the UnmergedRequestor port to the writer.

I can think of two ways to do this,

 

 

A) use a variableSetter on the data integrity stream, and a variableRetriever on the data stream. You may need to use a FeatureHolder prior to the variableRetriever if you can't guarantee that the data features will only arrive after any potential integrity features are output. Test the variable, if it exists don't write out the features, if it doesn't write them out.

 

 

B) use a featureMerger with 1,1 as the join, with the NotMatched port of the Matcher as your Supplier and your data stream as the Requestor, only hook up the UnmergedRequestor port to the writer.
Hi @jdh, thank you so much for your quick reply (i've only just got around to testing your suggestions).

 

 

Option B definitely works, thank you! I wasn't aware of the 1,1 workaround - very useful.

 

 

Just for my interest, please could you explain a little more about the VariableSetter/Retriever option as I have never come across it.

 

  1. Would I have to set a variable in the Variable Name or Value box?
  2. Likewise, are these the same in the Retriever?
  3. And would i have to connect the VariableSetter in to the Input port of the Retriever?
Thanks in advance!
Hi @jdh, thank you so much for your quick reply (i've only just got around to testing your suggestions).

 

 

Option B definitely works, thank you! I wasn't aware of the 1,1 workaround - very useful.

 

 

Just for my interest, please could you explain a little more about the VariableSetter/Retriever option as I have never come across it.

 

  1. Would I have to set a variable in the Variable Name or Value box?
  2. Likewise, are these the same in the Retriever?
  3. And would i have to connect the VariableSetter in to the Input port of the Retriever?
Thanks in advance!
VariableSetter/Retriever is used to transfer attributes from one data stream to another without merging them.

 

 

The variable name is a global attribute, the value is what it stores. Unlike with parameters, the value can be overwritten over the course of the workspace.

 

 

The variable retriever will take the value of the named variable and store it as an attribute on the feature.

 

 

You do not need to connect the VariableSetter to the VariableRetriever at all.

 

 

Consider some features in the order A,1,2,B,3,4,5,C,6, that have been split into two streams for letters and numbers.

 

So one stream will have features A,B,C, and the other 1-6.

 

You need to get assign the preceding letter to the number features.

 

1A

 

2A

 

3B

 

4B etc.

 

If you use a variableSetter on the letter stream, then the variable will originally contain the value A

 

The variableRetriever on the number stream, will retrieve that value A, for features 1, and 2, but before feature 3 retrieves the value, feature B changes the value on the variableSetter so the value that feature 3 retrieves is no longer A, but B.

 

 

 


Thanks @jdh that is most helpful! I have got this to work now as well thanks to your clarification :)


Reply