Highlighted
Absent Member.. Absent Member..
Absent Member..
7056 views

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?

0 Likes
1 Reply
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: UD 10.01 AM Push Adapter accessing cpu_specifier_enum

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.

Regards
-Dmitry Gomel, PMP
Click the Like button at the bottom to say 'Thanks'.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.