掲示板
Deleting User When User is REJECTED from Workflow.
10年前 に Gnaniyar Zubair によって更新されました。
Deleting User When User is REJECTED from Workflow.
Liferay Master 投稿: 722 参加年月日: 07/12/19 最新の投稿
Hi,
I am trying to delete the user after getting REJECTED from workflow level . [Kaleo Workflow]. When User is REJECTED, I am receiving the userId from userservice hook updateStatus method .
But No LUCK. During user REJECTED mode, it comes to this method perfectly. But user is not deleted from database. I couldn't track what happening as No Exception is being thrown.
Cant we delete the user while user is in workflow mode..? Is there any other solution? or Am i missing something?
I am trying to delete the user after getting REJECTED from workflow level . [Kaleo Workflow]. When User is REJECTED, I am receiving the userId from userservice hook updateStatus method .
@Override
public class CustomUserLocalServiceImpl extends UserLocalServiceWrapper {
/**
*
* @param userLocalService
*/
public CustomUserLocalServiceImpl(UserLocalService userLocalService) {
super(userLocalService);
_log.info("User Service Listener is up and running.");
}
public User updateStatus(long userId, int status) throws PortalException,
SystemException {
// TODO Auto-generated method stub
if(status == WorkflowConstants.STATUS_DENIED) {
_log.info("after rejecting user >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> .....userId >>>>" + userId +">>>>>>>>>>>>> user status >>>>>>>" + status);
try {
UserLocalServiceUtil.deleteUser(userId);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}/
_log.info("user deleted>>>>>>");
}
return super.updateStatus(userId, status);
}
}
But No LUCK. During user REJECTED mode, it comes to this method perfectly. But user is not deleted from database. I couldn't track what happening as No Exception is being thrown.
Cant we delete the user while user is in workflow mode..? Is there any other solution? or Am i missing something?
10年前 に Gnaniyar Zubair によって更新されました。
RE: Deleting User When User is REJECTED from Workflow.
Liferay Master 投稿: 722 参加年月日: 07/12/19 最新の投稿Gnaniyar Zubair:
@Override public class CustomUserLocalServiceImpl extends UserLocalServiceWrapper { /** * * @param userLocalService */ public CustomUserLocalServiceImpl(UserLocalService userLocalService) { super(userLocalService); _log.info("User Service Listener is up and running."); } public User updateStatus(long userId, int status) throws PortalException, SystemException { // TODO Auto-generated method stub if(status == WorkflowConstants.STATUS_DENIED) { _log.info("after rejecting user >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> .....userId >>>>" + userId +">>>>>>>>>>>>> user status >>>>>>>" + status); try { UserLocalServiceUtil.deleteUser(userId); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); }/ _log.info("user deleted>>>>>>"); } return super.updateStatus(userId, status); } }
From the above code, I am deleting the user passing the userId into UserService. But After that that method
return super.updateStatus(userId, status);It is updating the user status with that same userId. In this case, atleast it should throw the exception..? right?
10年前 に Gnaniyar Zubair によって更新されました。
RE: Deleting User When User is REJECTED from Workflow.
Liferay Master 投稿: 722 参加年月日: 07/12/19 最新の投稿
I have resolved this issue by overriding edit workflow task action through Struts Action of workflow.
I am receiving the transient name (APPROVE / REJECT ) from request object:
/my_workflow_tasks/edit_workflow_task
I am receiving the transient name (APPROVE / REJECT ) from request object:
String transitionName = ParamUtil.getString(actionRequest, "transitionName");
if(transitionName .equals("REJECT")) {
// your logic goes here to delete the user and other operations.......
}
8年前 に Abdur rasheed によって更新されました。
RE: Deleting User When User is REJECTED from Workflow.
Junior Member 投稿: 71 参加年月日: 08/09/26 最新の投稿
Gnaniyar Bhai,
can we fix this issue through workflow xml file?, I want to try by xml file. getting same issue, so give me better idea to resolved this issue.
Thanks
Rasheed
can we fix this issue through workflow xml file?, I want to try by xml file. getting same issue, so give me better idea to resolved this issue.
Thanks
Rasheed