本文整理汇总了Java中org.kuali.rice.kew.actionitem.ActionItem.setDocLabel方法的典型用法代码示例。如果您正苦于以下问题:Java ActionItem.setDocLabel方法的具体用法?Java ActionItem.setDocLabel怎么用?Java ActionItem.setDocLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kew.actionitem.ActionItem
的用法示例。
在下文中一共展示了ActionItem.setDocLabel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createActionItemForActionRequest
import org.kuali.rice.kew.actionitem.ActionItem; //导入方法依赖的package包/类
@Override
public ActionItem createActionItemForActionRequest(ActionRequestValue actionRequest) {
ActionItem actionItem = new ActionItem();
DocumentRouteHeaderValue routeHeader = actionRequest.getRouteHeader();
DocumentType docType = routeHeader.getDocumentType();
actionItem.setActionRequestCd(actionRequest.getActionRequested());
actionItem.setActionRequestId(actionRequest.getActionRequestId());
actionItem.setDocName(docType.getName());
actionItem.setRoleName(actionRequest.getQualifiedRoleName());
actionItem.setPrincipalId(actionRequest.getPrincipalId());
actionItem.setDocumentId(actionRequest.getDocumentId());
actionItem.setDateAssigned(new Timestamp(new Date().getTime()));
actionItem.setDocHandlerURL(docType.getResolvedDocumentHandlerUrl());
actionItem.setDocLabel(docType.getLabel());
actionItem.setDocTitle(routeHeader.getDocTitle());
actionItem.setGroupId(actionRequest.getGroupId());
actionItem.setResponsibilityId(actionRequest.getResponsibilityId());
actionItem.setDelegationType(actionRequest.getDelegationType());
actionItem.setRequestLabel(actionRequest.getRequestLabel());
ActionRequestValue delegatorActionRequest = actionRequestService.findDelegatorRequest(actionRequest);
if (delegatorActionRequest != null) {
actionItem.setDelegatorPrincipalId(delegatorActionRequest.getPrincipalId());
actionItem.setDelegatorGroupId(delegatorActionRequest.getGroupId());
}
return actionItem;
}
示例2: generateActionItem
import org.kuali.rice.kew.actionitem.ActionItem; //导入方法依赖的package包/类
private ActionItem generateActionItem(DocumentRouteHeaderValue routeHeader, String actionRequested, String authenticationId, String groupId) {
ActionItem actionItem = new ActionItem();
actionItem.setActionRequestCd(actionRequested);
actionItem.setActionRequestId("1");
actionItem.setPrincipalId(getPrincipalIdForName(authenticationId));
actionItem.setDocumentId(routeHeader.getDocumentId());
actionItem.setDateAssigned(new Timestamp(new Date().getTime()));
actionItem.setDocHandlerURL("Unit testing");
actionItem.setDocLabel("unit testing");
actionItem.setDocTitle(routeHeader.getDocTitle());
actionItem.setDocName("docname");
actionItem.setGroupId(groupId);
// actionItem.setResponsibilityId(new Long(-1));
return actionItem;
}
示例3: saveBusinessObject
import org.kuali.rice.kew.actionitem.ActionItem; //导入方法依赖的package包/类
/**
* This is a complete override which does not call into
* {@link KualiMaintainableImpl}. This method calls
* {@link DocumentTypeService#versionAndSave(DocumentType)}.
*
*/
@Override
public void saveBusinessObject() {
DocumentTypeService docTypeService = KEWServiceLocator.getDocumentTypeService();
DocumentType newDocumentType = (DocumentType) getBusinessObject();
String documentTypeName = newDocumentType.getName();
DocumentType docTypeFromDatabase = docTypeService.findByName(documentTypeName);
if (docTypeFromDatabase == null) {
docTypeService.versionAndSave(newDocumentType);
}
else {
Boolean applyRetroactively = newDocumentType.getApplyRetroactively();
DocumentType newDocumentTypeFromDatabase;
DocumentTypeXmlParser parser = new DocumentTypeXmlParser();
try {
newDocumentTypeFromDatabase = parser.generateNewDocumentTypeFromExisting(documentTypeName);
} catch (Exception e) {
throw new WorkflowRuntimeException("Error while attempting to generate new document type from existing " +
"database document type with name '" + documentTypeName + "'", e);
}
newDocumentTypeFromDatabase.populateDataDictionaryEditableFields(constructUserInterfaceEditablePropertyNamesList(), newDocumentType);
docTypeService.versionAndSave(newDocumentTypeFromDatabase);
if (KRADUtils.isNotNull(applyRetroactively) && applyRetroactively.booleanValue()) {
// save all previous instances of document type with the same name
// fields: label, description, unresolvedHelpDefinitionUrl
List<DocumentType> previousDocTypeInstances = docTypeService.findPreviousInstances(documentTypeName);
for (DocumentType prevDocType : previousDocTypeInstances) {
// set up fields
prevDocType.setLabel(newDocumentType.getLabel());
prevDocType.setDescription(newDocumentType.getDescription());
prevDocType.setUnresolvedHelpDefinitionUrl(newDocumentType.getUnresolvedHelpDefinitionUrl());
prevDocType.setUnresolvedDocSearchHelpUrl(newDocumentType.getUnresolvedDocSearchHelpUrl());
docTypeService.save(prevDocType);
}
// save all former/current action items matching document type name
// fields: docLabel
ActionListService actionListService = KEWServiceLocator.getActionListService();
Collection<ActionItem> items = actionListService.findByDocumentTypeName(documentTypeName);
for (ActionItem actionItem : items) {
actionItem.setDocLabel(newDocumentType.getLabel());
actionListService.saveActionItem(actionItem);
}
// save all former/current outbox action items matching document type name
// fields: docLabel
Collection<OutboxItem> outboxItems = actionListService.getOutboxItemsByDocumentType(documentTypeName);
for (OutboxItem outboxItem : outboxItems) {
outboxItem.setDocLabel(newDocumentType.getLabel());
actionListService.saveOutboxItem(outboxItem);
}
}
}
}
示例4: testConvertActionItem
import org.kuali.rice.kew.actionitem.ActionItem; //导入方法依赖的package包/类
@Test public void testConvertActionItem() throws Exception {
// get test data
String testWorkgroupName = "TestWorkgroup";
Group testWorkgroup = KimApiServiceLocator.getGroupService().getGroupByNamespaceCodeAndName(
KimConstants.KIM_GROUP_WORKFLOW_NAMESPACE_CODE, testWorkgroupName);
String testWorkgroupId = testWorkgroup.getId();
assertTrue("Test workgroup '" + testWorkgroupName + "' should have at least one user", KimApiServiceLocator.getGroupService().getDirectMemberPrincipalIds(
testWorkgroup.getId()).size() > 0);
String workflowId = KimApiServiceLocator.getGroupService().getDirectMemberPrincipalIds(testWorkgroup.getId()).get(0);
assertNotNull("User from workgroup should not be null", workflowId);
String actionRequestCd = KewApiConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ;
String actionRequestId = "4";
String docName = "dummy";
String roleName = "fakeRole";
String documentId = "23";
Timestamp dateAssigned = new Timestamp(new Date().getTime());
String docHandlerUrl = "http://this.is.not.us";
String docTypeLabel = "Label Me";
String docTitle = "Title me";
String responsibilityId = "35";
DelegationType delegationType = DelegationType.PRIMARY;
// create fake action item
ActionItem actionItem = new ActionItem();
actionItem.setActionRequestCd(actionRequestCd);
actionItem.setActionRequestId(actionRequestId);
actionItem.setDocName(docName);
actionItem.setRoleName(roleName);
actionItem.setPrincipalId(workflowId);
actionItem.setDocumentId(documentId);
actionItem.setDateAssigned(dateAssigned);
actionItem.setDocHandlerURL(docHandlerUrl);
actionItem.setDocLabel(docTypeLabel);
actionItem.setDocTitle(docTitle);
actionItem.setGroupId(testWorkgroupId);
actionItem.setResponsibilityId(responsibilityId);
actionItem.setDelegationType(delegationType);
actionItem.setDelegatorPrincipalId(workflowId);
actionItem.setDelegatorGroupId(testWorkgroupId);
// convert to action item vo object and verify
org.kuali.rice.kew.api.action.ActionItem actionItemVO = ActionItem.to(actionItem);
assertEquals("Action Item VO object has incorrect value", actionRequestCd, actionItemVO.getActionRequestCd());
assertEquals("Action Item VO object has incorrect value", actionRequestId, actionItemVO.getActionRequestId());
assertEquals("Action Item VO object has incorrect value", docName, actionItemVO.getDocName());
assertEquals("Action Item VO object has incorrect value", roleName, actionItemVO.getRoleName());
assertEquals("Action Item VO object has incorrect value", workflowId, actionItemVO.getPrincipalId());
assertEquals("Action Item VO object has incorrect value", documentId, actionItemVO.getDocumentId());
assertEquals("Action Item VO object has incorrect value", new DateTime(dateAssigned.getTime()), actionItemVO.getDateTimeAssigned());
assertEquals("Action Item VO object has incorrect value", docHandlerUrl, actionItemVO.getDocHandlerURL());
assertEquals("Action Item VO object has incorrect value", docTypeLabel, actionItemVO.getDocLabel());
assertEquals("Action Item VO object has incorrect value", docTitle, actionItemVO.getDocTitle());
assertEquals("Action Item VO object has incorrect value", "" + testWorkgroupId, actionItemVO.getGroupId());
assertEquals("Action Item VO object has incorrect value", responsibilityId, actionItemVO.getResponsibilityId());
assertEquals("Action Item VO object has incorrect value", delegationType, actionItemVO.getDelegationType());
assertEquals("Action Item VO object has incorrect value", workflowId, actionItemVO.getDelegatorPrincipalId());
assertEquals("Action Item VO object has incorrect value", testWorkgroupId, actionItemVO.getDelegatorGroupId());
}