Skip to main content
Question

AttributeManager - expected behaviour?

  • July 4, 2016
  • 5 replies
  • 29 views

ebygomm
Influencer
Forum|alt.badge.img+46

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?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, 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.

5 replies

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

Do you mean like this?attributemanager.fmw


ebygomm
Influencer
Forum|alt.badge.img+46
  • 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+46
  • Author
  • Influencer
  • July 5, 2016

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

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