本文整理汇总了Java中org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange类的典型用法代码示例。如果您正苦于以下问题:Java DocumentRouteStatusChange类的具体用法?Java DocumentRouteStatusChange怎么用?Java DocumentRouteStatusChange使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DocumentRouteStatusChange类属于org.kuali.rice.kew.framework.postprocessor包,在下文中一共展示了DocumentRouteStatusChange类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doRouteStatusChange
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange; //导入依赖的package包/类
public ProcessDocReport doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) throws Exception {
// defend against re-entrancy by only throwing the route status change exception if the status change we are undergoing is not a transition into exception state!
// if we don't do this, this postprocessor will blow up when it is subsequently notified about the transition into exception state that it previously caused
// which will result in the document never actually transitioning into exception state
boolean transitioningIntoException = !KewApiConstants.ROUTE_HEADER_EXCEPTION_CD.equals(statusChangeEvent.getOldRouteStatus()) &&
KewApiConstants.ROUTE_HEADER_EXCEPTION_CD.equals(statusChangeEvent.getNewRouteStatus());
if (THROW_ROUTE_STATUS_CHANGE_EXCEPTION && !transitioningIntoException) {
throw new RuntimeException("I am the doRouteStatusChange exploder");
}
if (BLOW_UP_ON_TRANSITION_INTO_EXCEPTION && transitioningIntoException) {
throw new RuntimeException("Throwing an exception when transitioning into exception status.");
}
if (KewApiConstants.ROUTE_HEADER_EXCEPTION_CD.equals(statusChangeEvent.getOldRouteStatus())) {
TRANSITIONED_OUT_OF_EXCEPTION_ROUTING = true;
}
return new ProcessDocReport(true, "");
}
示例2: testEmptyProcess
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange; //导入依赖的package包/类
/**
* creates a new doc of the given type and routes it, asserting that it goes final
* @throws Exception
*/
@Test public void testEmptyProcess() throws Exception {
PostProcessor.clear();
WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), DOCUMENT_TYPE_NAME);
document.route("test");
assertNotNull(document.getDocumentId());
assertTrue(document.isFinal());
// verify that the PostProcessor invoked the proper status transitions
// Initiated -> Enroute -> Processed -> Final
assertEquals(3, PostProcessor.statusChanges.size());
DocumentRouteStatusChange iToR = PostProcessor.statusChanges.get(0);
DocumentRouteStatusChange rToP = PostProcessor.statusChanges.get(1);
DocumentRouteStatusChange pToF = PostProcessor.statusChanges.get(2);
assertEquals(DocumentStatus.INITIATED.getCode(), iToR.getOldRouteStatus());
assertEquals(DocumentStatus.ENROUTE.getCode(), iToR.getNewRouteStatus());
assertEquals(DocumentStatus.ENROUTE.getCode(), rToP.getOldRouteStatus());
assertEquals(DocumentStatus.PROCESSED.getCode(), rToP.getNewRouteStatus());
assertEquals(DocumentStatus.PROCESSED.getCode(), pToF.getOldRouteStatus());
assertEquals(DocumentStatus.FINAL.getCode(), pToF.getNewRouteStatus());
}
示例3: doRouteStatusChange
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange; //导入依赖的package包/类
public ProcessDocReport doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) throws Exception {
if (KewApiConstants.ROUTE_HEADER_PROCESSED_CD.equals(statusChangeEvent.getNewRouteStatus())) {
WorkflowDocument document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("ewestfal"), statusChangeEvent.getDocumentId());
document.setApplicationContent(APPLICATION_CONTENT);
document.setTitle(DOC_TITLE);
document.saveDocumentData();
// now route another document from the post processor, sending it an adhoc request
WorkflowDocument ppDocument = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("user1"), "testModifyDocumentInPostProcessor");
routedDocumentId = ppDocument.getDocumentId();
// principal id 1 = ewestfal
ppDocument.adHocToPrincipal(ActionRequestType.APPROVE, "AdHoc", "", "2001", "", true);
ppDocument.route("");
processedChange = true;
}
return new ProcessDocReport(true);
}
示例4: doRouteStatusChange
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange; //导入依赖的package包/类
/**
* This is the default implementation which checks for a different workflow statuses, and updates the Kuali status accordingly.
*
* @see org.kuali.rice.krad.document.Document#doRouteStatusChange()
*/
@Override
public void doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) {
if (getDocumentHeader().getWorkflowDocument().isCanceled()) {
getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(OLEConstants.DocumentStatusCodes.CANCELLED);
}
else if (getDocumentHeader().getWorkflowDocument().isEnroute()) {
getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(OLEConstants.DocumentStatusCodes.ENROUTE);
}
if (getDocumentHeader().getWorkflowDocument().isDisapproved()) {
getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(OLEConstants.DocumentStatusCodes.DISAPPROVED);
}
if (getDocumentHeader().getWorkflowDocument().isProcessed()) {
getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(OLEConstants.DocumentStatusCodes.APPROVED);
}
if ( LOG.isInfoEnabled() ) {
LOG.info("Status is: " + getFinancialSystemDocumentHeader().getFinancialDocumentStatusCode());
}
super.doRouteStatusChange(statusChangeEvent);
}
示例5: doRouteStatusChange
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.document.DocumentBase#doRouteStatusChange()
*/
@Override
public void doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) {
super.doRouteStatusChange(statusChangeEvent);
WorkflowDocument kwd = getDocumentHeader().getWorkflowDocument();
if (LOG.isDebugEnabled()) {
logState();
}
if (kwd.isProcessed()) {
// all approvals have been processed, finalize everything
SpringContext.getBean(CashManagementService.class).finalizeCashManagementDocument(this);
}
else if (kwd.isCanceled() || kwd.isDisapproved()) {
// document has been canceled or disapproved
SpringContext.getBean(CashManagementService.class).cancelCashManagementDocument(this);
}
}
示例6: buildNotificationBody
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange; //导入依赖的package包/类
/**
* collect all the information and build the notification body
*/
protected String buildNotificationBody(TravelDocument travelDocument, DocumentRouteStatusChange statusChange, NotificationPreference preference) {
Map<String, Object> notificationInformationHolder = new HashMap<String, Object>();
notificationInformationHolder.put(TemConstants.NOTIFICATION_PREFERENCE, preference.getLabel());
notificationInformationHolder.put(KFSPropertyConstants.DOCUMENT, travelDocument);
notificationInformationHolder.put(TemConstants.STATUS_CHANGE_DTO, statusChange);
String newStatusLabel = KewApiConstants.DOCUMENT_STATUSES.get(statusChange.getNewRouteStatus());
notificationInformationHolder.put(TemPropertyConstants.NEW_ROUTE_STATUS, newStatusLabel);
String oldStatusLabel = KewApiConstants.DOCUMENT_STATUSES.get(statusChange.getOldRouteStatus());
notificationInformationHolder.put(TemPropertyConstants.OLD_ROUTE_STATUS, oldStatusLabel);
String campusTravelEmailAddress = this.getCampusTravelEmailAddress();
notificationInformationHolder.put(TemConstants.CAMPUS_TRAVEL_EMAIL_ADDRESS, campusTravelEmailAddress);
notificationInformationHolder.put(DateTimeService.class.getSimpleName(), dateTimeService);
return this.getKfsNotificationService().generateNotificationContent(this.getNotificationTemplate(), notificationInformationHolder);
}
示例7: doRouteStatusChange
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange; //导入依赖的package包/类
/**
* @see org.kuali.rice.kns.document.Document#doRouteStatusChange(org.kuali.rice.kew.dto.DocumentRouteStatusChange)
*/
@Override
public void doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) {
super.doRouteStatusChange(statusChangeEvent);
//doc is final / processed
if (DocumentStatus.PROCESSED.getCode().equals(statusChangeEvent.getNewRouteStatus())) {
retirePreviousAuthorizations();
final DocumentAttributeIndexingQueue documentAttributeIndexingQueue = KewApiServiceLocator.getDocumentAttributeIndexingQueue();
try {
updateAndSaveAppDocStatus(TravelAuthorizationStatusCodeKeys.CLOSED);
documentAttributeIndexingQueue.indexDocument(getDocumentNumber());
}
catch (WorkflowException we) {
throw new RuntimeException("Workflow document exception while updating related documents", we);
}
}
}
示例8: doRouteStatusChange
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange; //导入依赖的package包/类
/**
* @see org.kuali.kfs.module.tem.document.TravelDocumentBase#doRouteStatusChange(org.kuali.rice.kew.dto.DocumentRouteStatusChange)
*/
@Override
public void doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) {
super.doRouteStatusChange(statusChangeEvent);
if (DocumentStatus.PROCESSED.getCode().equals(statusChangeEvent.getNewRouteStatus())) {
LOG.debug("New route status is: " + statusChangeEvent.getNewRouteStatus());
try {
updateAndSaveAppDocStatus(TravelRelocationStatusCodeKeys.RELO_MANAGER_APPROVED);
}
catch (WorkflowException ex) {
// TODO Auto-generated catch block
ex.printStackTrace();
}
}
}
示例9: doRouteStatusChange
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange; //导入依赖的package包/类
@Override
public void doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) {
super.doRouteStatusChange(statusChangeEvent);
DocumentStatus status = getDocumentHeader().getWorkflowDocument().getStatus();
if (status.equals(DocumentStatus.PROCESSED)){
TemProfileAccount profileAccount = new TemProfileAccount();
Calendar cal = Calendar.getInstance();
profileAccount.setEffectiveDate(new java.sql.Date(cal.getTimeInMillis()));
String code = getParameterService().getParameterValueAsString(TemCTSCardApplicationDocument.class, TemConstants.CENTRAL_TRAVEL_SYSTEM_CARD_CODE);
Map<String, String> fieldValues = new HashMap<String, String>();
fieldValues.put(TemPropertyConstants.CREDIT_CARD_AGENCY_CODE, code);
List<CreditCardAgency> creditCardAgencyList = (List<CreditCardAgency>) getBusinessObjectService().findMatching(CreditCardAgency.class, fieldValues);
CreditCardAgency creditCardAgency = creditCardAgencyList.get(0);
profileAccount.setCreditCardAgency(creditCardAgency);
profileAccount.setCreditCardOrAgencyCode(creditCardAgency.getCreditCardOrAgencyCode());
profileAccount.setName(creditCardAgency.getCreditCardOrAgencyName());
profileAccount.setActive(true);
profileAccount.setAccountNumber(temProfile.getEmployeeId());
String text = getConfigurationService().getPropertyValueAsString(TemKeyConstants.CARD_NOTE_TEXT);
DateFormatter formatter = new DateFormatter();
String note = MessageFormat.format(text, formatter.format(new java.util.Date()), getDocumentHeader().getDocumentNumber());
profileAccount.setNote(note);
getTemProfile().getAccounts().add(profileAccount);
getBusinessObjectService().save(temProfile);
}
}
示例10: doRouteStatusChange
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange; //导入依赖的package包/类
/**
* @see org.kuali.kfs.module.tem.document.TravelDocumentBase#doRouteStatusChange(org.kuali.rice.kew.dto.DocumentRouteStatusChange)
*/
@Override
public void doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) {
super.doRouteStatusChange(statusChangeEvent);
if (DocumentStatus.PROCESSED.getCode().equals(statusChangeEvent.getNewRouteStatus())) {
LOG.debug("New route status is " + statusChangeEvent.getNewRouteStatus());
// for some reason when it goes to final it never updates to the last status
try {
updateAndSaveAppDocStatus(EntertainmentStatusCodeKeys.ENT_MANAGER_APPROVED);
}
catch (WorkflowException ex) {
// TODO Auto-generated catch block
ex.printStackTrace();
}
}
}
示例11: doRouteStatusChange
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange; //导入依赖的package包/类
/**
* This is the default implementation which checks for a different workflow statuses, and updates the Kuali status accordingly.
*
* @see org.kuali.rice.krad.document.Document#doRouteStatusChange()
*/
@Override
public void doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) {
getFinancialSystemDocumentHeader().setWorkflowDocumentStatusCode(statusChangeEvent.getNewRouteStatus());
if (getDocumentHeader().getWorkflowDocument().isCanceled()) {
getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(KFSConstants.DocumentStatusCodes.CANCELLED);
}
else if (getDocumentHeader().getWorkflowDocument().isEnroute()) {
getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(KFSConstants.DocumentStatusCodes.ENROUTE);
}
if (getDocumentHeader().getWorkflowDocument().isDisapproved()) {
getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(KFSConstants.DocumentStatusCodes.DISAPPROVED);
}
if (getDocumentHeader().getWorkflowDocument().isProcessed()) {
getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(KFSConstants.DocumentStatusCodes.APPROVED);
}
if ( LOG.isInfoEnabled() ) {
LOG.info("Status is: " + getFinancialSystemDocumentHeader().getFinancialDocumentStatusCode());
}
super.doRouteStatusChange(statusChangeEvent);
}
示例12: doRouteStatusChange
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange; //导入依赖的package包/类
/**
* This is the default implementation which checks for a different workflow statuses, and updates the Kuali status accordingly.
*
* @see org.kuali.rice.krad.document.Document#doRouteStatusChange()
*/
@Override
public void doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) {
// set the route status
getFinancialSystemDocumentHeader().setWorkflowDocumentStatusCode(getWorkflowDocumentStatusCode(DocumentStatus.fromCode(statusChangeEvent.getNewRouteStatus())));
getFinancialSystemDocumentHeader().setApplicationDocumentStatus(getFinancialSystemDocumentHeader().getWorkflowDocument().getApplicationDocumentStatus());
if (getDocumentHeader().getWorkflowDocument().isCanceled()) {
getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(KFSConstants.DocumentStatusCodes.CANCELLED);
}
else if (getDocumentHeader().getWorkflowDocument().isEnroute()) {
getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(KFSConstants.DocumentStatusCodes.ENROUTE);
}
if (getDocumentHeader().getWorkflowDocument().isDisapproved()) {
getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(KFSConstants.DocumentStatusCodes.DISAPPROVED);
}
if (getDocumentHeader().getWorkflowDocument().isProcessed()) {
getFinancialSystemDocumentHeader().setFinancialDocumentStatusCode(KFSConstants.DocumentStatusCodes.APPROVED);
}
if ( LOG.isInfoEnabled() ) {
LOG.info("Document: " + statusChangeEvent.getDocumentId() + " -- Status is: " + getFinancialSystemDocumentHeader().getFinancialDocumentStatusCode());
}
super.doRouteStatusChange(statusChangeEvent);
}
示例13: doRouteStatusChange
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange; //导入依赖的package包/类
/**
* If the document final, unlock the document
*
* @see org.kuali.rice.krad.document.DocumentBase#doRouteStatusChange()
*/
@Override
public void doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) {
super.doRouteStatusChange(statusChangeEvent);
WorkflowDocument workflowDocument = getDocumentHeader().getWorkflowDocument();
if (workflowDocument.isProcessed()) {
SpringContext.getBean(EquipmentLoanOrReturnService.class).processApprovedEquipmentLoanOrReturn(this);
}
// Remove asset lock when doc status change. We don't include isFinal since document always go to 'processed' first.
if (workflowDocument.isCanceled() || workflowDocument.isDisapproved() || workflowDocument.isProcessed()) {
this.getCapitalAssetManagementModuleService().deleteAssetLocks(this.getDocumentNumber(), null);
}
}
示例14: doRouteStatusChange
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange; //导入依赖的package包/类
/**
* @see org.kuali.kfs.sys.document.GeneralLedgerPostingDocumentBase#doRouteStatusChange()
*/
@Override
public void doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) {
super.doRouteStatusChange(statusChangeEvent);
WorkflowDocument workflowDocument = getDocumentHeader().getWorkflowDocument();
// Update asset payment table with the approved asset detail records.
if (workflowDocument.isProcessed()) {
SpringContext.getBean(AssetPaymentService.class).processApprovedAssetPayment(this);
}
// Remove asset lock when doc status change. We don't include
// isFinal since document always go to 'processed' first.
if (workflowDocument.isCanceled() || workflowDocument.isDisapproved() || workflowDocument.isProcessed()) {
this.getCapitalAssetManagementModuleService().deleteAssetLocks(this.getDocumentNumber(), null);
}
if (isCapitalAssetBuilderOriginIndicator()) {
SpringContext.getBean(CapitalAssetBuilderModuleService.class).notifyRouteStatusChange(getDocumentHeader());
}
}
示例15: doRouteStatusChange
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange; //导入依赖的package包/类
@Override
public ProcessDocReport doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) throws Exception {
ProcessDocReport pdr = null;
Long documentId = new Long(statusChangeEvent.getDocumentId());
LeaveCalendarDocumentHeader document = LmServiceLocator.getLeaveCalendarDocumentHeaderService().getDocumentHeader(documentId.toString());
if (document != null) {
pdr = super.doRouteStatusChange(statusChangeEvent);
// Only update the status if it's different.
if (!document.getDocumentStatus().equals(statusChangeEvent.getNewRouteStatus())) {
DocumentStatus newDocumentStatus = DocumentStatus.fromCode(statusChangeEvent.getNewRouteStatus());
updateLeaveCalendarDocumentHeaderStatus(document, newDocumentStatus);
calculateMaxCarryOver(document, newDocumentStatus);
}
}
return pdr;
}