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


Java RuleAttribute.to方法代碼示例

本文整理匯總了Java中org.kuali.rice.kew.rule.bo.RuleAttribute.to方法的典型用法代碼示例。如果您正苦於以下問題:Java RuleAttribute.to方法的具體用法?Java RuleAttribute.to怎麽用?Java RuleAttribute.to使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.kuali.rice.kew.rule.bo.RuleAttribute的用法示例。


在下文中一共展示了RuleAttribute.to方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getRuleRows

import org.kuali.rice.kew.rule.bo.RuleAttribute; //導入方法依賴的package包/類
@Override
public WorkflowRuleAttributeRows getRuleRows(Map<String, String> parameters, RuleTemplateAttributeBo ruleTemplateAttribute) {
    required(ruleTemplateAttribute, "ruleTemplateAttribute");
    if (parameters == null) {
        parameters = Collections.emptyMap();
    }
    RuleAttribute ruleAttribute = ruleTemplateAttribute.getRuleAttribute();
    ExtensionDefinition extensionDefinition = RuleAttribute.to(ruleAttribute);
    WorkflowRuleAttributeHandlerService handler = getHandler(extensionDefinition);
    WorkflowRuleAttributeFields fields = handler.getRuleFields(parameters, extensionDefinition, ruleTemplateAttribute.isRequired());
    return new WorkflowRuleAttributeRows(fields);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:13,代碼來源:WorkflowRuleAttributeMediatorImpl.java

示例2: getRoutingDataRows

import org.kuali.rice.kew.rule.bo.RuleAttribute; //導入方法依賴的package包/類
@Override
public WorkflowRuleAttributeRows getRoutingDataRows(Map<String, String> parameters, RuleTemplateAttributeBo ruleTemplateAttribute) {
    required(ruleTemplateAttribute, "ruleTemplateAttribute");
    if (parameters == null) {
        parameters = Collections.emptyMap();
    }
    RuleAttribute ruleAttribute = ruleTemplateAttribute.getRuleAttribute();
    ExtensionDefinition extensionDefinition = RuleAttribute.to(ruleAttribute);
    WorkflowRuleAttributeHandlerService handler = getHandler(extensionDefinition);
    WorkflowRuleAttributeFields fields = handler.getRoutingDataFields(parameters, extensionDefinition, ruleTemplateAttribute.isRequired());
    return new WorkflowRuleAttributeRows(fields);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:13,代碼來源:WorkflowRuleAttributeMediatorImpl.java

示例3: getRoleNames

import org.kuali.rice.kew.rule.bo.RuleAttribute; //導入方法依賴的package包/類
@Override
public List<RoleName> getRoleNames(RuleTemplateAttributeBo ruleTemplateAttribute) {
    required(ruleTemplateAttribute, "ruleTemplateAttribute");
    RuleAttribute ruleAttribute = ruleTemplateAttribute.getRuleAttribute();
    ExtensionDefinition extensionDefinition = RuleAttribute.to(ruleAttribute);
    WorkflowRuleAttributeHandlerService handler = getHandler(extensionDefinition);
    return handler.getRoleNames(extensionDefinition);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:9,代碼來源:WorkflowRuleAttributeMediatorImpl.java

示例4: convertWorkflowAttributeDefinition

import org.kuali.rice.kew.rule.bo.RuleAttribute; //導入方法依賴的package包/類
/**
 * New for Rice 2.0
 */
public static AttributeDefinition convertWorkflowAttributeDefinition(WorkflowAttributeDefinition definition) {
    if (definition == null) {
        return null;
    }
    //KULRICE-7643
    ExtensionDefinition extensionDefinition = null;
    List<RuleAttribute> ruleAttribute = KEWServiceLocator.getRuleAttributeService().findByClassName(definition.getAttributeName());
    if (ruleAttribute == null || ruleAttribute.isEmpty()) {
        extensionDefinition = KewApiServiceLocator.getExtensionRepositoryService().getExtensionByName(definition.getAttributeName());
    }else{
        //TODO: Should we do something more intelligent here? Rice 1.x returned only a single entry but we can now have a list
        RuleAttribute tmpAttr = ruleAttribute.get(0);
        extensionDefinition = RuleAttribute.to(tmpAttr);
        if(ruleAttribute.size() > 1){
            LOG.warn("AttributeDefinition lookup (findByClassName) returned multiple attribute for the same class name. This should not happen, investigation recommended for classname: " 
        + definition.getAttributeName() + " which has " + ruleAttribute.size() + " entries.");
        }
    }
    
    if (extensionDefinition == null) {
        throw new WorkflowRuntimeException("Extension " + definition.getAttributeName() + " not found");
    }
    /*RuleAttribute ruleAttribute = KEWServiceLocator.getRuleAttributeService().findByName(definition.getAttributeName());
    if (ruleAttribute == null) {
        throw new WorkflowRuntimeException("Attribute " + definition.getAttributeName() + " not found");
    }*/

    ObjectDefinition objectDefinition = new ObjectDefinition(extensionDefinition.getResourceDescriptor());
    if (definition.getParameters() != null) {
        for (String parameter : definition.getParameters()) {
            objectDefinition.addConstructorParameter(new DataDefinition(parameter, String.class));
        }
    }
    boolean propertiesAsMap = KewApiConstants.RULE_XML_ATTRIBUTE_TYPE.equals(extensionDefinition.getType()) || KewApiConstants
            .SEARCHABLE_XML_ATTRIBUTE_TYPE.equals(extensionDefinition.getType());
    if (!propertiesAsMap && definition.getPropertyDefinitions() != null) {
        for (org.kuali.rice.kew.api.document.PropertyDefinition propertyDefinition : definition
                .getPropertyDefinitions()) {
            objectDefinition.addProperty(new PropertyDefinition(propertyDefinition.getName(), new DataDefinition(
                    propertyDefinition.getValue(), String.class)));
        }
    }

    return new AttributeDefinition(extensionDefinition, objectDefinition);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:49,代碼來源:DTOConverter.java

示例5: translateFromRuleAttribute

import org.kuali.rice.kew.rule.bo.RuleAttribute; //導入方法依賴的package包/類
private ExtensionDefinition translateFromRuleAttribute(RuleAttribute ruleAttribute) {
    return RuleAttribute.to(ruleAttribute);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:4,代碼來源:ExtensionRepositoryServiceImpl.java


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