Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
User status changes are not reflecting
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
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?
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?
There is no API exist where I can give the status of the User while creation.
Any pointers????
Any pointers????
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
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
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
Sent from my iPhone with Liferay.com Forums
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
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
Regards,
KG
Attachments: