cancel
Showing results for 
Search instead for 
Did you mean: 

UserQuery.userId(1) returns empty list of users

prashantgadgil
Champ in-the-making
Champ in-the-making

I have an Activiti form (Alfresco Process Services) where I have a people control from the default stencil.

I am trying to get the email address of the user selected on the form (n example below, I selected Administrator user). In the java delegate after the form submit, I am doing this to get the user 

execution.getEngineServices().getIdentityService().createUserQuery().userId(1).singleResult()

however the query result is returning of length 0 so singleResult is returning null. So I cant get the email address.

I checked in the users table, there is administrator user with Id = 1.

this is the first time I am trying to use this API. Am I missing something?

Is there any other way of getting the user for UserId = 1?

thanks in adavance..

Prashant

2 REPLIES 2

cjose
Elite Collaborator
Elite Collaborator

The identity service in community is not used in Alfresco Process Services. User Info Bean (userInfoBean) | Alfresco Documentation is one way to fetch it. There is a lot of other Java APIs too that you can use. As a customer you can get access to the Alfresco Nexus Repository from where you can download the java docs as well as the source code of Alfresco Process Services to find out all the available Java APIs/Spring Beans.

prashantgadgil
Champ in-the-making
Champ in-the-making

ok that worked. thanks