本文整理匯總了Java中org.kuali.rice.kew.rule.bo.RuleAttribute.setDescription方法的典型用法代碼示例。如果您正苦於以下問題:Java RuleAttribute.setDescription方法的具體用法?Java RuleAttribute.setDescription怎麽用?Java RuleAttribute.setDescription使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.kuali.rice.kew.rule.bo.RuleAttribute
的用法示例。
在下文中一共展示了RuleAttribute.setDescription方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setupRuleAttribute
import org.kuali.rice.kew.rule.bo.RuleAttribute; //導入方法依賴的package包/類
private RuleAttribute setupRuleAttribute() {
RuleAttribute ruleAttribute = new RuleAttribute();
ruleAttribute.setApplicationId("TST");
ruleAttribute.setDescription("Testing");
ruleAttribute.setLabel("New Label");
ruleAttribute.setResourceDescriptor("ResourceDescriptor");
ruleAttribute.setType("newType");
ruleAttribute.setName("Attr");
return getDataObjectService().save(ruleAttribute, PersistenceOption.FLUSH);
}
示例2: setupRuleAttribute
import org.kuali.rice.kew.rule.bo.RuleAttribute; //導入方法依賴的package包/類
private RuleAttribute setupRuleAttribute(){
RuleAttribute ruleAttribute = new RuleAttribute();
ruleAttribute.setApplicationId("TST");
ruleAttribute.setDescription("Testing");
ruleAttribute.setLabel("New Label");
ruleAttribute.setResourceDescriptor("ResourceDescriptor");
ruleAttribute.setType("newType");
ruleAttribute.setName("Attr");
return KRADServiceLocator.getDataObjectService().save(ruleAttribute, PersistenceOption.FLUSH);
}
示例3: setupRuleAttributeSimilar
import org.kuali.rice.kew.rule.bo.RuleAttribute; //導入方法依賴的package包/類
private RuleAttribute setupRuleAttributeSimilar(){
RuleAttribute ruleAttribute = new RuleAttribute();
ruleAttribute.setApplicationId("TST2");
ruleAttribute.setDescription("Testingfdsa");
ruleAttribute.setLabel("New Labefdsal");
ruleAttribute.setResourceDescriptor("ResourceDescriptor");
ruleAttribute.setType("newType");
ruleAttribute.setName("Attr2");
return KRADServiceLocator.getDataObjectService().save(ruleAttribute, PersistenceOption.FLUSH);
}
示例4: parseRuleAttribute
import org.kuali.rice.kew.rule.bo.RuleAttribute; //導入方法依賴的package包/類
private RuleAttribute parseRuleAttribute(Node ruleAttributeNode) throws XmlException {
String name = "";
String className = "";
String label = "";
String description = "";
String type = "";
String applicationId = null;
Node xmlConfig = null;
for (int i = 0; i < ruleAttributeNode.getChildNodes().getLength(); i++) {
Node childNode = ruleAttributeNode.getChildNodes().item(i);
if(NAME.equals(childNode.getNodeName())){
name = childNode.getFirstChild().getNodeValue();
} else if(CLASS_NAME.equals(childNode.getNodeName())){
className = childNode.getFirstChild().getNodeValue();
} else if(LABEL.equals(childNode.getNodeName())){
label = childNode.getFirstChild().getNodeValue();
} else if(DESCRIPTION.equals(childNode.getNodeName())){
description = childNode.getFirstChild().getNodeValue();
} else if(TYPE.equals(childNode.getNodeName())){
type = childNode.getFirstChild().getNodeValue();
} else if(XmlConstants.ROUTING_CONFIG.equals(childNode.getNodeName()) || XmlConstants.SEARCHING_CONFIG.equals(childNode.getNodeName()) ||
XmlConstants.SEARCH_RESULT_CONFIG.equals(childNode.getNodeName()) || XmlConstants.RESOLVER_CONFIG.equals(childNode.getNodeName()) ||
CONFIG.equals(childNode.getNodeName())){
xmlConfig = childNode;
} else if (XmlConstants.SERVICE_NAMESPACE.equals(childNode.getNodeName())) {
applicationId = childNode.getFirstChild().getNodeValue();
LOG.warn(XmlConstants.SERVICE_NAMESPACE + " element was set on rule attribute type XML but is deprecated and will be removed in a future version, please use " + APPLICATION_ID + " instead.");
} else if (XmlConstants.APPLICATION_ID.equals(childNode.getNodeName())) {
applicationId = childNode.getFirstChild().getNodeValue();
}
}
if (org.apache.commons.lang.StringUtils.isEmpty(name)) {
throw new XmlException("RuleAttribute must have a name");
}
if (org.apache.commons.lang.StringUtils.isEmpty(className)) {
throw new XmlException("RuleAttribute must have a className");
}
if (org.apache.commons.lang.StringUtils.isEmpty(label)) {
LOG.warn("Label empty defaulting to name");
label = name;
}
if (org.apache.commons.lang.StringUtils.isEmpty(type)) {
LOG.debug("No type specified, default to " + KewApiConstants.RULE_ATTRIBUTE_TYPE);
type = KewApiConstants.RULE_ATTRIBUTE_TYPE;
//throw new XmlException("RuleAttribute must have an attribute type");
}
type = type.trim();
validateRuleAttributeType(type);
RuleAttribute ruleAttribute = new RuleAttribute();
ruleAttribute.setName(name.trim());
ruleAttribute.setResourceDescriptor(className.trim());
ruleAttribute.setType(type.trim());
ruleAttribute.setLabel(label.trim());
// default description to label
if (StringUtils.isEmpty(description)) {
description = label;
}
ruleAttribute.setDescription(description.trim());
if (applicationId != null)
{
applicationId = applicationId.trim();
}
ruleAttribute.setApplicationId(applicationId);
if(xmlConfig != null){
ruleAttribute.setXmlConfigData(XmlJotter.jotNode(xmlConfig));
} else {
if(KewApiConstants.RULE_XML_ATTRIBUTE_TYPE.equals(type)){
throw new XmlException("A routing config must be present to be of type: "+type);
} else if(KewApiConstants.SEARCHABLE_XML_ATTRIBUTE_TYPE.equals(type)){
throw new XmlException("A searching config must be present to be of type: "+type);
}
}
return ruleAttribute;
}