• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java KewApiServiceLocator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



KewApiServiceLocator类属于org.kuali.rice.kew.api包,在下文中一共展示了KewApiServiceLocator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:WorkflowUtilityTest.java


示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:DocumentControllerServiceImpl.java


示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:31,代码来源:DocumentBase.java


示例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);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:DocumentAuthorizerBase.java


示例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());
    }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:WorkflowUtilityTest.java


示例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);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:DocumentAuthorizerBase.java


示例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());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:WorkflowUtilityTest.java


示例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());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:WorkflowInfoTest.java


示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:EDLFunctions.java


示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:PeopleFlowMaintainableImpl.java


示例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);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:PeopleFlowMaintainableImpl.java


示例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);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:KualiDocumentFormBase.java


示例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);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:KualiDocumentFormBase.java


示例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))) ;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:KualiDocumentFormBase.java


示例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);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:DocumentAuthorizerBase.java


示例16: canSuperUserTakeAction

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public boolean canSuperUserTakeAction(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().canSuperUserApproveSingleActionRequest(
            principalId, documentTypeName, routeNodeInstances, documentStatus);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:DocumentAuthorizerBase.java


示例17: canSuperUserApprove

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public boolean canSuperUserApprove(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().canSuperUserApproveDocument(
            principalId, documentTypeName, routeNodeInstances, documentStatus);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:DocumentAuthorizerBase.java


示例18: testManualDocumentContentModification

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
/**
 * Tests modification of the DocumentContentVO object directly.
 */
@Test public void testManualDocumentContentModification() throws Exception {
	WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), "TestDocumentType");
	document.saveDocumentData();
	
	// fetch it from WorkflowInfo
	DocumentContent content = KewApiServiceLocator.getWorkflowDocumentService().getDocumentContent(document.getDocumentId());
	assertTrue("Should contain default content, was " + content.getFullContent(), KewApiConstants.DEFAULT_DOCUMENT_CONTENT.equals(content.getFullContent()) ||
			KewApiConstants.DEFAULT_DOCUMENT_CONTENT2.equals(content.getFullContent()));
	
	String appContent = "<abcdefg>hijklm n o p</abcdefg>";
	DocumentContentUpdate.Builder contentUpdate = DocumentContentUpdate.Builder.create(content);
	contentUpdate.setApplicationContent(appContent);
	document.updateDocumentContent(contentUpdate.build());
    document.saveDocumentData();
	
	// test that the content on the document is the same as the content we just set
	XMLAssert.assertXMLEqual(appContent, document.getApplicationContent());
	
	// fetch the document fresh and make sure the content is correct
	document = WorkflowDocumentFactory.loadDocument(getPrincipalIdForName("ewestfal"), document.getDocumentId());
	XMLAssert.assertXMLEqual(appContent, document.getApplicationContent());
	
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:DocumentContentTest.java


示例19: reResolveRole

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
public void reResolveRole(DocumentType documentType, String roleName) {
  	String infoString = "documentType="+(documentType == null ? null : documentType.getName())+", role="+roleName;
      if (documentType == null ||
              org.apache.commons.lang.StringUtils.isEmpty(roleName)) {
          throw new IllegalArgumentException("Cannot pass null or empty arguments to reResolveQualifiedRole: "+infoString);
      }
      LOG.debug("Re-resolving role asynchronously for "+infoString);
  	Set<String> documentIds = new HashSet<String>();
  	findAffectedDocuments(documentType, roleName, null, documentIds);
  	LOG.debug(documentIds.size()+" documents were affected by this re-resolution, requeueing with the RolePokerQueue");
      for (String documentId : documentIds) {
          String applicationId = KEWServiceLocator.getRouteHeaderService().getApplicationIdByDocumentId(documentId);
          RolePokerQueue rolePokerQueue = KewApiServiceLocator.getRolePokerQueue(documentId, applicationId);
  		rolePokerQueue.reResolveRole(documentId, roleName);
}
  }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:RoleServiceImpl.java


示例20: filterActionItemsToNotify

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
/**
 * Returns a filtered Collection of {@link ActionItem}s which are filtered according to the
 * user's preferences. If they have opted not to recieve secondary or primary delegation emails
 * then they will not be included.
 */
protected Collection<ActionItem> filterActionItemsToNotify(String principalId, Collection<ActionItem> actionItems, String emailSetting) {
    List<ActionItem> filteredItems = new ArrayList<ActionItem>();
    Preferences preferences = KewApiServiceLocator.getPreferencesService().getPreferences(principalId);
    for (ActionItem actionItem : actionItems) {
        if (!actionItem.getPrincipalId().equals(principalId)) {
            LOG.warn("Encountered an ActionItem with an incorrect workflow ID.  Was " + actionItem.getPrincipalId()
                    +
                    " but expected " + principalId);
            continue;
        }
        if (checkEmailNotificationPreferences(actionItem, preferences, emailSetting)) {
            filteredItems.add(actionItem);
        }
    }
    return filteredItems;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:ActionListEmailServiceImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JanusGraphFactory类代码示例发布时间:2022-05-22
下一篇:
Java ISO9796d2Signer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap