Attribute rename?

   1524   3   2
User Avatar
Member
897 posts
Joined: July 2018
Offline
Is there really no way to rename an attribute in TOPs?

I need to compare values on two array attribs but can't get them to the same work item as they share the same name.
B.Henriksson, DICE
User Avatar
Member
603 posts
Joined: Sept. 2016
Offline
No, you'd have to do an attributecreate and then a attribute delete.
User Avatar
Member
897 posts
Joined: July 2018
Offline
But that's nlt possible w array attribs, right?
B.Henriksson, DICE
User Avatar
Member
603 posts
Joined: Sept. 2016
Offline
Yes, sorry we have an outstanding RFE to improve our array attrib handling. In the meantime you'd have to use a python processor with the following `onGenerate` Callback (assuming your array attrib is called ‘ia’):

# Clone Upstream Items
for upstream_item in upstream_items:
    # This clones all data, output results and keeps the same work item
    # type as in the upstream item
    work_item = item_holder.addWorkItem(cloneResultData=True, preserveType=True,
        parent=upstream_item)
    work_item.setIntAttrib('ia_copy', work_item.intAttribArray('ia'))
    work_item.eraseAttrib('ia')
  • Quick Links