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


Java WorkflowDocument.isApprovalRequested方法代码示例

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


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

示例1: determineValidActions

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
public static List<String> determineValidActions(WorkflowDocument wfdoc) throws WorkflowException {
    String[] flags = new String[10];
    List<String> list = new ArrayList<String>();
    
    if (wfdoc == null) {
        list.add(UserAction.ACTION_CREATE);
        return list;
    }
    
    if (wfdoc.isAcknowledgeRequested()) {
        flags[buttons.ACKNOWLEDGE.ordinal()] = UserAction.ACTION_ACKNOWLEDGE;
    }
    
    if (wfdoc.isApprovalRequested()) {
        if (wfdoc.isBlanketApproveCapable()) {
            flags[buttons.BLANKETAPPROVE.ordinal()] = UserAction.ACTION_BLANKETAPPROVE;
        }
        if (!wfdoc.isSaved()) {
            flags[buttons.APPROVE.ordinal()] = UserAction.ACTION_APPROVE;
            flags[buttons.DISAPPROVE.ordinal()] = UserAction.ACTION_DISAPPROVE;
        }
        
        // should invoke WorkflowDocument.saveRoutingData(...).
        flags[buttons.SAVE.ordinal()] = UserAction.ACTION_SAVE;
        if (wfdoc.getPreviousNodeNames().size() > 0) {
            flags[buttons.RETURNTOPREVIOUS.ordinal()] = UserAction.ACTION_RETURN_TO_PREVIOUS;
        }
    }
    
    // this will never happen, but left code in case this gets figured out later
    // if allowed to execute save/approve and complete will both show
    else if (wfdoc.isCompletionRequested()) {
        flags[buttons.COMPLETE.ordinal()] = UserAction.ACTION_COMPLETE;
        if (wfdoc.isBlanketApproveCapable()) {
            flags[buttons.BLANKETAPPROVE.ordinal()] = UserAction.ACTION_BLANKETAPPROVE;
        }
    }
    
    if (wfdoc.isFYIRequested()) {
        flags[buttons.FYI.ordinal()] = UserAction.ACTION_FYI;
    }
    
    if (wfdoc.isRouteCapable()) {
        flags[buttons.ROUTE.ordinal()] = UserAction.ACTION_ROUTE;
        if (wfdoc.isBlanketApproveCapable()) {
            flags[buttons.BLANKETAPPROVE.ordinal()] = UserAction.ACTION_BLANKETAPPROVE;
        }
    }
    
    if (wfdoc.isApprovalRequested() || wfdoc.isRouteCapable()) {
        flags[buttons.SAVE.ordinal()] = UserAction.ACTION_SAVE;
    }
    
    if (wfdoc.isCompletionRequested() || wfdoc.isRouteCapable()) {
        flags[buttons.CANCEL.ordinal()] = UserAction.ACTION_CANCEL;
    }

    for (int i = 0; i < flags.length; i++) {
        if (flags[i] != null) {
            list.add(flags[i]);
        }
    }

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


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