本文整理汇总了Java中org.kuali.rice.kew.api.WorkflowDocument.setApplicationDocumentId方法的典型用法代码示例。如果您正苦于以下问题:Java WorkflowDocument.setApplicationDocumentId方法的具体用法?Java WorkflowDocument.setApplicationDocumentId怎么用?Java WorkflowDocument.setApplicationDocumentId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kew.api.WorkflowDocument
的用法示例。
在下文中一共展示了WorkflowDocument.setApplicationDocumentId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: routeTestDocs
import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
* Routes some test docs for searching
* @return String[] of doc ids
*/
protected String[] routeTestDocs() {
// Route some test documents.
String[] docIds = new String[TestDocData.titles.length];
for (int i = 0; i < TestDocData.titles.length; i++) {
WorkflowDocument workflowDocument = WorkflowDocumentFactory.createDocument(
getPrincipalId(TestDocData.principalNames[i]), TestDocData.docTypeName);
workflowDocument.setTitle(TestDocData.titles[i]);
workflowDocument.setApplicationDocumentId(TestDocData.appDocIds[i]);
workflowDocument.route("routing this document.");
docIds[i] = workflowDocument.getDocumentId();
if (TestDocData.approverNames[i] != null) {
workflowDocument.switchPrincipal(getPrincipalId(TestDocData.approverNames[i]));
workflowDocument.approve("approving this document.");
}
workflowDocument.setApplicationDocumentStatus(TestDocData.appDocStatuses[i]);
workflowDocument.saveDocumentData();
}
return docIds;
}
示例2: testGetAppDocId
import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test
public void testGetAppDocId() throws Exception {
WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"),
"TestDocumentType");
document.saveDocumentData();
String appDocId = KewApiServiceLocator.getWorkflowDocumentService().getApplicationDocumentId(document.getDocumentId());
assertNull("appDocId should be null", appDocId);
String appDocIdValue = "1234";
document.setApplicationDocumentId(appDocIdValue);
document.saveDocumentData();
appDocId = KewApiServiceLocator.getWorkflowDocumentService().getApplicationDocumentId(document.getDocumentId());
assertEquals("Incorrect appDocId", appDocIdValue, appDocId);
}
示例3: createAndAdHocRouteNotificationWorkflowDocument
import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
* Implements by instantiating a NotificationWorkflowDocument, which in turn interacts with
* Workflow to set it up with an initiator of the passed in user id.
* @see org.kuali.rice.ken.service.NotificationWorkflowDocumentService#createAndAdHocRouteNotificationWorkflowDocument(org.kuali.rice.ken.bo.NotificationMessageDelivery,
* java.lang.String, java.lang.String, java.lang.String)
*/
public String createAndAdHocRouteNotificationWorkflowDocument(NotificationMessageDelivery messageDelivery,
String initiatorUserId,
String recipientUserId, String annotation) {
// obtain a workflow user object first
//WorkflowIdDTO initiator = new WorkflowIdDTO(initiatorUserId);
// now construct the workflow document, which will interact with workflow
WorkflowDocument document;
if (StringUtils.isNotBlank(messageDelivery.getNotification().getDocTypeName())) {
document = NotificationWorkflowDocument.createNotificationDocument(initiatorUserId,
messageDelivery.getNotification().getDocTypeName());
} else {
document = NotificationWorkflowDocument.createNotificationDocument(initiatorUserId);
}
// this is our loose foreign key to our message delivery record in notification
document.setApplicationDocumentId(messageDelivery.getId().toString());
//document.setAppDocId(messageDelivery.getId().toString());
// now add the content of the notification as XML to the document
document.setApplicationContent(messageContentService.generateNotificationMessage(
messageDelivery.getNotification(), messageDelivery.getUserRecipientId()));
if (!StringUtils.isBlank(messageDelivery.getNotification().getTitle())) {
document.setTitle(messageDelivery.getNotification().getTitle());
} else {
LOG.error("Encountered notification with no title set: Message Delivery #" + messageDelivery.getId()
+ ", Notification #" + messageDelivery.getNotification().getId());
}
// now set up the ad hoc route
String actionRequested;
if (NotificationConstants.DELIVERY_TYPES.ACK.equals(messageDelivery.getNotification().getDeliveryType())) {
actionRequested = NotificationConstants.KEW_CONSTANTS.ACK_AD_HOC_ROUTE;
} else {
actionRequested = NotificationConstants.KEW_CONSTANTS.FYI_AD_HOC_ROUTE;
}
// Clarification of ad hoc route call
// param 1 - actionRequested will be either ACK or FYI
// param 2 - annotation is whatever text we pass in to describe the transaction - this will be system generated
// param 3 - recipient is the person who will receive this request
// param 4 - this is the responsibilityParty (a.k.a the system that produced this request), so we'll put the producer name in there
// param 5 - this is the "force action" requests - if set to true, this will be delivered to the recipients list regardless of
// whether the recipient has already taken action on this request; in our case, this doesn't really apply at this point in time,
// so we'll set to true just to be safe
// recipientUserId will always be a principal ID due to code changes in NotificationMessageDeliveryResolverServiceImpl.buildCompleteRecipientList()
Principal principal = KimApiServiceLocator.getIdentityService().getPrincipal(recipientUserId);
document.adHocToPrincipal(ActionRequestType.fromCode(actionRequested), annotation, principal.getPrincipalId(),
messageDelivery.getNotification().getProducer().getName(), true);
// now actually route it along its way
document.route(annotation);
return document.getDocumentId();
}