Question

DistanceChopper transformer

  • 27 November 2018
  • 9 replies
  • 6 views

Badge +1

I used this transformer, and I need to create a value consecutive to could identify the parts consecutive, if you see the picture there ara a attribute "Loop to DistanceChopper_LOOP_Entrance1543350805 Input Splitter.BranchingFactory.Count (32 bit integer):" and each parts have a different vale and are consecutive but if i coul use this attribute.

i can´t used it, if i create a new attribue and use this value but no apear. What can i do to use this vale.

thank a lot whats happend with chat online??????? i see some days offline... :(


9 replies

Badge +2

Hi @ftl,

You can use the AttributeExposer transformer to allow this attribute value to be used downstream in the workspace.

Live Chat should be available 9-12 and 1-4pm PST the majority of the time. Occasionally there are internal events that mean this time can get short but this happens very rarely.

 

 

Badge +1

Hi @ftl,

You can use the AttributeExposer transformer to allow this attribute value to be used downstream in the workspace.

Live Chat should be available 9-12 and 1-4pm PST the majority of the time. Occasionally there are internal events that mean this time can get short but this happens very rarely.

 

 

Thanks @hollyatsafe, but when i use AttributeExposer and copy paste the name who apear in the inspector at attributeExposer, the value, when execute the workflow, are missing. no apear value.

Badge +2

Thanks @hollyatsafe, but when i use AttributeExposer and copy paste the name who apear in the inspector at attributeExposer, the value, when execute the workflow, are missing. no apear value.

Hi @ftl,

When you copy the attribute name over do not include the test in the brackets after .Count. I've attached a .fmw that shows this working.

none2none.fmw

Badge +1

Hi @ftl,

When you copy the attribute name over do not include the test in the brackets after .Count. I've attached a .fmw that shows this working.

none2none.fmw

Hi @hollyatsafe, in the example that you have sent me the same as me, the exposer attribute appears as missing in the attribute table

Userlevel 2
Badge +17

The attribute name "Loop to DistanceChopper_LOOP_..." has been generated at run-time and it could be different for each run. If you want to use the attribute value in the subsequent workflow, implicitly rename it with the BulkAttributeRenamer and expose the resulting attribute name ('_loop_count' in the example below).

  • Action: Regular Expression Replace
  • Mode: Rename
  • Text To Find (regular expression): Loop to DistanceChopper_LOOP_Entrance\\d+ Input.+
  • String: _loop_count

Just be aware you would have to modify the regular expression if you edited the Transformer Name of the DistanceChopper transformer, since the attribute name contains the transformer name as its part. Further, it may not be guaranteed the name will be the same in future versions of FME.

I would recommend you to consider another solution without using the "Loop to DistanceChopper..." attribute as much as possible.

Badge +3

@ftl

That parameter resists being exposed indeed.

 

Either remove the attribute __parts from the attribute remover (let the attribute pass)

or

Add a topologybuilder after the DistanceChopper, all parts are now enumerated. No exposure required.

 

I use this to do that with some options...nputscreen

The customtransformer

 

Workbench, attr-creator for initialising some attributes.

Badge +3

@ftl

 

I forgot the conditionals in the creator

 

Badge +2

Hi @hollyatsafe, in the example that you have sent me the same as me, the exposer attribute appears as missing in the attribute table

Hi @ftl,

I was using 'Run with Feature Caching' during my testing so I didn't hit the issue of the attribute name changing each run - it looks like Takashi's suggestion using Regex would be better here.

Badge +8

Hi @ftl,

For your workflow, I would recommend using CHOPPER transformer instead with combination of LENGTHCALCULATOR and Counter, you can easily achieve the neccessary result.

 

 

 

Also, use this workspace as starting point.

DistanceChopper_Test.fmw

Reply