當前位置: 首頁>>代碼示例>>Java>>正文


Java PropositionBo.createCompoundPropositionBoStub方法代碼示例

本文整理匯總了Java中org.kuali.rice.krms.impl.repository.PropositionBo.createCompoundPropositionBoStub方法的典型用法代碼示例。如果您正苦於以下問題:Java PropositionBo.createCompoundPropositionBoStub方法的具體用法?Java PropositionBo.createCompoundPropositionBoStub怎麽用?Java PropositionBo.createCompoundPropositionBoStub使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.kuali.rice.krms.impl.repository.PropositionBo的用法示例。


在下文中一共展示了PropositionBo.createCompoundPropositionBoStub方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: togglePropositionSimpleCompound

import org.kuali.rice.krms.impl.repository.PropositionBo; //導入方法依賴的package包/類
/**
 * introduces a new compound proposition between the selected proposition and its parent.
 * Additionally, it puts a new blank simple proposition underneath the compound proposition
 * as a sibling to the selected proposition.
 */
@RequestMapping(params = "methodToCall=" + "togglePropositionSimpleCompound")
public ModelAndView togglePropositionSimpleCompound(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
        HttpServletRequest request, HttpServletResponse response)
        throws Exception {

    AgendaEditor agendaEditor = getAgendaEditor(form);
    RuleBo rule = agendaEditor.getAgendaItemLine().getRule();
    String selectedPropId = agendaEditor.getSelectedPropositionId();

    resetEditModeOnPropositionTree(rule.getPropositionTree().getRootElement());

    if (!StringUtils.isBlank(selectedPropId)) {
        // find parent
        Node<RuleTreeNode,String> parent = findParentPropositionNode(
                rule.getPropositionTree().getRootElement(), selectedPropId);
        if (parent != null){

            int index = findChildIndex(parent, selectedPropId);

            PropositionBo propBo = parent.getChildren().get(index).getData().getProposition();

            // create a new compound proposition
            PropositionBo compound = PropositionBo.createCompoundPropositionBoStub(propBo, true);
            compound.setDescription("New Compound Proposition");
            compound.setEditMode(false);

            if (parent.getData() == null) { // SPECIAL CASE: this is the only proposition in the tree
                rule.setProposition(compound);
            } else {
                PropositionBo parentBo = parent.getData().getProposition();
                List<PropositionBo> siblings = parentBo.getCompoundComponents();

                int propIndex = -1;
                for (int i=0; i<siblings.size(); i++) {
                    if (propBo.getId().equals(siblings.get(i).getId())) {
                        propIndex = i;
                        break;
                    }
                }

                parentBo.getCompoundComponents().set(propIndex, compound);
            }
        }
    }

    agendaEditor.getAgendaItemLine().getRule().refreshPropositionTree(true);
    return getModelAndView(form);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:54,代碼來源:AgendaEditorController.java

示例2: togglePropositionSimpleCompound

import org.kuali.rice.krms.impl.repository.PropositionBo; //導入方法依賴的package包/類
/**
 * introduces a new compound proposition between the selected proposition and its parent.
 * Additionally, it puts a new blank simple proposition underneath the compound proposition
 * as a sibling to the selected proposition.
 */
@RequestMapping(params = "methodToCall=" + "togglePropositionSimpleCompound")
public ModelAndView togglePropositionSimpleCompound(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
        HttpServletRequest request, HttpServletResponse response)
        throws Exception {

    AgendaEditor agendaEditor = getAgendaEditor(form);
    RuleBo rule = agendaEditor.getAgendaItemLine().getRule();
    String selectedPropId = agendaEditor.getSelectedPropositionId();

    resetEditModeOnPropositionTree(rule.getPropositionTree().getRootElement());

    if (!StringUtils.isBlank(selectedPropId)) {
        // find parent
        Node<RuleTreeNode,String> parent = findParentPropositionNode(
                rule.getPropositionTree().getRootElement(), selectedPropId);
        if (parent != null){

            int index = findChildIndex(parent, selectedPropId);

            PropositionBo propBo = parent.getChildren().get(index).getData().getProposition();

            // create a new compound proposition
            PropositionBo compound = PropositionBo.createCompoundPropositionBoStub(propBo, true);
            compound.setDescription("New Compound Proposition");
            compound.setEditMode(false);

            if (parent.getData() == null) { // SPECIAL CASE: this is the only proposition in the tree
                rule.setProposition(compound);
            } else {
                PropositionBo parentBo = parent.getData().getProposition();
                List<PropositionBo> siblings = parentBo.getCompoundComponents();

                int propIndex = -1;
                for (int i=0; i<siblings.size(); i++) {
                    if (propBo.getId().equals(siblings.get(i).getId())) {
                        propIndex = i;
                        break;
                    }
                }

                parentBo.getCompoundComponents().set(propIndex, compound);
            }
        }
    }

    agendaEditor.getAgendaItemLine().getRule().refreshPropositionTree(true);
    return getUIFModelAndView(form);
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:54,代碼來源:AgendaEditorController.java


注:本文中的org.kuali.rice.krms.impl.repository.PropositionBo.createCompoundPropositionBoStub方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。