当前位置: 首页>>代码示例>>Java>>正文


Java WorkflowDocument.getDocumentTypeName方法代码示例

本文整理汇总了Java中org.kuali.rice.kew.api.WorkflowDocument.getDocumentTypeName方法的典型用法代码示例。如果您正苦于以下问题:Java WorkflowDocument.getDocumentTypeName方法的具体用法?Java WorkflowDocument.getDocumentTypeName怎么用?Java WorkflowDocument.getDocumentTypeName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.kew.api.WorkflowDocument的用法示例。


在下文中一共展示了WorkflowDocument.getDocumentTypeName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setNewDocumentHeader

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * Gets a new document header for this documents type and sets in the document instance.
 *
 * @throws WorkflowException
 */
protected void setNewDocumentHeader() throws WorkflowException {
    // collect the header information from the old document
    Person user = GlobalVariables.getUserSession().getPerson();
    WorkflowDocument sourceWorkflowDocument
            = KRADServiceLocatorWeb.getWorkflowDocumentService().loadWorkflowDocument(getDocumentNumber(), user);
    String sourceDocumentTypeName = sourceWorkflowDocument.getDocumentTypeName();

    // initiate the new workflow entry, get the workflow doc
    WorkflowDocument workflowDocument
            = KRADServiceLocatorWeb.getWorkflowDocumentService().createWorkflowDocument(sourceDocumentTypeName, user);
    UserSessionUtils.addWorkflowDocument(GlobalVariables.getUserSession(), workflowDocument);

    // set new values on the document header, including the document number from which it was copied
    Document newDocument = KRADServiceLocatorWeb.getDocumentService().getNewDocument(sourceDocumentTypeName);
    DocumentHeader newDocumentHeader = newDocument.getDocumentHeader();
    newDocumentHeader.setDocumentTemplateNumber(getDocumentNumber());
    newDocumentHeader.setDocumentDescription(getDocumentHeader().getDocumentDescription());
    newDocumentHeader.setOrganizationDocumentNumber(getDocumentHeader().getOrganizationDocumentNumber());

    // set the new document number on this document
    try {
        KRADServiceLocatorWeb.getLegacyDataAdapter().setObjectPropertyDeep(this,
                KRADPropertyConstants.DOCUMENT_NUMBER, documentNumber.getClass(), newDocument.getDocumentNumber());
    } catch (Exception e) {
        LOG.error("Unable to set document number property in copied document " + this, e);
        throw new RuntimeException("Unable to set document number property in copied document " + this, e);
    }

    // replace the current document header with the new document header
    setDocumentHeader(newDocument.getDocumentHeader());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:37,代码来源:DocumentBase.java

示例2: testStringRanges

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test public void testStringRanges() throws Exception {
    WorkflowDocument doc = setUpSearchableDoc();
    String userId = doc.getInitiatorPrincipalId();
    String docType = doc.getDocumentTypeName();

    assertRangeSearchResults(docType, userId, TestXMLSearchableAttributeString.SEARCH_STORAGE_KEY, TestXMLSearchableAttributeString.SEARCH_STORAGE_VALUE, null, false, 1);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:8,代码来源:StandardGenericXMLSearchableAttributeRangesTest.java

示例3: testLongRanges

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test public void testLongRanges() throws Exception {
    WorkflowDocument doc = setUpSearchableDoc();
    String userId = doc.getInitiatorPrincipalId();
    String docType = doc.getDocumentTypeName();

    String searchAttributeLongKey = TestXMLSearchableAttributeLong.SEARCH_STORAGE_KEY;
    Long searchAttributeLongValue = TestXMLSearchableAttributeLong.SEARCH_STORAGE_VALUE.longValue();
    Long longValueToUse = null;

    // test lower bound only
    longValueToUse = searchAttributeLongValue; // lowerbound == value
    assertRangeSearchResults(docType, userId, searchAttributeLongKey, longValueToUse.toString(), null, false, 1);

    longValueToUse = Long.valueOf(searchAttributeLongValue.longValue() - 1); // lowerbound below value
    assertRangeSearchResults(docType, userId, searchAttributeLongKey, longValueToUse.toString(), null, false, 1);

    longValueToUse = Long.valueOf(searchAttributeLongValue.longValue() + 1); // lowerbound is above value
    assertRangeSearchResults(docType, userId, searchAttributeLongKey, longValueToUse.toString(), null, false, 0);

    // test upper bound only
    longValueToUse = searchAttributeLongValue; // upper bound == value
    assertRangeSearchResults(docType, userId, searchAttributeLongKey, null, longValueToUse.toString(), true, 1);

    longValueToUse = Long.valueOf(searchAttributeLongValue.longValue() - 1); // upper bound < value
    assertRangeSearchResults(docType, userId, searchAttributeLongKey, null, longValueToUse.toString(), true, 0);

    longValueToUse = Long.valueOf(searchAttributeLongValue.longValue() + 1); // upper bound > value
    assertRangeSearchResults(docType, userId, searchAttributeLongKey, null, longValueToUse.toString(), true, 1);

    // test both bounds
    // lowerbound == upperbound == value
    assertRangeSearchResults(docType, userId, searchAttributeLongKey,
                             Long.valueOf(searchAttributeLongValue.longValue()).toString(),
                             Long.valueOf(searchAttributeLongValue.longValue()).toString(), true, 1);

    // lower and upper bound > value
    assertRangeSearchResults(docType, userId, searchAttributeLongKey,
                             Long.valueOf(searchAttributeLongValue.longValue() + 2).toString(),
                             Long.valueOf(searchAttributeLongValue.longValue() + 4).toString(), true, 0);

    // lower and upper bound < value, but lower > upper
    assertRangeSearchResults(docType, userId, searchAttributeLongKey,
                             Long.valueOf(searchAttributeLongValue.longValue() - 2).toString(),
                             Long.valueOf(searchAttributeLongValue.longValue() - 4).toString(), true, EXPECT_EXCEPTION);
    // lower and upper bound < value, lower < upper
    assertRangeSearchResults(docType, userId, searchAttributeLongKey,
                             Long.valueOf(searchAttributeLongValue.longValue() - 4).toString(),
                             Long.valueOf(searchAttributeLongValue.longValue() - 2).toString(), true, 0);

    // lower bound < value, upper bound > value
    assertRangeSearchResults(docType, userId, searchAttributeLongKey,
                             Long.valueOf(searchAttributeLongValue.longValue() - 2).toString(),
                             Long.valueOf(searchAttributeLongValue.longValue() + 2).toString(), true, 1);

    // upper < lower
    assertRangeSearchResults(docType, userId, searchAttributeLongKey,
                             Long.valueOf(searchAttributeLongValue.longValue() + 2).toString(),
                             Long.valueOf(searchAttributeLongValue.longValue() - 2).toString(), true, EXPECT_EXCEPTION);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:60,代码来源:StandardGenericXMLSearchableAttributeRangesTest.java

示例4: testFloatRanges

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test public void testFloatRanges() throws Exception {
    WorkflowDocument doc = setUpSearchableDoc();
    String userId = doc.getInitiatorPrincipalId();
    String docType = doc.getDocumentTypeName();

    String searchAttributeFloatKey = TestXMLSearchableAttributeFloat.SEARCH_STORAGE_KEY;
    BigDecimal searchAttributeFloatValue = TestXMLSearchableAttributeFloat.SEARCH_STORAGE_VALUE;

    BigDecimal floatValueToUse = null;
    // test lower bound only
    floatValueToUse = searchAttributeFloatValue; // lower bound == value
    // NOTE: original test asserted 0 results, mysql actually does match the value
    assertRangeSearchResults(docType, userId, searchAttributeFloatKey, floatValueToUse.toString(), null, false, 1);

    floatValueToUse = searchAttributeFloatValue.subtract(BigDecimal.ONE); // lowerbound < value
    assertRangeSearchResults(docType, userId, searchAttributeFloatKey, floatValueToUse.toString(), null, false, 1);

    floatValueToUse = searchAttributeFloatValue.add(BigDecimal.ONE); // lowerbound > value
    assertRangeSearchResults(docType, userId, searchAttributeFloatKey, floatValueToUse.toString(), null, false, 0);

    // test upper bound only
    floatValueToUse = searchAttributeFloatValue; // upperbound == value (does not match float)
    // NOTE: another case where original test had 0 results, but in fact we see a float match
    assertRangeSearchResults(docType, userId, searchAttributeFloatKey, null, floatValueToUse.toString(), true, 1);

    floatValueToUse = searchAttributeFloatValue.subtract(BigDecimal.ONE); // upperbound < value
    assertRangeSearchResults(docType, userId, searchAttributeFloatKey, null, floatValueToUse.toString(), true, 0);

    floatValueToUse = searchAttributeFloatValue.add(BigDecimal.ONE); // upperbound > value
    assertRangeSearchResults(docType, userId, searchAttributeFloatKey, null, floatValueToUse.toString(), true, 1);

    // test both bounds
    // upper == lower == value
    // NOTE: original case had 0 results, now seeing 1 result
    // search generator invokes criteria which calls addNumericRangeCriteria when produces: (EXT1.VAL BETWEEN 123456.3456 AND 123456.3456)
    assertRangeSearchResults(docType, userId, searchAttributeFloatKey, searchAttributeFloatValue.toString(), searchAttributeFloatValue.toString(), true, 1);

    // upper and lower > value
    assertRangeSearchResults(docType, userId, searchAttributeFloatKey,
                             searchAttributeFloatValue.add(new BigDecimal(2)).toString(),
                             searchAttributeFloatValue.add(new BigDecimal(4)).toString(), true, 0);

    // upper and lower < value
    assertRangeSearchResults(docType, userId, searchAttributeFloatKey,
                             searchAttributeFloatValue.subtract(new BigDecimal(4)).toString(),
                             searchAttributeFloatValue.subtract(new BigDecimal(2)).toString(), true, 0);

    // lower < value, upper > value
    assertRangeSearchResults(docType, userId, searchAttributeFloatKey,
                             searchAttributeFloatValue.subtract(new BigDecimal(2)).toString(),
                             searchAttributeFloatValue.add(new BigDecimal(2)).toString(), true, 1);

    // upper < lower
    assertRangeSearchResults(docType, userId, searchAttributeFloatKey,
                             searchAttributeFloatValue.add(new BigDecimal(2)).toString(),
                             searchAttributeFloatValue.subtract(new BigDecimal(2)).toString(), true, EXPECT_EXCEPTION);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:58,代码来源:StandardGenericXMLSearchableAttributeRangesTest.java


注:本文中的org.kuali.rice.kew.api.WorkflowDocument.getDocumentTypeName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。