Skip to main content
Question

AttributeManager - expected behaviour?


ebygomm
Influencer
Forum|alt.badge.img+32

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

davideagle
Contributor
Forum|alt.badge.img+21
  • Contributor
  • July 4, 2016

Do you mean like this?attributemanager.fmw


ebygomm
Influencer
Forum|alt.badge.img+32
  • Author
  • Influencer
  • July 4, 2016

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


Forum|alt.badge.img

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.


ebygomm
Influencer
Forum|alt.badge.img+32
  • Author
  • Influencer
  • July 5, 2016
lenaatsafe wrote:

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.


Forum|alt.badge.img+3
lenaatsafe wrote:

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).

 


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