How can I check if user is logged in Bonita?

I have another java application that I have to integrate with Bonita, at least login-wise.

I've been reading the APIs and Javadocs but I can't find something that will let me:

-check if user is logged in Bonita

-check if user has a determined role

Anyone know how I can do this?

Thanks in advance

Hi Jeros (I do believe you have a heart),

You could use some groovy script like that:

def userid = loggedUserId.value
def username = apiAccessor.identityAPI.getUser(userid)
def test = username.firstName + " " + username.lastName

return test

 

Not quite sure about the role, never really needed, but the name you can get that way either by a connector with the script or a field in your form.

Best regards,

Yeah, that would work inside bonita portal, but in another application I'm not sure how I could import the identityAPI or get de loggedUserId value