本文整理汇总了Java中org.kuali.rice.kew.api.KewApiServiceLocator.getWorkflowDocumentService方法的典型用法代码示例。如果您正苦于以下问题:Java KewApiServiceLocator.getWorkflowDocumentService方法的具体用法?Java KewApiServiceLocator.getWorkflowDocumentService怎么用?Java KewApiServiceLocator.getWorkflowDocumentService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kew.api.KewApiServiceLocator
的用法示例。
在下文中一共展示了KewApiServiceLocator.getWorkflowDocumentService方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetSearchableAttributeDateTimeValuesByKey
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
@Test public void testGetSearchableAttributeDateTimeValuesByKey() throws Exception {
String documentTypeName = SeqSetup.DOCUMENT_TYPE_NAME;
String userNetworkId = "ewestfal";
WorkflowDocument workflowDocument = WorkflowDocumentFactory.createDocument(getPrincipalIdForName(userNetworkId), documentTypeName);
workflowDocument.setTitle("Respect my Authoritah");
workflowDocument.route("routing this document.");
userNetworkId = "rkirkend";
WorkflowDocument workflowDocument2 = WorkflowDocumentFactory.createDocument(getPrincipalIdForName(userNetworkId), documentTypeName);
workflowDocument2.setTitle("Routing Style");
workflowDocument2.route("routing this document.");
WorkflowDocumentService wds = KewApiServiceLocator.getWorkflowDocumentService();
List<DateTime> dateTimes = wds.getSearchableAttributeDateTimeValuesByKey(workflowDocument.getDocumentId(), TestXMLSearchableAttributeDateTime.SEARCH_STORAGE_KEY);
assertNotNull("dateTimes should not be null", dateTimes);
assertTrue("dateTimes should not be empty", !dateTimes.isEmpty());
verifyTimestampToSecond(TestXMLSearchableAttributeDateTime.SEARCH_STORAGE_VALUE_IN_MILLS, dateTimes.get(0).getMillis());
dateTimes = wds.getSearchableAttributeDateTimeValuesByKey(workflowDocument2.getDocumentId(), TestXMLSearchableAttributeDateTime.SEARCH_STORAGE_KEY);
assertNotNull("dateTimes should not be null", dateTimes);
assertTrue("dateTimes should not be empty", !dateTimes.isEmpty());
verifyTimestampToSecond(TestXMLSearchableAttributeDateTime.SEARCH_STORAGE_VALUE_IN_MILLS, dateTimes.get(0).getMillis());
}
示例2: getAdHocRouteNodeName
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
protected String getAdHocRouteNodeName(String documentId) throws WorkflowException {
WorkflowDocumentService workflowDocumentService = KewApiServiceLocator.getWorkflowDocumentService();
List<RouteNodeInstance> nodeInstances = workflowDocumentService.getActiveRouteNodeInstances(documentId);
if (nodeInstances == null || nodeInstances.isEmpty()) {
nodeInstances = workflowDocumentService.getTerminalRouteNodeInstances(documentId);
}
if (nodeInstances == null || nodeInstances.isEmpty()) {
throw new WorkflowException("Could not locate a node on the document to send the ad hoc request to.");
}
return nodeInstances.get(0).getName();
}
示例3: testMoveDocumentInsideProcess
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
/**
* This tests that we can invoke the move document command inside of a sub process.
*/
@Test public void testMoveDocumentInsideProcess() throws Exception {
WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("user1"), "MoveInProcessTest");
document.route("");
// approve as bmcgough and rkirkend to move into process
document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("bmcgough"), document.getDocumentId());
assertTrue("bmcgough should have approve", document.isApprovalRequested());
document.approve("");
document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("rkirkend"), document.getDocumentId());
assertTrue("rkirkend should have approve", document.isApprovalRequested());
document.approve("");
WorkflowDocumentService workflowDocumentService = KewApiServiceLocator.getWorkflowDocumentService();
List<RouteNodeInstance> activeNodeInstances = workflowDocumentService.getActiveRouteNodeInstances(document.getDocumentId());
assertEquals("Should be 1 active node instance.", 1, activeNodeInstances.size());
RouteNodeInstance node2 = activeNodeInstances.get(0);
assertEquals("Should be at the WorkflowDocument2 node.", SeqSetup.WORKFLOW_DOCUMENT_2_NODE, node2.getName());
assertTrue("Node should be in a process.", node2.getProcessId() != null);
// now try to move the document forward one which will keep us inside the subprocess
document.move(MovePoint.create(SeqSetup.WORKFLOW_DOCUMENT_2_NODE, 1), "");
activeNodeInstances = workflowDocumentService.getActiveRouteNodeInstances(document.getDocumentId());
RouteNodeInstance node3 = activeNodeInstances.get(0);
assertEquals("Should be at the WorkflowDocument3 node.", SeqSetup.WORKFLOW_DOCUMENT_3_NODE, node3.getName());
assertTrue("Node should be in a process.", node3.getProcessId() != null);
assertEquals("Node 2 and 3 should be in the same process.", node2.getProcessId(), node3.getProcessId());
document.move(MovePoint.create(SeqSetup.WORKFLOW_DOCUMENT_3_NODE, 0), "");
document.move(MovePoint.create(SeqSetup.WORKFLOW_DOCUMENT_3_NODE, -1), "");
}
示例4: hasDerivedRole
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
@Override
public boolean hasDerivedRole(
String principalId, List<String> groupIds, String namespaceCode, String roleName, Map<String, String> qualification){
if (StringUtils.isBlank(principalId)) {
throw new RiceIllegalArgumentException("principalId was null or blank");
}
if (groupIds == null) {
throw new RiceIllegalArgumentException("groupIds was null or blank");
}
if (StringUtils.isBlank(namespaceCode)) {
throw new RiceIllegalArgumentException("namespaceCode was null or blank");
}
if (StringUtils.isBlank(roleName)) {
throw new RiceIllegalArgumentException("roleName was null or blank");
}
if (qualification == null) {
throw new RiceIllegalArgumentException("qualification was null");
}
validateRequiredAttributesAgainstReceived(qualification);
boolean isUserInRouteLog = false;
if(qualification!=null && !qualification.isEmpty()){
String documentId = qualification.get(KimConstants.AttributeConstants.DOCUMENT_NUMBER);
WorkflowDocumentService workflowDocumentService = KewApiServiceLocator.getWorkflowDocumentService();
try {
if (INITIATOR_ROLE_NAME.equals(roleName)){
isUserInRouteLog = principalId.equals(workflowDocumentService.getDocumentInitiatorPrincipalId(documentId));
} else if(INITIATOR_OR_REVIEWER_ROLE_NAME.equals(roleName)){
isUserInRouteLog = KewApiServiceLocator.getWorkflowDocumentActionsService().isUserInRouteLog(
documentId, principalId, true);
} else if(ROUTER_ROLE_NAME.equals(roleName)){
isUserInRouteLog = principalId.equals(workflowDocumentService.getRoutedByPrincipalIdByDocumentId(
documentId));
}
} catch (Exception wex) {
throw new RuntimeException("Error in determining whether the principal Id: " + principalId + " is in route log " +
"for document id: " + documentId + " :"+wex.getLocalizedMessage(),wex);
}
}
return isUserInRouteLog;
}
示例5: getWorkflowDocumentService
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
public WorkflowDocumentService getWorkflowDocumentService() {
if (workflowDocumentService == null) {
workflowDocumentService = KewApiServiceLocator.getWorkflowDocumentService();
}
return workflowDocumentService;
}
示例6: getWorkflowDocumentService
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
protected WorkflowDocumentService getWorkflowDocumentService() {
return KewApiServiceLocator.getWorkflowDocumentService();
}
示例7: setUpAfterDataLoad
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
@Override
protected void setUpAfterDataLoad() throws Exception {
super.setUpAfterDataLoad();
this.service = KewApiServiceLocator.getWorkflowDocumentService();
}
示例8: setUpService
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入方法依赖的package包/类
@Before
public void setUpService() {
this.workflowDocumentService = KewApiServiceLocator.getWorkflowDocumentService();
}