org.activiti.engine.runtime.Execution.getProcessInstanceId()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中org.activiti.engine.runtime.Execution.getProcessInstanceId()方法的一些代码示例,展示了Execution.getProcessInstanceId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Execution.getProcessInstanceId()方法的具体详情如下:
包路径:org.activiti.engine.runtime.Execution
类名称:Execution
方法名:getProcessInstanceId

Execution.getProcessInstanceId介绍

[英]Id of the root of the execution tree representing the process instance. It is the same as #getId() if this execution is the process instance.
[中]表示流程实例的执行树根的Id。如果此执行是流程实例,则与#getId()相同。

代码示例

代码示例来源:origin: com.camunda.fox.platform/fox-platform-client

/**
 * Returns the id of the currently associated process instance or 'null'
 */
public String getProcessInstanceId() {
 Execution execution = associationManager.getExecution();
 return execution != null ? execution.getProcessInstanceId() : null; 
}

代码示例来源:origin: com.camunda.fox.engine/fox-engine-cdi

/**
 * Returns the id of the currently associated process instance or 'null'
 */
public String getProcessInstanceId() {
 Execution execution = associationManager.getExecution();
 return execution != null ? execution.getProcessInstanceId() : null; 
}

代码示例来源:origin: org.alfresco/alfresco-repository

public WorkflowPath convert(Execution execution)
{
  String instanceId = execution.getProcessInstanceId();
  ProcessInstance instance = activitiUtil.getProcessInstance(instanceId);
  return convert(execution, instance);
}

代码示例来源:origin: stackoverflow.com

final Execution execution = runtimeService.createExecutionQuery().executionId(executionId).singleResult();
final ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(execution.getProcessInstanceId()).singleResult();
final BpmnModel bpmnModel = repositoryService.getBpmnModel(processInstance.getProcessDefinitionId());
final org.activiti.bpmn.model.FlowElement flowElement = bpmnModel.getFlowElement(((DelegateExecution) execution).getCurrentActivityId());

代码示例来源:origin: Alfresco/alfresco-repository

public WorkflowPath convert(Execution execution)
{
  String instanceId = execution.getProcessInstanceId();
  ProcessInstance instance = activitiUtil.getProcessInstance(instanceId);
  return convert(execution, instance);
}

代码示例来源:origin: com.camunda.fox.platform/fox-platform-client

/**
 * Returns the {@link ProcessInstance} currently associated or 'null'
 * 
 * @throws ActivitiCdiException
 *           if no {@link Execution} is associated. Use
 *           {@link #isAssociated()} to check whether an association exists.
 */
public ProcessInstance getProcessInstance() {
 Execution execution = getExecution();    
 if(execution != null && !(execution.getProcessInstanceId().equals(execution.getId()))){
  return processEngine
     .getRuntimeService()
     .createProcessInstanceQuery()
     .processInstanceId(execution.getProcessInstanceId())
     .singleResult();
 }
 return (ProcessInstance) execution;    
}

代码示例来源:origin: com.camunda.fox.engine/fox-engine-cdi

/**
 * Returns the {@link ProcessInstance} currently associated or 'null'
 * 
 * @throws ActivitiCdiException
 *           if no {@link Execution} is associated. Use
 *           {@link #isAssociated()} to check whether an association exists.
 */
public ProcessInstance getProcessInstance() {
 Execution execution = getExecution();    
 if(execution != null && !(execution.getProcessInstanceId().equals(execution.getId()))){
  return processEngine
     .getRuntimeService()
     .createProcessInstanceQuery()
     .processInstanceId(execution.getProcessInstanceId())
     .singleResult();
 }
 return (ProcessInstance) execution;    
}

代码示例来源:origin: org.aperteworkflow/activiti-context

@Override
  public String transform(Task task) {
    Execution exec = getProcessEngine().getRuntimeService().createExecutionQuery().executionId(task.getExecutionId()).singleResult();
    return exec.getProcessInstanceId();
  }
});

代码示例来源:origin: org.alfresco/alfresco-repository

/**
* {@inheritDoc}
*/
public WorkflowPath signal(String pathId, String transitionId)
{
  String execId = createLocalId(pathId);
  Execution oldExecution = activitiUtil.getExecution(execId);
  runtimeService.signal(execId);
  Execution execution = activitiUtil.getExecution(execId);
  if(execution !=null)
  {
    return typeConverter.convert(execution);
  }
  return typeConverter.buildCompletedPath(execId, oldExecution.getProcessInstanceId());
}

代码示例来源:origin: Alfresco/alfresco-repository

/**
* {@inheritDoc}
*/
public WorkflowPath signal(String pathId, String transitionId)
{
  String execId = createLocalId(pathId);
  Execution oldExecution = activitiUtil.getExecution(execId);
  runtimeService.signal(execId);
  Execution execution = activitiUtil.getExecution(execId);
  if(execution !=null)
  {
    return typeConverter.convert(execution);
  }
  return typeConverter.buildCompletedPath(execId, oldExecution.getProcessInstanceId());
}

代码示例来源:origin: FINRAOS/herd

builder.append("    execution.getActivityId():").append(execution.getActivityId()).append('\n');
builder.append("    execution.getParentId():").append(execution.getParentId()).append('\n');
builder.append("    execution.getProcessInstanceId():").append(execution.getProcessInstanceId()).append('\n');
builder.append("    execution.isEnded():").append(execution.isEnded()).append('\n');
builder.append("    execution.isSuspended():").append(execution.isSuspended()).append('\n');

代码示例来源:origin: org.alfresco/alfresco-repository

String processInstanceId = execution.getProcessInstanceId();
ArrayList<WorkflowTask> resultList = new ArrayList<WorkflowTask>();
if(!activitiUtil.isMultiTenantWorkflowDeploymentEnabled() && false == typeConverter.isCorrectTenantRuntime(processInstanceId))

代码示例来源:origin: org.finra.herd/herd-service

@Override
public Job signalJob(JobSignalRequest request) throws Exception
{
  // Perform the validation.
  validateJobSignalRequest(request);
  Execution execution = activitiService.getExecutionByProcessInstanceIdAndActivitiId(request.getId(), request.getReceiveTaskId());
  if (execution == null)
  {
    throw new ObjectNotFoundException(
      String.format("No job found for matching job id: \"%s\" and receive task id: \"%s\".", request.getId(), request.getReceiveTaskId()));
  }
  String processDefinitionKey = activitiService.getProcessInstanceById(execution.getProcessInstanceId()).getProcessDefinitionKey();
  checkPermissions(processDefinitionKey, new NamespacePermissionEnum[] {NamespacePermissionEnum.EXECUTE});
  // Retrieve the job before signaling.
  Job job = getJob(request.getId(), false, false);
  // Build the parameters map
  Map<String, Object> signalParameters = getParameters(request);
  // Signal the workflow.
  activitiService.signal(execution.getId(), signalParameters);
  // Build the parameters map merged with job and signal parameters.
  Map<String, Object> mergedParameters = new HashMap<>();
  for (Parameter jobParam : job.getParameters())
  {
    mergedParameters.put(jobParam.getName(), jobParam.getValue());
  }
  mergedParameters.putAll(signalParameters);
  // Update the parameters in job
  populateWorkflowParameters(job, mergedParameters);
  return job;
}

代码示例来源:origin: FINRAOS/herd

@Override
public Job signalJob(JobSignalRequest request) throws Exception
{
  // Perform the validation.
  validateJobSignalRequest(request);
  Execution execution = activitiService.getExecutionByProcessInstanceIdAndActivitiId(request.getId(), request.getReceiveTaskId());
  if (execution == null)
  {
    throw new ObjectNotFoundException(
      String.format("No job found for matching job id: \"%s\" and receive task id: \"%s\".", request.getId(), request.getReceiveTaskId()));
  }
  String processDefinitionKey = activitiService.getProcessInstanceById(execution.getProcessInstanceId()).getProcessDefinitionKey();
  checkPermissions(processDefinitionKey, new NamespacePermissionEnum[] {NamespacePermissionEnum.EXECUTE});
  // Retrieve the job before signaling.
  Job job = getJob(request.getId(), false, false);
  // Build the parameters map
  Map<String, Object> signalParameters = getParameters(request);
  // Signal the workflow.
  activitiService.signal(execution.getId(), signalParameters);
  // Build the parameters map merged with job and signal parameters.
  Map<String, Object> mergedParameters = new HashMap<>();
  for (Parameter jobParam : job.getParameters())
  {
    mergedParameters.put(jobParam.getName(), jobParam.getValue());
  }
  mergedParameters.putAll(signalParameters);
  // Update the parameters in job
  populateWorkflowParameters(job, mergedParameters);
  return job;
}

代码示例来源:origin: Alfresco/alfresco-repository

String processInstanceId = execution.getProcessInstanceId();
ArrayList<WorkflowTask> resultList = new ArrayList<WorkflowTask>();
if(!activitiUtil.isMultiTenantWorkflowDeploymentEnabled() && false == typeConverter.isCorrectTenantRuntime(processInstanceId))

代码示例来源:origin: org.activiti/activiti-rest

public ExecutionResponse createExecutionResponse(Execution execution, RestUrlBuilder urlBuilder) {
 ExecutionResponse result = new ExecutionResponse();
 result.setActivityId(execution.getActivityId());
 result.setId(execution.getId());
 result.setUrl(urlBuilder.buildUrl(RestUrls.URL_EXECUTION, execution.getId()));
 result.setSuspended(execution.isSuspended());
 result.setTenantId(execution.getTenantId());
 result.setParentId(execution.getParentId());
 if (execution.getParentId() != null) {
  result.setParentUrl(urlBuilder.buildUrl(RestUrls.URL_EXECUTION, execution.getParentId()));
 }
 
 result.setSuperExecutionId(execution.getSuperExecutionId());
 if (execution.getSuperExecutionId() != null) {
  result.setSuperExecutionUrl(urlBuilder.buildUrl(RestUrls.URL_EXECUTION, execution.getSuperExecutionId()));
 }
 result.setProcessInstanceId(execution.getProcessInstanceId());
 if (execution.getProcessInstanceId() != null) {
  result.setProcessInstanceUrl(urlBuilder.buildUrl(RestUrls.URL_PROCESS_INSTANCE, execution.getProcessInstanceId()));
 }
 return result;
}

相关文章