use of org.kuali.kfs.kew.actiontaken.ActionTaken in project cu-kfs by CU-CommunityApps.
the class CuDisbursementVoucherDocument method doRouteStatusChange.
/**
* Overridden to interact with the Legacy Travel service
* @see <a href="https://jira.cornell.edu/browse/KFSPTS-2715">https://jira.cornell.edu/browse/KFSPTS-2715</a>
*/
@Override
public void doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) {
// If the DV is Canceled or Disapproved, we need to reopen the trip in the Legacy Travel service.
if (getDocumentHeader().getWorkflowDocument().isCanceled() || getDocumentHeader().getWorkflowDocument().isDisapproved()) {
boolean tripReOpened = false;
boolean isTravelDoc = false;
List<ActionTaken> actionsTaken = this.getDocumentHeader().getWorkflowDocument().getActionsTaken();
String disapprovalReason = findDissapprovalReason(actionsTaken);
try {
CULegacyTravelService cuLegacyTravelService = SpringContext.getBean(CULegacyTravelService.class);
isTravelDoc = cuLegacyTravelService.isCULegacyTravelIntegrationInterfaceAssociatedWithTrip(this);
if (isTravelDoc) {
// This means the DV is a Travel DV
tripReOpened = cuLegacyTravelService.reopenLegacyTrip(this.getDocumentNumber(), disapprovalReason);
LOG.info("Trip successfully reopened : " + tripReOpened);
} else {
LOG.info("DV is not a travel DV");
}
} catch (Exception ex) {
LOG.error("Exception occurred while trying to cancel a trip.", ex);
}
}
super.doRouteStatusChange(statusChangeEvent);
}
use of org.kuali.kfs.kew.actiontaken.ActionTaken in project cu-kfs by CU-CommunityApps.
the class CuPurchaseOrderAmendmentDocument method getAllPriorApprovers.
public Set<Person> getAllPriorApprovers() throws WorkflowException {
PersonService personService = KimApiServiceLocator.getPersonService();
List<ActionTaken> actionsTaken = this.getFinancialSystemDocumentHeader().getWorkflowDocument().getActionsTaken();
Set<String> principalIds = new HashSet<String>();
Set<Person> persons = new HashSet<Person>();
for (ActionTaken actionTaken : actionsTaken) {
if (KewApiConstants.ACTION_TAKEN_APPROVED_CD.equals(actionTaken.getActionTaken())) {
String principalId = actionTaken.getPrincipalId();
if (!principalIds.contains(principalId)) {
principalIds.add(principalId);
persons.add(personService.getPerson(principalId));
}
}
}
return persons;
}
use of org.kuali.kfs.kew.actiontaken.ActionTaken in project cu-kfs by CU-CommunityApps.
the class ExcludeInitiatorAndSubmitterSeparationOfDutiesRoleTypeService method getApproverOrInitiator.
private String getApproverOrInitiator(String documentId) {
String approverOrInitiatorPrincipalId = null;
String principalId = workflowDocumentService.getDocumentInitiatorPrincipalId(documentId);
List<ActionTaken> actionTakenDTOs = workflowDocumentService.getActionsTaken(documentId);
for (ActionTaken actionTaken : actionTakenDTOs) {
if (principalId.equals(actionTaken.getPrincipalId())) {
approverOrInitiatorPrincipalId = principalId;
}
}
return approverOrInitiatorPrincipalId;
}
use of org.kuali.kfs.kew.actiontaken.ActionTaken in project cu-kfs by CU-CommunityApps.
the class DisbursementVoucherDocument method getAllPriorApprovers.
public Set<Person> getAllPriorApprovers() throws WorkflowException {
PersonService personService = KimApiServiceLocator.getPersonService();
List<ActionTaken> actionsTaken = getDocumentHeader().getWorkflowDocument().getActionsTaken();
Set<String> principalIds = new HashSet<>();
Set<Person> persons = new HashSet<>();
for (ActionTaken actionTaken : actionsTaken) {
if (KewApiConstants.ACTION_TAKEN_APPROVED_CD.equals(actionTaken.getActionTaken())) {
String principalId = actionTaken.getPrincipalId();
if (!principalIds.contains(principalId)) {
principalIds.add(principalId);
persons.add(personService.getPerson(principalId));
}
}
}
return persons;
}
use of org.kuali.kfs.kew.actiontaken.ActionTaken in project cu-kfs by CU-CommunityApps.
the class ActionTakenDAOOjbImpl method load.
public ActionTaken load(String id) {
LOG.debug("Loading Action Taken for the given id " + id);
Criteria criteria = new Criteria();
criteria.addEqualTo("actionTakenId", id);
return (ActionTaken) this.getPersistenceBrokerTemplate().getObjectByQuery(new QueryByCriteria(ActionTaken.class, criteria));
}
Aggregations