本文整理汇总了Java中org.kuali.rice.kew.api.KewApiServiceLocator类的典型用法代码示例。如果您正苦于以下问题:Java KewApiServiceLocator类的具体用法?Java KewApiServiceLocator怎么用?Java KewApiServiceLocator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KewApiServiceLocator类属于org.kuali.rice.kew.api包,在下文中一共展示了KewApiServiceLocator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getWorkflowDocumentActionsService
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
/**
* Helper method to get the correct {@link WorkflowDocumentActionsService} from the {@code applicationId} of the
* document type.
*
* @param documentTypeId the document type to get the application id from
*
* @return the correct {@link WorkflowDocumentActionsService} from the {@code applicationId} of the document type
*/
protected WorkflowDocumentActionsService getWorkflowDocumentActionsService(String documentTypeId) {
DocumentType documentType = KewApiServiceLocator.getDocumentTypeService().getDocumentTypeById(documentTypeId);
String applicationId = documentType.getApplicationId();
QName serviceName = new QName(KewApiConstants.Namespaces.KEW_NAMESPACE_2_0,
KewApiConstants.ServiceNames.WORKFLOW_DOCUMENT_ACTIONS_SERVICE_SOAP);
WorkflowDocumentActionsService service = (WorkflowDocumentActionsService) KsbApiServiceLocator.getServiceBus()
.getService(serviceName, applicationId);
if (service == null) {
service = KewApiServiceLocator.getWorkflowDocumentActionsService();
}
return service;
}
示例3: getDocumentTitle
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
/**
* Retrieves the title of the document
*
* <p>
* This is the default document title implementation. It concatenates the document's data dictionary file label
* attribute and
* the document's document header description together. This title is used to populate workflow and will show up in
* document
* search results and user action lists.
* </p>
*
* return String representing the title of the document
*
* @see org.kuali.rice.krad.document.Document#getDocumentTitle()
*/
@Override
public String getDocumentTitle() {
String documentTypeLabel = KewApiServiceLocator.getDocumentTypeService().getDocumentTypeByName(
this.getDocumentHeader().getWorkflowDocument().getDocumentTypeName()).getLabel();
if (null == documentTypeLabel) {
documentTypeLabel = "";
}
String description = this.getDocumentHeader().getDocumentDescription();
if (null == description) {
description = "";
}
return documentTypeLabel + " - " + description;
}
示例4: canSendAnyTypeAdHocRequests
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
public boolean canSendAnyTypeAdHocRequests(Document document, Person user) {
if (canSendAdHocRequests(document, KewApiConstants.ACTION_REQUEST_FYI_REQ, user)) {
RoutePath routePath = KewApiServiceLocator.getDocumentTypeService().getRoutePathForDocumentTypeName(
document.getDocumentHeader().getWorkflowDocument().getDocumentTypeName());
ProcessDefinition processDefinition = routePath.getPrimaryProcess();
if (processDefinition != null) {
if (processDefinition.getInitialRouteNode() == null) {
return false;
}
} else {
return false;
}
return true;
} else if (canSendAdHocRequests(document, KewApiConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ, user)) {
return true;
}
return canSendAdHocRequests(document, KewApiConstants.ACTION_REQUEST_APPROVE_REQ, user);
}
示例5: runPerformDocumentSearch_RouteNodeSearch
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
private void runPerformDocumentSearch_RouteNodeSearch(String principalId, String routeNodeName, String documentTypeName, int countBeforeNode, int countAtNode, int countAfterNode) throws RemoteException, WorkflowException {
DocumentSearchCriteria.Builder criteria = DocumentSearchCriteria.Builder.create();
criteria.setDocumentTypeName(documentTypeName);
criteria.setRouteNodeName(routeNodeName);
DocumentSearchResults results = KewApiServiceLocator.getWorkflowDocumentService().documentSearch(principalId,
criteria.build());
assertEquals("Wrong number of search results when checking docs at default node logic.", countAtNode, results.getSearchResults().size());
criteria.setRouteNodeLookupLogic(RouteNodeLookupLogic.EXACTLY);
results = KewApiServiceLocator.getWorkflowDocumentService().documentSearch(principalId, criteria.build());
assertEquals("Wrong number of search results when checking docs at exact node.", countAtNode, results.getSearchResults().size());
criteria.setRouteNodeLookupLogic(RouteNodeLookupLogic.BEFORE);
results = KewApiServiceLocator.getWorkflowDocumentService().documentSearch(principalId, criteria.build());
assertEquals("Wrong number of search results when checking docs before node.", countBeforeNode, results.getSearchResults().size());
criteria.setRouteNodeLookupLogic(RouteNodeLookupLogic.AFTER);
results = KewApiServiceLocator.getWorkflowDocumentService().documentSearch(principalId, criteria.build());
assertEquals("Wrong number of search results when checking docs after node.", countAfterNode, results.getSearchResults().size());
}
示例6: canSuperUserDisapprove
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
public boolean canSuperUserDisapprove(Document document, Person user) {
if (!document.getDocumentHeader().hasWorkflowDocument()) {
return false;
}
String principalId = user.getPrincipalId();
String documentTypeId = document.getDocumentHeader().getWorkflowDocument().getDocumentTypeId();
if (KewApiServiceLocator.getDocumentTypeService().isSuperUserForDocumentTypeId(principalId, documentTypeId)) {
return true;
}
String documentTypeName = document.getDocumentHeader().getWorkflowDocument().getDocumentTypeName();
List<RouteNodeInstance> routeNodeInstances = document.getDocumentHeader().getWorkflowDocument().getRouteNodeInstances();
String documentStatus = document.getDocumentHeader().getWorkflowDocument().getStatus().getCode();
return KewApiServiceLocator.getDocumentTypeService().canSuperUserDisapproveDocument(
principalId, documentTypeName, routeNodeInstances, documentStatus);
}
示例7: runTestPerformDocumentSearch_CustomThreshold
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
private void runTestPerformDocumentSearch_CustomThreshold(String principalId) throws Exception {
String documentTypeName = SeqSetup.DOCUMENT_TYPE_NAME;
String docTitle = "Routing Style";
setupPerformDocumentSearchTests(documentTypeName, null, docTitle);
DocumentSearchCriteria.Builder criteria = DocumentSearchCriteria.Builder.create();
criteria.setDocumentTypeName(documentTypeName);
DocumentSearchResults results = KewApiServiceLocator.getWorkflowDocumentService().documentSearch(principalId,
criteria.build());
assertEquals("Search results should have two documents.", 2, results.getSearchResults().size());
int threshold = 1;
criteria.setMaxResults(1);
results = KewApiServiceLocator.getWorkflowDocumentService().documentSearch(principalId, criteria.build());
assertTrue("Search results should signify search went over the given threshold: " + threshold, results.isOverThreshold());
assertEquals("Search results should have one document.", threshold, results.getSearchResults().size());
}
示例8: testGetRouteHeader
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
/**
* Tests the loading of a RouteHeaderVO using the WorkflowInfo.
*
* Verifies that an NPE no longer occurrs as mentioned in KULRICE-765.
*/
@Test
public void testGetRouteHeader() throws Exception {
// ensure the UserSession is cleared out (could have been set up by other tests)
GlobalVariables.setUserSession(null);
String ewestfalPrincipalId = KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName("ewestfal")
.getPrincipalId();
GlobalVariables.setUserSession(new UserSession("ewestfal"));
WorkflowDocument workflowDocument = WorkflowDocumentFactory.createDocument(ewestfalPrincipalId,
"TestDocumentType");
String documentId = workflowDocument.getDocumentId();
assertNotNull(documentId);
Document document = KewApiServiceLocator.getWorkflowDocumentService().getDocument(documentId);
assertNotNull(document);
assertEquals(documentId, document.getDocumentId());
assertEquals(DocumentStatus.INITIATED, document.getStatus());
}
示例9: isNodeInPreviousNodeList
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
public static boolean isNodeInPreviousNodeList(String nodeName, String id) {
LOG.debug("nodeName came in as: " + nodeName);
LOG.debug("id came in as: " + id);
//get list of previous node names
List<String> previousNodeNames;
try {
previousNodeNames = KewApiServiceLocator.getWorkflowDocumentService().getPreviousRouteNodeNames(id);
} catch (Exception e) {
throw new WorkflowRuntimeException("Problem generating list of previous node names for documentID = " + id, e);
}
//see if node name is in the list of previous node names
for (String previousNodeName : previousNodeNames) {
if (previousNodeName.equals(nodeName)) {
return true;
}
}
return false;
}
示例10: retrieveTypeAttributes
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
/**
* Invokes the {@link org.kuali.rice.kew.api.repository.type.KewTypeRepositoryService} to retrieve the remotable
* field definitions for the attributes associated with the selected type
*
* @param view - view instance
* @param model - object containing the form data, from which the selected type will be pulled
* @param container - container that holds the remotable fields
* @return List<RemotableAttributeField> instances for the type attributes, or empty list if not attributes exist
*/
public List<RemotableAttributeField> retrieveTypeAttributes(View view, Object model, Container container) {
List<RemotableAttributeField> remoteFields = new ArrayList<RemotableAttributeField>();
PeopleFlowBo peopleFlow =
(PeopleFlowBo) ((MaintenanceDocumentForm) model).getDocument().getNewMaintainableObject().getDataObject();
// retrieve the type service and invoke to get the remotable field definitions
String typeId = peopleFlow.getTypeId();
if (StringUtils.isNotBlank(typeId)) {
KewTypeDefinition typeDefinition = KewApiServiceLocator.getKewTypeRepositoryService().getTypeById(typeId);
PeopleFlowTypeService peopleFlowTypeService = GlobalResourceLoader.<PeopleFlowTypeService>getService(
QName.valueOf(typeDefinition.getServiceName()));
remoteFields = peopleFlowTypeService.getAttributeFields(typeId);
}
return remoteFields;
}
示例11: saveDataObject
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
/**
* Calls {@link org.kuali.rice.kew.api.peopleflow.PeopleFlowService} to save the people flow instance
*/
@Override
public void saveDataObject() {
PeopleFlowDefinition peopleFlowDefinition;
if (KRADConstants.MAINTENANCE_COPY_ACTION.equals(getMaintenanceAction())) {
peopleFlowDefinition = PeopleFlowBo.maintenanceCopy(((PeopleFlowBo) getDataObject()));
} else {
// this to method ends up copying a versionNumber to null versionNumber
peopleFlowDefinition = PeopleFlowBo.to(((PeopleFlowBo) getDataObject()));
}
if (StringUtils.isNotBlank(peopleFlowDefinition.getId())) {
KewApiServiceLocator.getPeopleFlowService().updatePeopleFlow(peopleFlowDefinition);
} else {
KewApiServiceLocator.getPeopleFlowService().createPeopleFlow(peopleFlowDefinition);
}
}
示例12: isSuperUserApproveDocumentAuthorized
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
public boolean isSuperUserApproveDocumentAuthorized() {
String principalId = GlobalVariables.getUserSession().getPrincipalId();
String docId = this.getDocId();
DocumentType documentType = KewApiServiceLocator.getDocumentTypeService().getDocumentTypeByName(docTypeName);
String docTypeId = null;
if (documentType != null) {
docTypeId = documentType.getId();
}
if ( KewApiServiceLocator.getDocumentTypeService().isSuperUserForDocumentTypeId(principalId, docTypeId) ) {
return true;
}
List<RouteNodeInstance> routeNodeInstances= KewApiServiceLocator.getWorkflowDocumentService().getRouteNodeInstances(docId);
String documentStatus = KewApiServiceLocator.getWorkflowDocumentService().getDocumentStatus(docId).getCode();
return KewApiServiceLocator.getDocumentTypeService().canSuperUserApproveDocument(
principalId, this.getDocTypeName(), routeNodeInstances, documentStatus);
}
示例13: isSuperUserDisapproveDocumentAuthorized
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
public boolean isSuperUserDisapproveDocumentAuthorized() {
String principalId = GlobalVariables.getUserSession().getPrincipalId();
String docId = this.getDocId();
DocumentType documentType = KewApiServiceLocator.getDocumentTypeService().getDocumentTypeByName(docTypeName);
String docTypeId = null;
if (documentType != null) {
docTypeId = documentType.getId();
}
if ( KewApiServiceLocator.getDocumentTypeService().isSuperUserForDocumentTypeId(principalId, docTypeId) ) {
return true;
}
List<RouteNodeInstance> routeNodeInstances= KewApiServiceLocator.getWorkflowDocumentService().getRouteNodeInstances(docId);
String documentStatus = KewApiServiceLocator.getWorkflowDocumentService().getDocumentStatus(docId).getCode();
return KewApiServiceLocator.getDocumentTypeService().canSuperUserDisapproveDocument(
principalId, this.getDocTypeName(), routeNodeInstances, documentStatus);
}
示例14: isSuperUserAuthorized
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
public boolean isSuperUserAuthorized() {
String docId = this.getDocId();
if (StringUtils.isBlank(docId) || ObjectUtils.isNull(docTypeName)) {
return false;
}
DocumentType documentType = KewApiServiceLocator.getDocumentTypeService().getDocumentTypeByName(docTypeName);
String docTypeId = null;
if (documentType != null) {
docTypeId = documentType.getId();
}
String principalId = GlobalVariables.getUserSession().getPrincipalId();
if ( KewApiServiceLocator.getDocumentTypeService().isSuperUserForDocumentTypeId(principalId, docTypeId) ) {
return true;
}
List<RouteNodeInstance> routeNodeInstances= KewApiServiceLocator.getWorkflowDocumentService().getRouteNodeInstances(
docId);
String documentStatus = KewApiServiceLocator.getWorkflowDocumentService().getDocumentStatus(docId).getCode();
return ((KewApiServiceLocator.getDocumentTypeService().canSuperUserApproveSingleActionRequest(
principalId, this.getDocTypeName(), routeNodeInstances, documentStatus)) ||
(KewApiServiceLocator.getDocumentTypeService().canSuperUserApproveDocument(
principalId, this.getDocTypeName(), routeNodeInstances, documentStatus)) ||
(KewApiServiceLocator.getDocumentTypeService().canSuperUserDisapproveDocument (
principalId, this.getDocTypeName(), routeNodeInstances, documentStatus))) ;
}
示例15: canSendAnyTypeAdHocRequests
import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
public boolean canSendAnyTypeAdHocRequests(Document document, Person user) {
if (canSendAdHocRequests(document, KewApiConstants.ACTION_REQUEST_FYI_REQ, user)) {
RoutePath routePath = KewApiServiceLocator.getDocumentTypeService().getRoutePathForDocumentTypeName(
document.getDocumentHeader().getWorkflowDocument().getDocumentTypeName());
ProcessDefinition processDefinition = routePath.getPrimaryProcess();
if (processDefinition != null) {
if (processDefinition.getInitialRouteNode() == null) {
return false;
}
} else {
return false;
}
return true;
} else if (canSendAdHocRequests(document, KewApiConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ, user)) {
return true;
}
return canSendAdHocRequests(document, KewApiConstants.ACTION_REQUEST_APPROVE_REQ, user);
}