UD 10.01 AM Push Adapter accessing cpu_specifier_enum

How can I access cpu_specifier_enum in groovy function, I am trying to push cpu_specifier field from CPU CI to Asset Manager, but its pushing integer value instead of string, the integer value seems to the enum value, so i need to convert the integer enum value to its string, but when I tried to acces the enum in Groovy function it threw an error that the attribute is not recognized, is anybody using any out of the box enums in groovy functoions?

  • Hi,

    That's difinetelly a tricky question.

    When the adapter starts the start(PushDataAdapterEnvironment env) method of the groovy connector is called.

    Taking a look at the env – it contains a method called ClassModel getLocalClassModel()… and the ClassModel contains all enums definitions.

     

    So during the mapping you can use this ClassModel to convert your enum key to values.

     

    Hope this helps.