Question

AttributeManager - expected behaviour?


Userlevel 1
Badge +10

I'm trying to use the AttributeManager to rename an attribute and at the same time set a value using a conditional formula. Should this be possible?


5 replies

Badge +10

Do you mean like this?attributemanager.fmw

Userlevel 1
Badge +10

No, I want to set a conditional value on the attribute I'm renaming

Badge

Hi @egomm

it looks like AttributeManager deals with renaming first and by the time it needs to evaluate @Value(_creation_instance) = 0 there is no _creation_instance attribute. I have filed a PR asking to investigate if AttributeManager behaviour can be improved. For now, I would like to suggest

  • calculating the value and assigning it to the new attribute first and then
  • removing the old attribute,

i.e. two steps/lines in AttributeManager.

Userlevel 1
Badge +10

Hi @egomm

it looks like AttributeManager deals with renaming first and by the time it needs to evaluate @Value(_creation_instance) = 0 there is no _creation_instance attribute. I have filed a PR asking to investigate if AttributeManager behaviour can be improved. For now, I would like to suggest

  • calculating the value and assigning it to the new attribute first and then
  • removing the old attribute,

i.e. two steps/lines in AttributeManager.

I managed it in a similar way by setting the value of the original attribute first and then renaming it in a later step.

Badge

Hi @egomm

it looks like AttributeManager deals with renaming first and by the time it needs to evaluate @Value(_creation_instance) = 0 there is no _creation_instance attribute. I have filed a PR asking to investigate if AttributeManager behaviour can be improved. For now, I would like to suggest

  • calculating the value and assigning it to the new attribute first and then
  • removing the old attribute,

i.e. two steps/lines in AttributeManager.

I figured this was the reason. But if I try to use the new name for the attribute (e. g. "Order" instead of "_creation_instance") when setting up the conditional values, I cannot get an attribute with the new name ("Order"), only an attribute with the old name ("_creation_instance"). (I use FME 2016.1 build 16609, by the way).

 

Reply