Skip to main content
Archived

Also allow the operators 'Attribute has ...' for 'non attributes' (like e.g. par

Related products:Transformers
siennaatsafe
redgeographics
thijsknapen
maayke
  • siennaatsafe
    siennaatsafe
  • redgeographics
    redgeographics
  • thijsknapen
    thijsknapen
  • maayke
    maayke

thijsknapen
Contributor

***Note from Migration:***

Original Title was: Also allow the operators 'Attribute has ...' for 'non attributes' (like e.g. parameters or direct fme feature functions) in test conditions


It would be nice if the operator 'Attribute has ...' could also be used on 'non attributes'.

It is quite tempting to use a testfilter with the condition 'input parameter', and operator 'Attribute has a value'. However, this won't work as expected as the input parameter is not an attribute. When your not aware of this it is also quite tricky to detect that a (test) statement like this doesn't work, because no error or warning is generated when you do use such a (invalid) statement.

Also, it seems that I'm not the first one to have been confused that this operator is not possible for non attributes, see e.g. the following topic on the forum; link


Of course there are quite some easy workarounds to this;

a) if you just create an attribute from the parameter (with e.g. a parameterfetcher) you can use the teststatement then on this newly created attribute. (Although this is the simple and obvious fix, I do feel it is a bit cumborsome as I think it shouldn't be neccessary to go into such a workaround. Also creating an attribute from your parameter will actually create an extra 'column' to your dataset, which might be quite costly on resources when you are dealing with large 'feature sets')

b) I think in many cases you can also get away by using the operator 'Contains Regex'.

E.g. I would think that the operator 'Attribute has a value' would be very similar to using the operator 'Contains Regex' with the regex '.+' (meaning 'one or more' (i.e. '+') of 'any single character' (i.e. '.')).


This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings