本文整理汇总了Java中org.kuali.rice.kew.rule.web.WebRuleUtils类的典型用法代码示例。如果您正苦于以下问题:Java WebRuleUtils类的具体用法?Java WebRuleUtils怎么用?Java WebRuleUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WebRuleUtils类属于org.kuali.rice.kew.rule.web包,在下文中一共展示了WebRuleUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSections
import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入依赖的package包/类
/**
* Override the getSections method on this maintainable so that the Section Containing the various Rule Attributes
* can be dynamically generated based on the RuleTemplate which is selected.
*/
@Override
public List getSections(MaintenanceDocument document, Maintainable oldMaintainable) {
// since the child lists are not repopulated upon loading the objects, we need to re-load them manually so the section
// generation functions.
if ( getNewRule(document) != null ) {
getNewRule(document).setRuleTemplate( getDataObjectService().find(RuleTemplateBo.class, getNewRule(document).getRuleTemplateId() ) );
}
if ( getOldRule(document) != null ) {
getOldRule(document).setRuleTemplate( getDataObjectService().find(RuleTemplateBo.class, getOldRule(document).getRuleTemplateId() ) );
}
List<Section> sections = super.getSections(document, oldMaintainable);
return WebRuleUtils.customizeSections(getThisRule(), sections, false);
}
示例2: processAfterNew
import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入依赖的package包/类
/**
* On creation of a new rule document, we must validate that a rule template and document type are set.
*/
@Override
public void processAfterNew(MaintenanceDocument document,
Map<String, String[]> parameters) {
WebRuleUtils.validateRuleTemplateAndDocumentType(getOldRule(document), getNewRule(document), parameters);
WebRuleUtils.establishDefaultRuleValues(getNewRule(document));
getNewRule(document).setDocumentId(document.getDocumentHeader().getDocumentNumber());
}
示例3: saveBusinessObject
import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入依赖的package包/类
/**
* A complete override of the implementation for saving a Rule
*/
@Override
public void saveBusinessObject() {
WebRuleUtils.clearKeysForSave(getThisRule());
WebRuleUtils.translateResponsibilitiesForSave(getThisRule());
WebRuleUtils.translateFieldValuesForSave(getThisRule());
KEWServiceLocator.getRuleService().makeCurrent(getThisRule(), true);
}
示例4: processAfterEdit
import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入依赖的package包/类
@Override
public void processAfterEdit(MaintenanceDocument document,
Map<String, String[]> parameters) {
if (!getOldRule(document).getCurrentInd()) {
throw new RiceRuntimeException("Cannot edit a non-current version of a rule.");
}
WebRuleUtils.populateForCopyOrEdit(getOldRule(document), getNewRule(document));
getNewRule(document).setPreviousRuleId(getOldRule(document).getId());
getNewRule(document).setDocumentId(document.getDocumentHeader().getDocumentNumber());
super.processAfterEdit(document, parameters);
}
示例5: setRuleAttributeErrors
import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入依赖的package包/类
protected boolean setRuleAttributeErrors(RuleBaseValues rule){
boolean isValid = true;
RuleTemplate ruleTemplate = KewApiServiceLocator.getRuleService().getRuleTemplate(rule.getRuleTemplateId());
/** Populate rule extension values * */
for (RuleTemplateAttribute ruleTemplateAttribute : ruleTemplate.getActiveRuleTemplateAttributes()) {
if (!RuleAttribute.isWorkflowAttribute(ruleTemplateAttribute.getRuleAttribute().getType())) {
continue;
}
Map<String, String> parameterMap = WebRuleUtils.getFieldMapForRuleTemplateAttribute(rule, ruleTemplateAttribute);
WorkflowRuleAttributeRows rows =
KEWServiceLocator.getWorkflowRuleAttributeMediator().getRuleRows(parameterMap, ruleTemplateAttribute);
// TODO hook validation of rule data into PreRules
List<RemotableAttributeError> errors = rows.getValidationErrors();
if (!errors.isEmpty()) {
isValid = false;
for(RemotableAttributeError error: errors){
this.putFieldError("RuleAttributes", RiceKeyConstants.ERROR_CUSTOM, error.getMessage());
}
}
}
return isValid;
}
示例6: processAfterNew
import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入依赖的package包/类
/**
* On creation of a new rule document, we must validate that a rule template and document type are set.
*/
@Override
public void processAfterNew(MaintenanceDocument document,
Map<String, String[]> parameters) {
initializeBusinessObjects(document);
WebRuleUtils.validateRuleAndResponsibility(getOldRuleDelegation(document), getNewRuleDelegation(document), parameters);
WebRuleUtils.validateRuleTemplateAndDocumentType(getOldRule(document), getNewRule(document), parameters);
WebRuleUtils.establishDefaultRuleValues(getNewRule(document));
getNewRule(document).setDocumentId(document.getDocumentHeader().getDocumentNumber());
}
示例7: saveBusinessObject
import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入依赖的package包/类
/**
* A complete override of the implementation for saving a Rule
*/
@Override
public void saveBusinessObject() {
WebRuleUtils.clearKeysForSave(getThisRuleDelegation());
WebRuleUtils.translateResponsibilitiesForSave(getThisRule());
WebRuleUtils.translateFieldValuesForSave(getThisRule());
WebRuleUtils.processRuleForDelegationSave(getThisRuleDelegation());
KEWServiceLocator.getRuleService().makeCurrent(getThisRuleDelegation(), true);
}
示例8: processAfterEdit
import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入依赖的package包/类
@Override
public void processAfterEdit(MaintenanceDocument document,
Map<String, String[]> parameters) {
if (!getOldRule(document).getCurrentInd()) {
throw new RiceRuntimeException("Cannot edit a non-current version of a rule.");
}
WebRuleUtils.populateForCopyOrEdit(getOldRule(document), getNewRule(document));
getNewRule(document).setPreviousRuleId(getOldRule(document).getId());
getNewRule(document).setDocumentId(document.getDocumentHeader().getDocumentNumber());
super.processAfterEdit(document, parameters);
}
示例9: assertRuleBaseValuesStateIndependence
import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入依赖的package包/类
/**
* verifies that rule exports are the same regardless of whether the rule is ready for render, or
* for persistance.
*/
protected void assertRuleBaseValuesStateIndependence() throws Exception {
for (Object o : KEWServiceLocator.getRuleService().fetchAllRules(true)) {
RuleBaseValues rule = (RuleBaseValues)o;
KewExportDataSet dataSet = new KewExportDataSet();
dataSet.getRules().add(rule);
// first, do a conversion in the just-loaded state:
byte[] saveXmlBytes = CoreApiServiceLocator.getXmlExporterService().export(dataSet.createExportDataSet());
String saveStr = new String(saveXmlBytes);
// now, convert for render:
WebRuleUtils.populateRuleMaintenanceFields(rule);
// do another conversion in the ready-for-render state:
byte[] loadXmlBytes = CoreApiServiceLocator.getXmlExporterService().export(dataSet.createExportDataSet());
String loadStr = new String(loadXmlBytes);
// FIXME: currently failing due to:
// * WebRuleUtils.populateRuleMaintenanceFields clears rule extensions
// * RuleXmlExporter detects missing extensions and re-adds them: but in a different order...
// check that the results are identical:
assertTrue("The load/render state of the RuleBaseValues shouldn't effect the export: \n" +
saveStr + "\n\n != \n\n" + loadStr,
StringUtils.equals(saveStr, loadStr));
}
}
示例10: getSections
import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入依赖的package包/类
/**
* Override the getSections method on this maintainable so that the Section Containing the various Rule Attributes
* can be dynamically generated based on the RuleTemplate which is selected.
*/
@Override
public List getSections(MaintenanceDocument document, Maintainable oldMaintainable) {
List<Section> sections = super.getSections(document, oldMaintainable);
return WebRuleUtils.customizeSections(getThisRule(), sections, false);
}
示例11: processAfterNew
import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入依赖的package包/类
/**
* On creation of a new rule document, we must validate that a rule template and document type are set.
*/
@Override
public void processAfterNew(MaintenanceDocument document,
Map<String, String[]> parameters) {
WebRuleUtils.validateRuleTemplateAndDocumentType(getOldRule(document), getNewRule(document), parameters);
WebRuleUtils.establishDefaultRuleValues(getNewRule(document));
getNewRule(document).setDocumentId(document.getDocumentHeader().getDocumentNumber());
}
示例12: processAfterEdit
import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入依赖的package包/类
@Override
public void processAfterEdit(MaintenanceDocument document,
Map<String, String[]> parameters) {
if (!getOldRule(document).getCurrentInd()) {
throw new RiceRuntimeException("Cannot edit a non-current version of a rule.");
}
WebRuleUtils.populateForCopyOrEdit(getOldRule(document), getNewRule(document));
getNewRule(document).setPreviousRuleId(getOldRule(document).getId());
getNewRule(document).setDocumentId(document.getDocumentHeader().getDocumentNumber());
super.processAfterEdit(document, parameters);
}
示例13: retrieveDataObject
import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入依赖的package包/类
@Override
public Object retrieveDataObject(Map fieldValues){
RuleBaseValues rule = (RuleBaseValues)super.retrieveDataObject(fieldValues);
WebRuleUtils.populateRuleMaintenanceFields(rule);
return rule;
}
示例14: getBusinessObject
import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入依赖的package包/类
/**
* This overridden method ...
*
* @see org.kuali.rice.krad.inquiry.Inquirable#getBusinessObject(java.util.Map)
*/
public BusinessObject getBusinessObject(Map fieldValues) {
RuleBaseValues rule = (RuleBaseValues)super.getBusinessObject(fieldValues);
WebRuleUtils.populateRuleMaintenanceFields(rule);
return rule;
}
示例15: retrieveDataObject
import org.kuali.rice.kew.rule.web.WebRuleUtils; //导入依赖的package包/类
@Override
public Object retrieveDataObject(Map fieldValues){
RuleDelegationBo rule = (RuleDelegationBo)super.retrieveDataObject(fieldValues);
WebRuleUtils.populateRuleMaintenanceFields(rule.getDelegationRule());
return rule;
}