当前位置: 首页>>代码示例>>Java>>正文


Java WorkflowDocument.isInitiated方法代码示例

本文整理汇总了Java中org.kuali.rice.kew.api.WorkflowDocument.isInitiated方法的典型用法代码示例。如果您正苦于以下问题:Java WorkflowDocument.isInitiated方法的具体用法?Java WorkflowDocument.isInitiated怎么用?Java WorkflowDocument.isInitiated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.kew.api.WorkflowDocument的用法示例。


在下文中一共展示了WorkflowDocument.isInitiated方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: lockCanBeIgnored

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * Guesses whether the current user should be allowed to change a document even though it is locked. It
 * probably should use Authorization instead? See KULNRVSYS-948
 *
 * @param lockedDocument
 * @return true if the document lock can be ignored
 *
 */
private static boolean lockCanBeIgnored(WorkflowDocument lockedDocument) {
    // TODO: implement real authorization for Maintenance Document Save/Route - KULNRVSYS-948
    if (lockedDocument == null) {
        return true;
    }

    // get the user-id. if no user-id, then we can do this test, so exit
    String userId = GlobalVariables.getUserSession().getPrincipalId().trim();
    if (StringUtils.isBlank(userId)) {
        return false; // dont bypass locking
    }

    // if the current user is not the initiator of the blocking document
    if (!userId.equalsIgnoreCase(lockedDocument.getInitiatorPrincipalId().trim())) {
        return false;
    }

    // if the blocking document hasn't been routed, we can ignore it
    return lockedDocument.isInitiated();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:MaintenanceUtils.java

示例2: addStandardAttributes

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
protected void addStandardAttributes(Document document, Map<String, String> attributes) {
    WorkflowDocument wd = document.getDocumentHeader().getWorkflowDocument();
    attributes.put(KimConstants.AttributeConstants.DOCUMENT_NUMBER, document.getDocumentNumber());
    attributes.put(KimConstants.AttributeConstants.DOCUMENT_TYPE_NAME, wd.getDocumentTypeName());

    if (wd.isInitiated() || wd.isSaved()) {
        attributes.put(KimConstants.AttributeConstants.ROUTE_NODE_NAME, PRE_ROUTING_ROUTE_NAME);
    } else {
        attributes.put(KimConstants.AttributeConstants.ROUTE_NODE_NAME,
                KRADServiceLocatorWeb.getWorkflowDocumentService().getCurrentRouteNodeNames(wd));
    }

    attributes.put(KimConstants.AttributeConstants.ROUTE_STATUS_CODE, wd.getStatus().getCode());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:15,代码来源:DocumentViewAuthorizerBase.java

示例3: addStandardAttributes

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
protected void addStandardAttributes(Document document, Map<String, String> attributes) {
    WorkflowDocument wd = document.getDocumentHeader().getWorkflowDocument();
    attributes.put(KimConstants.AttributeConstants.DOCUMENT_NUMBER, document.getDocumentNumber());
    attributes.put(KimConstants.AttributeConstants.DOCUMENT_TYPE_NAME, wd.getDocumentTypeName());
    if (wd.isInitiated() || wd.isSaved()) {
        attributes.put(KimConstants.AttributeConstants.ROUTE_NODE_NAME, PRE_ROUTING_ROUTE_NAME);
    } else {
        attributes.put(KimConstants.AttributeConstants.ROUTE_NODE_NAME,
                KRADServiceLocatorWeb.getWorkflowDocumentService().getCurrentRouteNodeNames(wd));
    }
    attributes.put(KimConstants.AttributeConstants.ROUTE_STATUS_CODE, wd.getStatus().getCode());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:DocumentAuthorizerBase.java

示例4: processRouteDocument

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * @see MaintenanceDocumentRule#processRouteDocument(org.kuali.rice.krad.document.Document)
 */
@Override
public boolean processRouteDocument(Document document) {
    LOG.info("processRouteDocument called");

    MaintenanceDocument maintenanceDocument = (MaintenanceDocument) document;

    boolean completeRequestPending = RouteToCompletionUtil.checkIfAtleastOneAdHocCompleteRequestExist(
            maintenanceDocument);

    // Validate the document if the header is valid and no pending completion requests
    if (completeRequestPending) {
        return true;
    }

    // get the documentAuthorizer for this document
    MaintenanceDocumentAuthorizer documentAuthorizer =
            (MaintenanceDocumentAuthorizer) getDocumentDictionaryService().getDocumentAuthorizer(document);

    // remove all items from the errorPath temporarily (because it may not
    // be what we expect, or what we need)
    clearErrorPath();

    // setup convenience pointers to the old & new bo
    setupBaseConvenienceObjects(maintenanceDocument);

    // apply rules that are common across all maintenance documents, regardless of class
    processGlobalSaveDocumentBusinessRules(maintenanceDocument);

    // from here on, it is in a default-success mode, and will route unless one of the
    // business rules stop it.
    boolean success = true;

    WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
    if (workflowDocument.isInitiated() || workflowDocument.isSaved()) {
        try {
            success &= documentAuthorizer.canCreateOrMaintain((MaintenanceDocument) document,
                    GlobalVariables.getUserSession().getPerson());
            if (success == false) {
                GlobalVariables.getMessageMap().putError(KRADConstants.DOCUMENT_ERRORS,
                        RiceKeyConstants.AUTHORIZATION_ERROR_DOCUMENT,
                        new String[]{GlobalVariables.getUserSession().getPerson().getPrincipalName(),
                                "Create/Maintain", getDocumentDictionaryService().getMaintenanceDocumentTypeName(
                                newDataObject.getClass())});
            }
        } catch (RiceIllegalArgumentException e) {
            // TODO error message the right way
            GlobalVariables.getMessageMap().putError("Unable to determine authorization due to previous errors",
                    "Unable to determine authorization due to previous errors");
        }
    }
    // apply rules that are common across all maintenance documents, regardless of class
    success &= processGlobalRouteDocumentBusinessRules(maintenanceDocument);

    // apply rules that are specific to the class of the maintenance document
    // (if implemented). this will always succeed if not overloaded by the
    // subclass
    success &= processCustomRouteDocumentBusinessRules(maintenanceDocument);

    success &= processInactivationBlockChecking(maintenanceDocument);

    // return the original set of items to the errorPath, to ensure no impact
    // on other upstream or downstream items that rely on the errorPath
    resumeErrorPath();

    return success;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:70,代码来源:MaintenanceDocumentRuleBase.java

示例5: processRouteDocument

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * @see org.kuali.rice.krad.rules.MaintenanceDocumentRule#processRouteDocument(org.kuali.rice.krad.document.Document)
 */
@Override
public boolean processRouteDocument(Document document) {
    LOG.info("processRouteDocument called");

    MaintenanceDocument maintenanceDocument = (MaintenanceDocument) document;

    boolean completeRequestPending = RouteToCompletionUtil.checkIfAtleastOneAdHocCompleteRequestExist(maintenanceDocument);

    // Validate the document if the header is valid and no pending completion requests
    if (completeRequestPending) {
        return true;
    }
    
    // get the documentAuthorizer for this document
    MaintenanceDocumentAuthorizer documentAuthorizer =
            (MaintenanceDocumentAuthorizer) getDocumentHelperService().getDocumentAuthorizer(document);

    // remove all items from the errorPath temporarily (because it may not
    // be what we expect, or what we need)
    clearErrorPath();

    // setup convenience pointers to the old & new bo
    setupBaseConvenienceObjects(maintenanceDocument);

    // apply rules that are common across all maintenance documents, regardless of class
    processGlobalSaveDocumentBusinessRules(maintenanceDocument);

    // from here on, it is in a default-success mode, and will route unless one of the
    // business rules stop it.
    boolean success = true;

    WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
    if (workflowDocument.isInitiated() || workflowDocument.isSaved()) {
        success &= documentAuthorizer
                .canCreateOrMaintain((MaintenanceDocument) document, GlobalVariables.getUserSession().getPerson());
        if (success == false) {
            GlobalVariables.getMessageMap()
                    .putError(KRADConstants.DOCUMENT_ERRORS, RiceKeyConstants.AUTHORIZATION_ERROR_DOCUMENT,
                            new String[]{GlobalVariables.getUserSession().getPerson().getPrincipalName(),
                                    "Create/Maintain",
                                    this.getMaintDocDictionaryService().getDocumentTypeName(newBo.getClass())});
        }
    }
    // apply rules that are common across all maintenance documents, regardless of class
    success &= processGlobalRouteDocumentBusinessRules(maintenanceDocument);

    // apply rules that are specific to the class of the maintenance document
    // (if implemented). this will always succeed if not overloaded by the
    // subclass
    success &= processCustomRouteDocumentBusinessRules(maintenanceDocument);

    success &= processInactivationBlockChecking(maintenanceDocument);

    // return the original set of items to the errorPath, to ensure no impact
    // on other upstream or downstream items that rely on the errorPath
    resumeErrorPath();

    return success;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:63,代码来源:MaintenanceDocumentRuleBase.java


注:本文中的org.kuali.rice.kew.api.WorkflowDocument.isInitiated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。