本文整理汇总了Java中org.kuali.rice.kew.rule.bo.RuleAttribute类的典型用法代码示例。如果您正苦于以下问题:Java RuleAttribute类的具体用法?Java RuleAttribute怎么用?Java RuleAttribute使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RuleAttribute类属于org.kuali.rice.kew.rule.bo包,在下文中一共展示了RuleAttribute类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDocumentTypeAttributes
import org.kuali.rice.kew.rule.bo.RuleAttribute; //导入依赖的package包/类
public List<DocumentTypeAttributeBo> getDocumentTypeAttributes(String... attributeTypes) {
List<DocumentTypeAttributeBo> filteredAttributes = new ArrayList<DocumentTypeAttributeBo>();
if (CollectionUtils.isNotEmpty(documentTypeAttributes)) {
if (attributeTypes == null) {
filteredAttributes.addAll(documentTypeAttributes);
} else {
List<String> attributeTypeList = Arrays.asList(attributeTypes);
for (DocumentTypeAttributeBo documentTypeAttribute : documentTypeAttributes) {
RuleAttribute ruleAttribute = documentTypeAttribute.getRuleAttribute();
if (attributeTypeList.contains(ruleAttribute.getType())) {
filteredAttributes.add(documentTypeAttribute);
}
}
}
}
if (filteredAttributes.isEmpty() && getParentDocType() != null) {
return getParentDocType().getDocumentTypeAttributes(attributeTypes);
}
return Collections.unmodifiableList(filteredAttributes);
}
示例2: getCustomActionListAttribute
import org.kuali.rice.kew.rule.bo.RuleAttribute; //导入依赖的package包/类
public CustomActionListAttribute getCustomActionListAttribute() throws ResourceUnavailableException {
CustomActionListAttribute result = null;
RuleAttribute customActionListRuleAttribute = getCustomActionListRuleAttribute();
if (customActionListRuleAttribute != null) {
try {
ExtensionDefinition extensionDefinition =
KewApiServiceLocator.getExtensionRepositoryService().getExtensionById(customActionListRuleAttribute.getId());
if (extensionDefinition != null) {
result = ExtensionUtils.loadExtension(extensionDefinition, customActionListRuleAttribute.getApplicationId());
} else {
LOG.warn("Could not load ExtensionDefinition for " + customActionListRuleAttribute);
}
} catch (RiceRemoteServiceConnectionException e) {
LOG.warn("Unable to connect to load custom action list attribute for " + customActionListRuleAttribute, e);
}
}
return result;
}
示例3: isMatch
import org.kuali.rice.kew.rule.bo.RuleAttribute; //导入依赖的package包/类
public boolean isMatch(DocumentContent docContent) {
for (RuleTemplateAttributeBo ruleTemplateAttribute : getRuleTemplate().getActiveRuleTemplateAttributes()) {
if (!ruleTemplateAttribute.isWorkflowAttribute()) {
continue;
}
WorkflowRuleAttribute routingAttribute = ruleTemplateAttribute.getWorkflowAttribute();
RuleAttribute ruleAttribute = ruleTemplateAttribute.getRuleAttribute();
if (ruleAttribute.getType().equals(KewApiConstants.RULE_XML_ATTRIBUTE_TYPE)) {
((GenericXMLRuleAttribute) routingAttribute).setExtensionDefinition(RuleAttribute.to(ruleAttribute));
}
String className = ruleAttribute.getResourceDescriptor();
List<RuleExtension> editedRuleExtensions = new ArrayList<RuleExtension>();
for (RuleExtensionBo extension : getRuleExtensions()) {
if (extension.getRuleTemplateAttribute().getRuleAttribute().getResourceDescriptor().equals(className)) {
editedRuleExtensions.add(RuleExtensionBo.to(extension));
}
}
if (!routingAttribute.isMatch(docContent, editedRuleExtensions)) {
return false;
}
}
return true;
}
示例4: findByRuleAttribute
import org.kuali.rice.kew.rule.bo.RuleAttribute; //导入依赖的package包/类
public List<RuleAttribute> findByRuleAttribute(RuleAttribute ruleAttribute) {
QueryByCriteria.Builder builder =
QueryByCriteria.Builder.create();
List<Predicate> predicates = new ArrayList<Predicate>();
if (ruleAttribute.getName() != null) {
predicates.add(likeIgnoreCase("name",ruleAttribute.getName()));
}
if (ruleAttribute.getResourceDescriptor() != null) {
predicates.add(likeIgnoreCase("resourceDescriptor",ruleAttribute.getResourceDescriptor()));
}
if (ruleAttribute.getType() != null) {
predicates.add(likeIgnoreCase("type",ruleAttribute.getType()));
}
Predicate[] preds = predicates.toArray(new Predicate[predicates.size()]);
builder.setPredicates(preds);
QueryResults<RuleAttribute> results = getDataObjectService().findMatching(RuleAttribute.class, builder.build());
return results.getResults();
}
示例5: exportRuleAttribute
import org.kuali.rice.kew.rule.bo.RuleAttribute; //导入依赖的package包/类
private void exportRuleAttribute(Element parent, RuleAttribute ruleAttribute) {
Element attributeElement = renderer.renderElement(parent, RULE_ATTRIBUTE);
renderer.renderTextElement(attributeElement, NAME, ruleAttribute.getName());
renderer.renderTextElement(attributeElement, CLASS_NAME, ruleAttribute.getResourceDescriptor());
renderer.renderTextElement(attributeElement, LABEL, ruleAttribute.getLabel());
renderer.renderTextElement(attributeElement, DESCRIPTION, ruleAttribute.getDescription());
renderer.renderTextElement(attributeElement, TYPE, ruleAttribute.getType());
renderer.renderTextElement(attributeElement, APPLICATION_ID, ruleAttribute.getApplicationId());
if (!org.apache.commons.lang.StringUtils.isEmpty(ruleAttribute.getXmlConfigData())) {
try {
Document configDoc = new SAXBuilder().build(new StringReader(ruleAttribute.getXmlConfigData()));
XmlHelper.propagateNamespace(configDoc.getRootElement(), RULE_ATTRIBUTE_NAMESPACE);
attributeElement.addContent(configDoc.getRootElement().detach());
} catch (Exception e) {
LOG.error("Error parsing attribute XML configuration.", e);
throw new WorkflowRuntimeException("Error parsing attribute XML configuration.");
}
}
}
示例6: getExtensionsByResourceDescriptor
import org.kuali.rice.kew.rule.bo.RuleAttribute; //导入依赖的package包/类
@Override
public List<ExtensionDefinition> getExtensionsByResourceDescriptor(
String resourceDescriptor) throws RiceIllegalArgumentException {
if (StringUtils.isBlank(resourceDescriptor)) {
throw new RiceIllegalArgumentException("resourceDescriptor was null or blank");
}
List<RuleAttribute> ruleAttributes = ruleAttributeService.findByClassName(resourceDescriptor);
if (CollectionUtils.isNotEmpty(ruleAttributes)) {
List<ExtensionDefinition> definitions = new ArrayList<ExtensionDefinition>();
for (RuleAttribute ruleAttribute : ruleAttributes) {
definitions.add(translateFromRuleAttribute(ruleAttribute));
}
return Collections.unmodifiableList(definitions);
}
return Collections.emptyList();
}
示例7: buildExportDataSet
import org.kuali.rice.kew.rule.bo.RuleAttribute; //导入依赖的package包/类
/**
* Builds the ExportDataSet based on the BusinessObjects passed in.
*/
protected ExportDataSet buildExportDataSet(Class<?> dataObjectClass, List<? extends Object> dataObjects) {
KewExportDataSet dataSet = new KewExportDataSet();
for (Object dataObject : dataObjects) {
if (dataObjectClass.equals(RuleAttribute.class)) {
dataSet.getRuleAttributes().add((RuleAttribute)dataObject);
} else if (dataObjectClass.equals(RuleTemplateBo.class)) {
dataSet.getRuleTemplates().add((RuleTemplateBo)dataObject);
} else if (dataObjectClass.equals(DocumentType.class)) {
dataSet.getDocumentTypes().add((DocumentType)dataObject);
} else if (dataObjectClass.equals(RuleBaseValues.class)) {
dataSet.getRules().add((RuleBaseValues)dataObject);
} else if (dataObjectClass.equals(RuleDelegationBo.class)) {
dataSet.getRuleDelegations().add((RuleDelegationBo)dataObject);
} else if (dataObjectClass.equals(GroupBo.class)) {
Group group = GroupBo.to((GroupBo)dataObject);
dataSet.getGroups().add(group);
}
}
ExportDataSet exportDataSet = new ExportDataSet();
dataSet.populateExportDataSet(exportDataSet);
return exportDataSet;
}
示例8: assertExport
import org.kuali.rice.kew.rule.bo.RuleAttribute; //导入依赖的package包/类
protected void assertExport() throws Exception {
// export all existing rule attributes
List oldRuleAttributes = KEWServiceLocator.getRuleAttributeService().findAll();
KewExportDataSet dataSet = new KewExportDataSet();
dataSet.getRuleAttributes().addAll(oldRuleAttributes);
byte[] xmlBytes = CoreApiServiceLocator.getXmlExporterService().export(dataSet.createExportDataSet());
assertTrue("XML should be non empty.", xmlBytes != null && xmlBytes.length > 0);
// import the exported xml
loadXmlStream(new BufferedInputStream(new ByteArrayInputStream(xmlBytes)));
List newRuleAttributes = KEWServiceLocator.getRuleAttributeService().findAll();
assertEquals("Should have same number of old and new RuleAttributes.", oldRuleAttributes.size(), newRuleAttributes.size());
for (Iterator iterator = oldRuleAttributes.iterator(); iterator.hasNext();) {
RuleAttribute oldRuleAttribute = (RuleAttribute) iterator.next();
boolean foundAttribute = false;
for (Iterator iterator2 = newRuleAttributes.iterator(); iterator2.hasNext();) {
RuleAttribute newRuleAttribute = (RuleAttribute) iterator2.next();
if (oldRuleAttribute.getName().equals(newRuleAttribute.getName())) {
assertRuleAttributeExport(oldRuleAttribute, newRuleAttribute);
foundAttribute = true;
}
}
assertTrue("Could not locate the new rule attribute for name " + oldRuleAttribute.getName(), foundAttribute);
}
}
示例9: isMatch
import org.kuali.rice.kew.rule.bo.RuleAttribute; //导入依赖的package包/类
public boolean isMatch(DocumentContent docContent) {
for (RuleTemplateAttributeBo ruleTemplateAttribute : getRuleTemplate().getActiveRuleTemplateAttributes()) {
if (!ruleTemplateAttribute.isWorkflowAttribute()) {
continue;
}
WorkflowRuleAttribute routingAttribute = (WorkflowRuleAttribute) ruleTemplateAttribute.getWorkflowAttribute();
RuleAttribute ruleAttribute = ruleTemplateAttribute.getRuleAttribute();
if (ruleAttribute.getType().equals(KewApiConstants.RULE_XML_ATTRIBUTE_TYPE)) {
((GenericXMLRuleAttribute) routingAttribute).setExtensionDefinition(RuleAttribute.to(ruleAttribute));
}
String className = ruleAttribute.getResourceDescriptor();
List<RuleExtension> editedRuleExtensions = new ArrayList<RuleExtension>();
for (RuleExtensionBo extension : getRuleExtensions()) {
if (extension.getRuleTemplateAttribute().getRuleAttribute().getResourceDescriptor().equals(className)) {
editedRuleExtensions.add(RuleExtensionBo.to(extension));
}
}
if (!routingAttribute.isMatch(docContent, editedRuleExtensions)) {
return false;
}
}
return true;
}
示例10: findByRuleAttribute
import org.kuali.rice.kew.rule.bo.RuleAttribute; //导入依赖的package包/类
public List<RuleAttribute> findByRuleAttribute(RuleAttribute ruleAttribute) {
Criteria crit = new Criteria("RuleAttribute", "ra");
if (ruleAttribute.getName() != null) {
crit.rawJpql("UPPER(RULE_ATTRIB_NM) like '" + ruleAttribute.getName().toUpperCase() + "'");
}
if (ruleAttribute.getResourceDescriptor() != null) {
crit.rawJpql("UPPER(RULE_ATTRIB_CLS_NM) like '" + ruleAttribute.getResourceDescriptor().toUpperCase() + "'");
}
if (ruleAttribute.getType() != null) {
crit.rawJpql("UPPER(RULE_ATTRIB_TYP) like '" + ruleAttribute.getType().toUpperCase() + "'");
}
return new QueryByCriteria(entityManager, crit).toQuery().getResultList();
}
示例11: setRuleAttributeId
import org.kuali.rice.kew.rule.bo.RuleAttribute; //导入依赖的package包/类
/**
* @param ruleAttributeId The ruleAttributeId to set.
*/
public void setRuleAttributeId(String ruleAttributeId) {
this.ruleAttributeId = ruleAttributeId;
if (ruleAttributeId == null) {
ruleAttribute = null;
} else {
ruleAttribute = RuleAttribute.from(KewApiServiceLocator.getExtensionRepositoryService().getExtensionById(ruleAttributeId));
//ruleAttribute = getRuleAttributeService().findByRuleAttributeId(ruleAttributeId);
}
}
示例12: from
import org.kuali.rice.kew.rule.bo.RuleAttribute; //导入依赖的package包/类
public static DocumentTypeAttributeBo from(DocumentTypeAttribute dta) {
// DocumentType BO and DTO are not symmetric
// set what fields we can
DocumentTypeAttributeBo bo = new DocumentTypeAttributeBo();
bo.setDocumentTypeId(dta.getDocumentTypeId());
if (dta.getRuleAttribute() != null) {
bo.setRuleAttributeId(dta.getRuleAttribute().getId());
bo.setRuleAttribute(RuleAttribute.from(dta.getRuleAttribute()));
}
bo.setId(dta.getId());
bo.setOrderIndex(dta.getOrderIndex());
return bo;
}
示例13: getCustomActionListRuleAttribute
import org.kuali.rice.kew.rule.bo.RuleAttribute; //导入依赖的package包/类
/**
* Returns the RuleAttribute for the action list attribute for this DocumentType. Walks the document type hierarchy
* if none exists directly on this DocumentType.
* @return The RuleAttribute. May be null.
*/
public RuleAttribute getCustomActionListRuleAttribute() {
List<DocumentTypeAttributeBo> documentTypeAttributes = getDocumentTypeAttributes(KewApiConstants.ACTION_LIST_ATTRIBUTE_TYPE);
if (documentTypeAttributes.size() > 1) {
throw new IllegalStateException("Encountered more than one ActionListAttribute on this document type: " + getName());
}
if (documentTypeAttributes.isEmpty()) {
return null;
}
return documentTypeAttributes.get(0).getRuleAttribute();
}
示例14: loadSearchableAttributes
import org.kuali.rice.kew.rule.bo.RuleAttribute; //导入依赖的package包/类
public List<ExtensionHolder<SearchableAttribute>> loadSearchableAttributes() {
List<DocumentTypeAttributeBo> searchableAttributes = getSearchableAttributes();
List<ExtensionHolder<SearchableAttribute>> loadedAttributes = new ArrayList<ExtensionHolder<SearchableAttribute>>();
for (DocumentTypeAttributeBo documentTypeAttribute : searchableAttributes) {
RuleAttribute ruleAttribute = documentTypeAttribute.getRuleAttribute();
try {
ExtensionDefinition extensionDefinition = KewApiServiceLocator.getExtensionRepositoryService().getExtensionById(ruleAttribute.getId());
SearchableAttribute attributeService = ExtensionUtils.loadExtension(extensionDefinition, getApplicationId());
loadedAttributes.add(new ExtensionHolder<SearchableAttribute>(extensionDefinition, attributeService));
} catch (RiceRemoteServiceConnectionException e) {
LOG.warn("Unable to connect to load searchable attribute for " + ruleAttribute, e);
}
}
return loadedAttributes;
}
示例15: getAttributeObjectDefinition
import org.kuali.rice.kew.rule.bo.RuleAttribute; //导入依赖的package包/类
public ObjectDefinition getAttributeObjectDefinition(String typeCode) {
for (Iterator iter = getDocumentTypeAttributes().iterator(); iter.hasNext();) {
RuleAttribute attribute = ((DocumentTypeAttributeBo) iter.next()).getRuleAttribute();
if (attribute.getType().equals(typeCode)) {
return getAttributeObjectDefinition(attribute);
}
}
if (getParentDocType() != null) {
return getParentDocType().getAttributeObjectDefinition(typeCode);
}
return null;
}