當前位置: 首頁>>代碼示例>>Java>>正文


Java RuleAttribute類代碼示例

本文整理匯總了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);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:21,代碼來源:DocumentType.java

示例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;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:23,代碼來源:DocumentType.java

示例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;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:25,代碼來源:RuleBaseValues.java

示例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();

}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:22,代碼來源:RuleAttributeDAOJpa.java

示例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.");
        }
    }
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:20,代碼來源:RuleAttributeXmlExporter.java

示例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();
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:18,代碼來源:ExtensionRepositoryServiceImpl.java

示例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;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:27,代碼來源:DataExporter.java

示例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);
    }
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:27,代碼來源:RuleAttributeXmlExporterTest.java

示例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;
}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:25,代碼來源:RuleBaseValues.java

示例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();

}
 
開發者ID:aapotts,項目名稱:kuali_rice,代碼行數:17,代碼來源:RuleAttributeDAOJpaImpl.java

示例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);
       }
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:13,代碼來源:DocumentTypeAttributeBo.java

示例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;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:15,代碼來源:DocumentTypeAttributeBo.java

示例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();
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:16,代碼來源:DocumentType.java

示例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;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:16,代碼來源:DocumentType.java

示例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;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:13,代碼來源:DocumentType.java


注:本文中的org.kuali.rice.kew.rule.bo.RuleAttribute類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。