use of org.alfresco.service.cmr.workflow.WorkflowTaskQuery in project alfresco-remote-api by Alfresco.
the class InviteByTicket method getInvitationStatus.
private String getInvitationStatus(NominatedInvitation invitation) {
String invitee = invitation.getInviteeUserName();
String site = invitation.getResourceName();
// check is invitee is site member
boolean isUserMember = serviceRegistry.getSiteService().isMember(site, invitee);
WorkflowTaskQuery query = new WorkflowTaskQuery();
query.setTaskName(WorkflowModelNominatedInvitation.WF_TASK_ACTIVIT_INVITE_PENDING);
query.setProcessId(invitation.getInviteId());
// query current workflow's task activitiInvitePendingTask
List<WorkflowTask> pendingInvitationTasks = serviceRegistry.getWorkflowService().queryTasks(query, false);
// if it's here - pending invitation
if (!pendingInvitationTasks.isEmpty()) {
return InviteInfo.INVITATION_STATUS_PENDING;
} else if (isUserMember) {
return InviteInfo.INVITATION_STATUS_ACCEPTED;
} else {
return InviteInfo.INVITATION_STATUS_REJECTED;
}
}
Aggregations