User status changes are not reflecting

Sunil Kulkarni, modified 11 Years ago. Junior Member Posts: 94 Join Date: 6/24/11 Recent Posts
Hello All,

I am using LR EE 6.1.3

I have created custom portlet which will manger user CRUD operations. I am using LR APIs for CRUD operation of User from UserLocalServiceUtil.
My requirement is, when user will be created in system, it should be in pending state and user should not be allowed in the system.

To achieve this, I have run SB to create wrapper service without entity attributes, say UserOperations.
I have added following method in UserOprtationLocalServiceImpl

public User addUser(....) throws PortletException, SystemException {
      User user = UserLocalServiceUtil.addUser(...);
      user = UserLocalServiceUtil.updateStatus(user.getUserId(), WorkflowConstants.STATUS_PENDING);
}


When I am calling this method from my portlet, status of the defect is not not updated. It is created a user with status as APPROVED.

Am I missing anything?
Sunil Kulkarni, modified 11 Years ago. Junior Member Posts: 94 Join Date: 6/24/11 Recent Posts
There is no API exist where I can give the status of the User while creation.

Any pointers????
thumbnail
Krzysztof Gołębiowski, modified 11 Years ago. Liferay Master Posts: 549 Join Date: 6/25/11 Recent Posts
Hello Sunil,
You don't need to write custom code to enable workflow for User, it is supported by default in Liferay. You just have to enable single-approver workflow shipped with kaleo (or create custom one) in "Default Configuration" for Portal Workflow settings.

Regards,
KG
thumbnail
Pier Paolo Ramon, modified 11 Years ago. Junior Member Posts: 90 Join Date: 5/25/10 Recent Posts
AFAIK that status property is not actual-workflow-related. It was just an unfortunate name in the long run. And, AFAIK, real workflow is not available on users at all. You'll have to change the active flag manually in your application.

Sent from my iPhone with Liferay.com Forums
thumbnail
Krzysztof Gołębiowski, modified 11 Years ago. Liferay Master Posts: 549 Join Date: 6/25/11 Recent Posts
What do you mean by "real workflow is not available on users at all"? I'm sure it's there emoticon we have this functionality in one of out portals (6.1.1) and I'm sure field status is workflow-related. Check the UserWorkflowHandler for 6.1.x and the screen attached to this post (for 6.2).

Regards,
KG