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


Java Execution.getProcessInstanceId方法代码示例

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


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

示例1: historyDatas

import org.activiti.engine.runtime.Execution; //导入方法依赖的package包/类
/**
 * 读取历史数据
 *
 * @return
 */
@RequestMapping(value = "trace/view/{executionId}")
public ModelAndView historyDatas(@PathVariable("executionId") String executionId) {
    ModelAndView mav = new ModelAndView("chapter13/trace-process");

    // 查询Execution对象
    Execution execution = runtimeService.createExecutionQuery().executionId(executionId).singleResult();

    // 查询所有的历史活动记录
    String processInstanceId = execution.getProcessInstanceId();
    List<HistoricActivityInstance> activityInstances = historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).list();

    // 查询历史流程实例
    HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery()
            .processInstanceId(processInstanceId).singleResult();

    // 查询流程有关的变量
    List<HistoricVariableInstance> variableInstances = historyService.createHistoricVariableInstanceQuery()
            .processInstanceId(processInstanceId).list();

    List<HistoricDetail> formProperties = historyService.createHistoricDetailQuery().processInstanceId(processInstanceId).formProperties().list();

    // 查询流程定义对象
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
            .processDefinitionId(historicProcessInstance.getProcessDefinitionId()).singleResult();

    // 查询运行时流程实例
    ProcessInstance parentProcessInstance = runtimeService.createProcessInstanceQuery()
            .subProcessInstanceId(execution.getProcessInstanceId()).singleResult();

    mav.addObject("parentProcessInstance", parentProcessInstance);
    mav.addObject("historicProcessInstance", historicProcessInstance);
    mav.addObject("variableInstances", variableInstances);
    mav.addObject("activities", activityInstances);
    mav.addObject("formProperties", formProperties);
    mav.addObject("processDefinition", processDefinition);
    mav.addObject("executionId", executionId);

    return mav;
}
 
开发者ID:shawn-gogh,项目名称:myjavacode,代码行数:45,代码来源:TraceProcessController.java

示例2: getTasksForWorkflowPath

import org.activiti.engine.runtime.Execution; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
public List<WorkflowTask> getTasksForWorkflowPath(String pathId)
{
    try
    {
        // Extract the Activiti ID from the path
        String executionId = createLocalId(pathId);
        if (executionId == null)
        {
            throw new WorkflowException(messageService.getMessage(ERR_GET_WORKFLOW_TOKEN_INVALID, pathId));
        }

        // Check if the execution exists
        Execution execution = runtimeService.createExecutionQuery().executionId(executionId).singleResult();
        if (execution == null)
        {
            throw new WorkflowException(messageService.getMessage(ERR_GET_WORKFLOW_TOKEN_NULL, pathId));
        }

        String processInstanceId = execution.getProcessInstanceId();
        ArrayList<WorkflowTask> resultList = new ArrayList<WorkflowTask>();
        if(!activitiUtil.isMultiTenantWorkflowDeploymentEnabled() && false == typeConverter.isCorrectTenantRuntime(processInstanceId))
        {
            return resultList; //Wrong tenant
        }
        // Check if workflow's start task has been completed. If not, return
        // the virtual task
        // Otherwise, just return the runtime Activiti tasks
        if (typeConverter.isStartTaskActive(processInstanceId))
        {
            resultList.add(typeConverter.getVirtualStartTask(processInstanceId, true));
        }
        else
        {
            List<Task> tasks = taskService.createTaskQuery().executionId(executionId).list();
            for (Task task : tasks)
            {
                resultList.add(typeConverter.convert(task));
            }
        }
        return resultList;
    }
    catch (ActivitiException ae)
    {
    	
        String msg = messageService.getMessage(ERR_GET_TASKS_FOR_PATH, pathId);
        if(logger.isDebugEnabled())
        {
        	logger.debug(msg, ae);
        }
        throw new WorkflowException(msg, ae);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:56,代码来源:ActivitiWorkflowEngine.java

示例3: convert

import org.activiti.engine.runtime.Execution; //导入方法依赖的package包/类
public WorkflowPath convert(Execution execution)
{
    String instanceId = execution.getProcessInstanceId();
    ProcessInstance instance = activitiUtil.getProcessInstance(instanceId);
    return convert(execution, instance);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:7,代码来源:ActivitiTypeConverter.java


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