Skip to main content

Hello fellow FME users,

I was wondering if there is a way to
use the equivalent of a logic gate in FME. What I mean by that is a
transformer that only passes data if the conditions have been met. An
AND gate for example only passes the data if all inputs van been met for
example:

I have a main data flow with a specific branch that
only gets triggered if a condition is true. I test this by using a
creator and tester to test if a published parameter has a specific
value. I would like for the passed feature to act as a trigger to
trigger a branch.

I've added a picture for clarification

An OR gate is not needed because lots of transformers act like that.

So is there something that works like this, or maybe a Python solution? I can't program Python though.

Thank you in advance!

Michiel

I will often use a sampler (1st feature) to trigger a branch, or conversely a NoFeatureTester to trigger something if there are no outputs from a certain transformer.

If all you want is to process the inputs if a parameter is true, simply put a tester in the main inputs. Everything will either pass or fail.

 

 

Alternatively if you have some complicated logic, use your creator to trigger that logic and connect it to the supplier port of a featureMerger, with the main inputs as the requestor. The merged port is your proceed with branch.

Would an attributecreator with conditionals help?


Hi @mk_ngein,

I think the Tester is all you need. You can send all the features to the Tester, then just test if $parameter = true in the test condition. You can test almost anything in the Tester (or TestFilter, or the conditionals in the AttributeCreator), not just attributes.

It may seem inefficient to run exactly the same test to get exactly the same answer on all the features, but the test is quite fast. Any implementation of an logic gate would still require a state test on each feature, so there would be no performance gain.


Thank you very much for the quick answers! I like the FeatureMerger idea, I'll try to use that, it's probably what I need.


Reply