本文整理汇总了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);
}
示例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);
}