本文整理匯總了Java中org.kuali.rice.kew.rule.WorkflowRuleAttribute類的典型用法代碼示例。如果您正苦於以下問題:Java WorkflowRuleAttribute類的具體用法?Java WorkflowRuleAttribute怎麽用?Java WorkflowRuleAttribute使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
WorkflowRuleAttribute類屬於org.kuali.rice.kew.rule包,在下文中一共展示了WorkflowRuleAttribute類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: loadAttribute
import org.kuali.rice.kew.rule.WorkflowRuleAttribute; //導入依賴的package包/類
private WorkflowRuleAttribute loadAttribute(ExtensionDefinition extensionDefinition) {
if (extensionDefinition == null) {
throw new RiceIllegalArgumentException("extensionDefinition was null or blank");
}
Object attribute = ExtensionUtils.loadExtension(extensionDefinition);
if (attribute == null) {
throw new RiceIllegalArgumentException("Failed to load WorkflowRuleAttribute for: " + extensionDefinition);
}
if (!WorkflowRuleAttribute.class.isAssignableFrom(attribute.getClass())) {
throw new RiceIllegalArgumentException("Failed to locate a WorkflowRuleAttribute with the given name: " + extensionDefinition.getName());
}
if (attribute instanceof XmlConfiguredAttribute) {
((XmlConfiguredAttribute) attribute).setExtensionDefinition(extensionDefinition);
}
return (WorkflowRuleAttribute) attribute;
}
示例5: generateDocContent
import org.kuali.rice.kew.rule.WorkflowRuleAttribute; //導入依賴的package包/類
private static String generateDocContent(List attributes) {
StringBuffer buffer = new StringBuffer();
buffer.append("<").append(KewApiConstants.DOCUMENT_CONTENT_ELEMENT).append(">");
buffer.append("<").append(KewApiConstants.ATTRIBUTE_CONTENT_ELEMENT).append(">");
for (Iterator iterator = attributes.iterator(); iterator.hasNext();) {
WorkflowRuleAttribute attribute = (WorkflowRuleAttribute) iterator.next();
buffer.append(attribute.getDocContent());
}
buffer.append("</").append(KewApiConstants.ATTRIBUTE_CONTENT_ELEMENT).append(">");
buffer.append("</").append(KewApiConstants.DOCUMENT_CONTENT_ELEMENT).append(">");
return buffer.toString();
}
示例6: getAttribute
import org.kuali.rice.kew.rule.WorkflowRuleAttribute; //導入依賴的package包/類
public Object getAttribute() {
try {
//ObjectDefinition objectDefinition = new ObjectDefinition(getRuleAttribute().getResourceDescriptor(), getRuleAttribute().getApplicationId());
Object attribute = ExtensionUtils.loadExtension(RuleAttribute.to(getRuleAttribute()), getRuleAttribute().getApplicationId());
if (attribute == null) {
throw new WorkflowRuntimeException("Could not find attribute " + getRuleAttribute().getName());
}
if (attribute instanceof WorkflowRuleAttribute) {
((WorkflowRuleAttribute) attribute).setRequired(required.booleanValue());
}
return attribute;
} catch (Exception e) {
throw new RuntimeException("Caught error attempting to load attribute class: " + getRuleAttribute().getResourceDescriptor(), e);
}
}
示例7: getRuleAttributeByClassName
import org.kuali.rice.kew.rule.WorkflowRuleAttribute; //導入依賴的package包/類
private List<WorkflowRuleAttribute> getRuleAttributeByClassName(String ruleAttributeClassName) {
List<ExtensionDefinition> extensionDefinitions =
KewApiServiceLocator.getExtensionRepositoryService().getExtensionsByResourceDescriptor(ruleAttributeClassName);
List<WorkflowRuleAttribute> workflowRuleAttributes = new ArrayList<WorkflowRuleAttribute>();
for (ExtensionDefinition extension : extensionDefinitions) {
workflowRuleAttributes.add(materializeRuleAttribute(extension));
}
return workflowRuleAttributes;
}
示例8: 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);
}
示例9: getRoleNames
import org.kuali.rice.kew.rule.WorkflowRuleAttribute; //導入依賴的package包/類
@Override
public List<RoleName> getRoleNames(ExtensionDefinition extensionDefinition) {
WorkflowRuleAttribute attribute = loadAttribute(extensionDefinition);
if (attribute instanceof RoleAttribute) {
RoleAttribute roleAttribute = (RoleAttribute) attribute;
List<RoleName> roleNames = roleAttribute.getRoleNames();
if (CollectionUtils.isNotEmpty(roleNames)) {
return ModelObjectUtils.createImmutableCopy(roleNames);
}
}
return Collections.emptyList();
}
示例10: getRuleAttributeByName
import org.kuali.rice.kew.rule.WorkflowRuleAttribute; //導入依賴的package包/類
private WorkflowRuleAttribute getRuleAttributeByName(String ruleAttributeName) {
return materializeRuleAttribute(KewApiServiceLocator.getExtensionRepositoryService().getExtensionByName(
ruleAttributeName));
}