本文整理匯總了Java中org.kuali.rice.kew.rule.WorkflowRuleAttribute.setRequired方法的典型用法代碼示例。如果您正苦於以下問題:Java WorkflowRuleAttribute.setRequired方法的具體用法?Java WorkflowRuleAttribute.setRequired怎麽用?Java WorkflowRuleAttribute.setRequired使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.kuali.rice.kew.rule.WorkflowRuleAttribute
的用法示例。
在下文中一共展示了WorkflowRuleAttribute.setRequired方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getWorkflowAttribute
import org.kuali.rice.kew.rule.WorkflowRuleAttribute; //導入方法依賴的package包/類
/**
* Instantiates and returns a new instance of the WorkflowAttribute class configured on this template.
* The calling code should be sure to call isWorkflowAttribute first to verify the type of this attribute
* is that of a WorkflowAttribute. Otherwise a RuntimeException will be thrown.
*/
public WorkflowRuleAttribute getWorkflowAttribute() {
try {
Object tempAttr = ExtensionUtils.loadExtension(RuleAttribute.to(getRuleAttribute()), getRuleAttribute().getApplicationId());
if (tempAttr == null
|| !WorkflowRuleAttribute.class.isAssignableFrom(tempAttr.getClass())) {
throw new WorkflowRuntimeException("Could not find workflow attribute " + getRuleAttribute().getName());
}
WorkflowRuleAttribute workflowAttribute = (WorkflowRuleAttribute)tempAttr;
workflowAttribute.setRequired(required.booleanValue());
return workflowAttribute;
} catch (Exception e) {
throw new RuntimeException("Caught exception instantiating new " + getRuleAttribute().getResourceDescriptor(), e);
}
}
示例2: getRuleFields
import org.kuali.rice.kew.rule.WorkflowRuleAttribute; //導入方法依賴的package包/類
@Override
public WorkflowRuleAttributeFields getRuleFields(Map<String, String> parameters,
ExtensionDefinition extensionDefinition,
boolean required)
throws RiceIllegalArgumentException {
if (parameters == null) {
parameters = new HashMap<String, String>();
}
WorkflowRuleAttribute attribute = loadAttribute(extensionDefinition);
attribute.setRequired(required);
List<RemotableAttributeError> errors = attribute.validateRuleData(parameters);
List<RemotableAttributeField> fields = FieldUtils.convertRowsToAttributeFields(attribute.getRuleRows());
List<RuleExtensionValue> ruleExtensionValues = attribute.getRuleExtensionValues();
Map<String, String> ruleExtensionValuesMap = new HashMap<String, String>();
for (RuleExtensionValue ruleExtensionValue : ruleExtensionValues) {
ruleExtensionValuesMap.put(ruleExtensionValue.getKey(), ruleExtensionValue.getValue());
}
return WorkflowRuleAttributeFields.create(errors, fields, ruleExtensionValuesMap);
}
示例3: getRoutingDataFields
import org.kuali.rice.kew.rule.WorkflowRuleAttribute; //導入方法依賴的package包/類
@Override
public WorkflowRuleAttributeFields getRoutingDataFields( Map<String, String> parameters,
ExtensionDefinition extensionDefinition,
boolean required)
throws RiceIllegalArgumentException {
if (parameters == null) {
parameters = new HashMap<String, String>();
}
WorkflowRuleAttribute attribute = loadAttribute(extensionDefinition);
attribute.setRequired(required);
List<RemotableAttributeError> allErrors = attribute.validateRoutingData(parameters);
List<RemotableAttributeError> ruleDataErrors = attribute.validateRuleData(parameters);
for (RemotableAttributeError error : ruleDataErrors) {
allErrors.add(error);
}
List<RemotableAttributeField> fields = FieldUtils.convertRowsToAttributeFields(attribute.getRoutingDataRows());
List<RuleExtensionValue> ruleExtensionValues = attribute.getRuleExtensionValues();
Map<String, String> ruleExtensionValuesMap = new HashMap<String, String>();
for (RuleExtensionValue ruleExtensionValue : ruleExtensionValues) {
ruleExtensionValuesMap.put(ruleExtensionValue.getKey(), ruleExtensionValue.getValue());
}
return WorkflowRuleAttributeFields.create(allErrors, fields, ruleExtensionValuesMap);
}
示例4: getSearchFields
import org.kuali.rice.kew.rule.WorkflowRuleAttribute; //導入方法依賴的package包/類
@Override
public WorkflowRuleAttributeFields getSearchFields(Map<String, String> parameters,
ExtensionDefinition extensionDefinition,
boolean required)
throws RiceIllegalArgumentException {
if (parameters == null) {
parameters = new HashMap<String, String>();
}
WorkflowRuleAttribute attribute = loadAttribute(extensionDefinition);
attribute.setRequired(required);
List<RemotableAttributeError> errors;
List<Row> searchRows;
if (attribute instanceof WorkflowRuleSearchAttribute) {
errors = ((WorkflowRuleSearchAttribute)attribute).validateSearchData(parameters);
searchRows = ((WorkflowRuleSearchAttribute)attribute).getSearchRows();
} else {
errors = attribute.validateRuleData(parameters);
searchRows = attribute.getRuleRows();
}
List<RemotableAttributeField> fields = FieldUtils.convertRowsToAttributeFields(searchRows);
List<RuleExtensionValue> ruleExtensionValues = attribute.getRuleExtensionValues();
Map<String, String> ruleExtensionValuesMap = new HashMap<String, String>();
for (RuleExtensionValue ruleExtensionValue : ruleExtensionValues) {
ruleExtensionValuesMap.put(ruleExtensionValue.getKey(), ruleExtensionValue.getValue());
}
return WorkflowRuleAttributeFields.create(errors, fields, ruleExtensionValuesMap);
}