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


Java ProcessDefinitionQuery.processDefinitionKeyLike方法代码示例

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


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

示例1: getAllDefinitions

import org.activiti.engine.repository.ProcessDefinitionQuery; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
public List<WorkflowDefinition> getAllDefinitions()
{
    try 
    {
        ProcessDefinitionQuery query = repoService.createProcessDefinitionQuery();
        if(activitiUtil.isMultiTenantWorkflowDeploymentEnabled() && !TenantUtil.isCurrentDomainDefault()) 
        {
            query.processDefinitionKeyLike("@" + TenantUtil.getCurrentDomain() + "%");
        }
        return getValidWorkflowDefinitions(query.list());
    } 
    catch (ActivitiException ae)
    {
        String msg = messageService.getMessage(ERR_GET_WORKFLOW_DEF);
        if(logger.isDebugEnabled())
        {
        	logger.debug(msg, ae);
        }
        throw new WorkflowException(msg, ae);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:ActivitiWorkflowEngine.java

示例2: getDefinitions

import org.activiti.engine.repository.ProcessDefinitionQuery; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
public List<WorkflowDefinition> getDefinitions()
{
    try 
    {
        ProcessDefinitionQuery query = repoService.createProcessDefinitionQuery().latestVersion();
        if(activitiUtil.isMultiTenantWorkflowDeploymentEnabled() && !TenantUtil.isCurrentDomainDefault()) 
        {
            query.processDefinitionKeyLike("@" + TenantUtil.getCurrentDomain() + "%");
        }
        return getValidWorkflowDefinitions(query.list());
    }
    catch (ActivitiException ae)
    {
        String msg = messageService.getMessage(ERR_GET_WORKFLOW_DEF);
        if(logger.isDebugEnabled())
        {
        	logger.debug(msg, ae);
        }
        throw new WorkflowException(msg, ae);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:ActivitiWorkflowEngine.java

示例3: getProcessDefinition

import org.activiti.engine.repository.ProcessDefinitionQuery; //导入方法依赖的package包/类
@Override
public ProcessDefinition getProcessDefinition(String definitionId)
{
    ProcessDefinitionQuery query = activitiProcessEngine
            .getRepositoryService()
            .createProcessDefinitionQuery()
            .processDefinitionId(definitionId);
    
    if (tenantService.isEnabled() && deployWorkflowsInTenant) 
    {
        query.processDefinitionKeyLike("@" + TenantUtil.getCurrentDomain() + "@%");
    }
    
    org.activiti.engine.repository.ProcessDefinition processDefinition = query.singleResult();
    
    if (processDefinition == null) 
    {
        throw new EntityNotFoundException(definitionId); 
    }

    ProcessDefinition deploymentRest = createProcessDefinitionRest((ProcessDefinitionEntity) processDefinition);
    return deploymentRest;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:24,代码来源:ProcessDefinitionsImpl.java

示例4: getProcessDefinitionImage

import org.activiti.engine.repository.ProcessDefinitionQuery; //导入方法依赖的package包/类
@Override
public BinaryResource getProcessDefinitionImage(String definitionId)
{
	ProcessDefinitionQuery query = activitiProcessEngine
            .getRepositoryService()
            .createProcessDefinitionQuery()
            .processDefinitionId(definitionId);
    
    if (tenantService.isEnabled() && deployWorkflowsInTenant) 
    {
        query.processDefinitionKeyLike("@" + TenantUtil.getCurrentDomain() + "@%");
    }
    
    org.activiti.engine.repository.ProcessDefinition processDefinition = query.singleResult();
    
    if (processDefinition == null) 
    {
        throw new EntityNotFoundException(definitionId); 
    }
    
    try
    {
    	InputStream processDiagram = activitiProcessEngine.getRepositoryService().getProcessDiagram(definitionId);
    	if (processDiagram != null) 
    	{
         File file = TempFileProvider.createTempFile(definitionId + UUID.randomUUID(), ".png");
         FileOutputStream fos = new FileOutputStream(file);
         IOUtils.copy(processDiagram, fos);
         fos.close();
             
         return new FileBinaryResource(file);
    	}
    	else
    	{
    		throw new ApiException("No image available for definitionId " + definitionId); 
    	}
    }
    catch (IOException error)
    {
        throw new ApiException("Error while getting process definition image.");
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:43,代码来源:ProcessDefinitionsImpl.java


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