本文整理匯總了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);
}