当前位置: 首页>>代码示例>>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;未经允许,请勿转载。