本文整理汇总了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;
}
示例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);
}
}
示例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);
}