当前位置: 首页>>代码示例>>Java>>正文


Java DocumentRouteHeaderValue.getDocContent方法代码示例

本文整理汇总了Java中org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue.getDocContent方法的典型用法代码示例。如果您正苦于以下问题:Java DocumentRouteHeaderValue.getDocContent方法的具体用法?Java DocumentRouteHeaderValue.getDocContent怎么用?Java DocumentRouteHeaderValue.getDocContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue的用法示例。


在下文中一共展示了DocumentRouteHeaderValue.getDocContent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createDocument

import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
public DocumentRouteHeaderValue createDocument(String principalId, DocumentRouteHeaderValue routeHeader) throws WorkflowException {

		if (routeHeader.getDocumentId() != null) { // this is a debateable
														// check - means the
														// client is off
			throw new InvalidActionTakenException("Document already has a Document id");
		}
		Principal principal = loadPrincipal(principalId);
		boolean canInitiate = KEWServiceLocator.getDocumentTypePermissionService().canInitiate(principalId, routeHeader.getDocumentType());

		if (!canInitiate) {
			throw new InvalidActionTakenException("Principal with name '" + principal.getPrincipalName() + "' is not authorized to initiate documents of type '" + routeHeader.getDocumentType().getName());
		}

        if (!routeHeader.getDocumentType().isDocTypeActive()) {
            // don't allow creation if document type is inactive
            throw new IllegalDocumentTypeException("Document type '" + routeHeader.getDocumentType().getName() + "' is inactive");
        }

		routeHeader.setInitiatorWorkflowId(principalId);
		if (routeHeader.getDocRouteStatus() == null) {
			routeHeader.setDocRouteStatus(KewApiConstants.ROUTE_HEADER_INITIATED_CD);
		}
		if (routeHeader.getDocRouteLevel() == null) {
			routeHeader.setDocRouteLevel(Integer.valueOf(KewApiConstants.ADHOC_ROUTE_LEVEL));
		}
		if (routeHeader.getCreateDate() == null) {
			routeHeader.setCreateDate(new Timestamp(new Date().getTime()));
		}
		if (routeHeader.getDocVersion() == null) {
			routeHeader.setDocVersion(Integer.valueOf(KewApiConstants.DocumentContentVersions.CURRENT));
		}
		if (routeHeader.getDocContent() == null) {
			routeHeader.setDocContent(KewApiConstants.DEFAULT_DOCUMENT_CONTENT);
		}
		routeHeader.setDateModified(new Timestamp(new Date().getTime()));
		routeHeader = KEWServiceLocator.getRouteHeaderService().saveRouteHeader(routeHeader);
		OrchestrationConfig config = new OrchestrationConfig(EngineCapability.STANDARD);
		KEWServiceLocator.getWorkflowEngineFactory().newEngine(config).initializeDocument(routeHeader);
		routeHeader = KEWServiceLocator.getRouteHeaderService().saveRouteHeader(routeHeader);
		return routeHeader;
	}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:43,代码来源:WorkflowDocumentServiceImpl.java


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