本文整理汇总了Java中org.kuali.rice.kns.document.MaintenanceDocument.getDocumentNumber方法的典型用法代码示例。如果您正苦于以下问题:Java MaintenanceDocument.getDocumentNumber方法的具体用法?Java MaintenanceDocument.getDocumentNumber怎么用?Java MaintenanceDocument.getDocumentNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kns.document.MaintenanceDocument
的用法示例。
在下文中一共展示了MaintenanceDocument.getDocumentNumber方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getKeyValues
import org.kuali.rice.kns.document.MaintenanceDocument; //导入方法依赖的package包/类
/**
* @see org.kuali.rice.krad.keyvalues.KeyValuesFinder#getKeyValues()
*/
@Override
public List<KeyValue> getKeyValues() {
final List<KeyValue> actionRequestCodes = new ArrayList<KeyValue>();
// Acquire the Kuali form, and return the super class' result if the form is not a Kuali maintenance form.
final KualiForm kForm = KNSGlobalVariables.getKualiForm();
if (!(kForm instanceof KualiMaintenanceForm)) {
return super.getKeyValues();
}
// Acquire the Kuali maintenance form's document and its rule template.
final MaintenanceDocument maintDoc = (MaintenanceDocument) ((KualiMaintenanceForm) kForm).getDocument();
final RuleTemplateBo ruleTemplate = ((RuleBaseValues) maintDoc.getNewMaintainableObject().getBusinessObject()).getRuleTemplate();
// Ensure that the rule template is defined.
if (ruleTemplate == null) {
throw new RuntimeException("Rule template cannot be null for document ID " + maintDoc.getDocumentNumber());
}
// get the options to check for, as well as their related KEW constants.
final RuleTemplateOptionBo[] ruleOpts = {ruleTemplate.getAcknowledge(), ruleTemplate.getComplete(),
ruleTemplate.getApprove(), ruleTemplate.getFyi()};
final String[] ruleConsts = {KewApiConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ, KewApiConstants.ACTION_REQUEST_COMPLETE_REQ,
KewApiConstants.ACTION_REQUEST_APPROVE_REQ, KewApiConstants.ACTION_REQUEST_FYI_REQ};
// Add the rule options to the list if they are not defined (true by default) or if they are explicitly set to true.
for (int i = 0; i < ruleOpts.length; i++) {
if (ruleOpts[i] == null || ruleOpts[i].getValue() == null || "true".equals(ruleOpts[i].getValue())) {
actionRequestCodes.add(new ConcreteKeyValue(ruleConsts[i], KewApiConstants.ACTION_REQUEST_CODES.get(ruleConsts[i])));
}
}
return actionRequestCodes;
}