Creating role in MWS with dynamic attributes using API

Hi Team,

Can someone please guide me on how to add dynamic attributes while creating role in MWS using java api’s.

I am currently using createRole method available IDirectorySession, with map object pointing to my attributes, however role is getting created but not attributes. It will be of great help if some one help me with pointers on how to use.