get user metadata?

1
0
-1

I have to get user metadata for an application im building, how can you get it?

I found some answers, but they involver User.getMetadata() which doesnt seem to exist in Bonita 6.1

3 answers

1
0
-1

Hi/Hola Alonso,

In this answer you have the way to do it / Aquí encontraras la respuesta http://community.bonitasoft.com//answers/crear-nueva-variable-de-metadat...

Cheers

1
0
-1

Here is an extract of what I do (I have just one metadata).

Hope this helps.

Fred

import org.ow2.bonita.facade.identity.impl.ProfileMetadataImpl;

// Get metadata of user
Map userMetadata = userInfo.getMetadata();

userMetadataByName = [:]
userMetadata.each{ key, value -> userMetadataByName.put(key.getName(), value) }

if (userMetadataByName.get(the_name_of_the_metadata_your_are_looking_for))
return "what_you_want_when_found";

return "what_you_want_when_not_found";

1
0
-1

Hi Alonso,

It depends exactly what informaion you want about a user. You can use getUserWithProffessionalDetails to get contact infrmation such as the email address. Otheriwise, you need to use getUser.

HTH,

Chris

Notifications