Skip to main content
Solved

Embedded custom transformer - attribute assignments

  • November 29, 2016
  • 6 replies
  • 35 views

lifalin2016
Contributor
Forum|alt.badge.img+29

Hi,

I've always been struggling to wrap my head around how embedded custom transformers actually stitch into the general workflow. So this might very well be a no-brainer.

If I want a transformer to have two dataflow (two input clauses), one with points/node and another with lines, and want the custom transformer to take certain point/node "names" to transfer to the line features into pre-existing attributes on it, how is this achieved ?

I have "exposed" the three attributes (with seems common across all inputs !?), but I'm unsure whether the assigned values within the custom transformer ever make it out of it.

Please enlighten me of the proper how-to :-)

Cheers

Lars I.

Best answer by jdh

By default, all the attributes on a feature inside a custom transformer are hidden. (Rational is that custom transformers are meant be reused, and the next time might have features with entirely different schemas).

 

 

You can explicitly exposes attributes inside a custom transformer either hardcoded (less robust) or via published parameters (default as of 2015).

 

 

All the actions that take place in the custom transformer occur on the feature directly, exactly as if it were on the main canvas.

 

 

On the transformer output you have a setting Attributes to Output which can be set to All Attributes, or Specified Attributes Only. If Specified is selected all internally created attributes that are not selected are removed from the feature. Note that any exposed attributes originating outside the custom transformer are selected and cannot be unselected.
View original
Did this help you find an answer to your question?

6 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • November 29, 2016

By default, all the attributes on a feature inside a custom transformer are hidden. (Rational is that custom transformers are meant be reused, and the next time might have features with entirely different schemas).

 

 

You can explicitly exposes attributes inside a custom transformer either hardcoded (less robust) or via published parameters (default as of 2015).

 

 

All the actions that take place in the custom transformer occur on the feature directly, exactly as if it were on the main canvas.

 

 

On the transformer output you have a setting Attributes to Output which can be set to All Attributes, or Specified Attributes Only. If Specified is selected all internally created attributes that are not selected are removed from the feature. Note that any exposed attributes originating outside the custom transformer are selected and cannot be unselected.

lifalin2016
Contributor
Forum|alt.badge.img+29
  • Author
  • Contributor
  • November 30, 2016
jdh wrote:

By default, all the attributes on a feature inside a custom transformer are hidden. (Rational is that custom transformers are meant be reused, and the next time might have features with entirely different schemas).

 

 

You can explicitly exposes attributes inside a custom transformer either hardcoded (less robust) or via published parameters (default as of 2015).

 

 

All the actions that take place in the custom transformer occur on the feature directly, exactly as if it were on the main canvas.

 

 

On the transformer output you have a setting Attributes to Output which can be set to All Attributes, or Specified Attributes Only. If Specified is selected all internally created attributes that are not selected are removed from the feature. Note that any exposed attributes originating outside the custom transformer are selected and cannot be unselected.
Thanks jdh.

 

 

Your explanation is very enlightening :-)

 


lifalin2016
Contributor
Forum|alt.badge.img+29
  • Author
  • Contributor
  • November 30, 2016
jdh wrote:

By default, all the attributes on a feature inside a custom transformer are hidden. (Rational is that custom transformers are meant be reused, and the next time might have features with entirely different schemas).

 

 

You can explicitly exposes attributes inside a custom transformer either hardcoded (less robust) or via published parameters (default as of 2015).

 

 

All the actions that take place in the custom transformer occur on the feature directly, exactly as if it were on the main canvas.

 

 

On the transformer output you have a setting Attributes to Output which can be set to All Attributes, or Specified Attributes Only. If Specified is selected all internally created attributes that are not selected are removed from the feature. Note that any exposed attributes originating outside the custom transformer are selected and cannot be unselected.
Now I have your attention .... :-)

 

 

How come that the "External Attributes To Expose" are common across all input connectors, and not specific to each ?

 

 

Cheers

 

Lars I.

 

 


takashi
Influencer
  • November 30, 2016
lifalin2016 wrote:
Now I have your attention .... :-)

 

 

How come that the "External Attributes To Expose" are common across all input connectors, and not specific to each ?

 

 

Cheers

 

Lars I.

 

 

Hi @lifalin2016, in fact, the "External Attributes To Expose" is a functionality to automatically define published user parameters and internal attributes that will store the values passed through the parameters. Although their names are defined based on the connection when you created the transformer, each parameter can accept any value, so you can use the custom transformer anywhere.

 


lifalin2016
Contributor
Forum|alt.badge.img+29
  • Author
  • Contributor
  • November 30, 2016
takashi wrote:
Hi @lifalin2016, in fact, the "External Attributes To Expose" is a functionality to automatically define published user parameters and internal attributes that will store the values passed through the parameters. Although their names are defined based on the connection when you created the transformer, each parameter can accept any value, so you can use the custom transformer anywhere.

 

Hi Takashi.

 

 

Yes, I now understand the purpose of the attribute exposing mechanism.

 

 

However, my question was, why it the parameters aren't specific to each input connector, but are common to all connectors as a whole.

 

 

I understand that reuse of the transformer needs a fixed set of parameters, but the input connectors are also fixed, so it's a choice as I see it. I'm just asking as to the rationale behind it.

 

 

Cheers

 

 


mark2atsafe
Safer
Forum|alt.badge.img+44
  • Safer
  • November 30, 2016
lifalin2016 wrote:
Hi Takashi.

 

 

Yes, I now understand the purpose of the attribute exposing mechanism.

 

 

However, my question was, why it the parameters aren't specific to each input connector, but are common to all connectors as a whole.

 

 

I understand that reuse of the transformer needs a fixed set of parameters, but the input connectors are also fixed, so it's a choice as I see it. I'm just asking as to the rationale behind it.

 

 

Cheers

 

 

That is a very interesting question - and one I hadn't really thought about before. Ironically we've recently had a few support cases with the opposite problem. In a (non-custom) transformer with two input ports and a group-by setting, the group-by setting shows all attributes, when in reality only attributes that appear on both inputs would be usable in a group-by.

 

 

Anyway, back to your question I think the answer is that the custom transformer on the canvas only has a single parameters dialog. If we wanted to make the two input ports different we would need to somehow split that dialog into two, one for each input port, so that you knew which parameter related to the attributes from which port and could only select the attributes from that port.

 

 

I think that's possible - but no-one seems to have had a problem before so it's not something we've had to implement. I can file an enhancement request if you thought it would be useful - or you could post it as an idea on this site and see if anyone else agrees that it would be useful for them.

 


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