returns the process VO identified by the passed in work id
It is also possible the sub process is referencing self.
@param id
967270
public Process getSubProcessVO(Long id) {
        if (this.getId() != null && this.getId().equals(id)) // Id field is null for instance definitions
            return this;
        if (this.subprocesses == null)
            return null;
        for (Process ret : subprocesses) {
            if (ret.getId().equals(id))
                return ret;
        }
        return null;
    }
791384
public Transition getTransition(Long id) {
        for (Transition transition : getTransitions()) {
            if (transition.getId().equals(id))
                return transition;
        }
        return null; // not found
    }
1243486
public long getPID() {
		long currentPID = cachedPID.get();
		if (currentPID != 0) {
			return currentPID;
		}
		try {
			currentPID = detectPID();
		} catch (Throwable cause) {
			logger.info("Unable to detect process ID!", cause);
		}
		if (currentPID == 0) {
			currentPID = System.nanoTime();
			if (!cachedPID.compareAndSet(0, currentPID)) {
				currentPID = cachedPID.get();
			}
		} else {
			cachedPID.set(currentPID);
		}
		return currentPID;
	}
1204642
@Nullable
    public final PrintJobStatusExtImpl get(final String id) {
        final PrintJobStatusExtImpl result = get(id, false);
        if (result != null) {
            getSession().evict(result);
        }
        return result;
    }
848861
private int processId(final java.lang.Process process) {
    int processId = 0;
    try {
      final Field f = process.getClass().getDeclaredField("pid");
      f.setAccessible(true);

      processId = f.getInt(process);
    } catch (final Throwable e) {
      e.printStackTrace();
    }

    return processId;
  }
859543
private ArrayList<ProcessInstance> getProcessInstances(Long process_id) {
        String getProInstances = "select * from PROCESS_INSTANCE where process_id=? and END_DT is null and (status_cd=7 or status_cd=2)"; // Workstatus 2,7

        DatabaseAccess db = new DatabaseAccess(null);
        final ArrayList<ProcessInstance> processVoList = new ArrayList<ProcessInstance>();
        try {
            db.openConnection();
            Object[] args = new Object[1];
            args[0] = process_id;

            ResultSet rs = db.runSelect(getProInstances, args);
            while (rs.next()) {
                ProcessInstance processInstVO = new ProcessInstance();
                processInstVO.setId(rs.getLong(1));
                processInstVO.setProcessId(rs.getLong(2));
                processInstVO.setStartDate(StringHelper.dateToString(rs.getTimestamp(8)));
                processInstVO.setOwnerId(rs.getLong(4));
                processInstVO.setMasterRequestId(rs.getString(15));
                processInstVO.setActivities(getProcessInstanceActivity(rs.getLong(1)));
                processVoList.add(processInstVO);
            }
        }
        catch (SQLException ex) {
            logger.severeException(ex.getMessage(), ex);
        }
        finally {
            db.closeConnection();
        }

        return processVoList;
    }
914021
public static DataSourceBackendId getInstance(String id) {
        DataSourceBackendId result = cache.get(id);
        if (result == null) {
            id = id.intern();
            result = new DataSourceBackendId(id);
            cache.put(id, result);
        }
        return result;
    }
1018415
public FlowElement getCurrentFlowElement() {
    if (currentFlowElement == null) {
      String processDefinitionId = getProcessDefinitionId();
      if (processDefinitionId != null) {
        org.activiti.bpmn.model.Process process = ProcessDefinitionUtil.getProcess(processDefinitionId);
        currentFlowElement = process.getFlowElement(getCurrentActivityId(), true);
      }
    }
    return currentFlowElement;
  }
715978
@Service
    public String requeueSweep(String workflowId) {
        boolean pushed = queueDAO.pushIfNotExists(WorkflowExecutor.DECIDER_QUEUE, workflowId, config.getSweepFrequency());
        return pushed + "." + workflowId;
    }
756693
def get_process_by_id(self, process_id):
        
        route_values = {}
        if process_id is not None:
            route_values['processId'] = self._serialize.url('process_id', process_id, 'str')
        response = self._send(http_method='GET',
                              location_id='93878975-88c5-4e6a-8abb-7ddd77a8a7d8',
                              version='5.1-preview.1',
                              route_values=route_values)
        return self._deserialize('Process', response)
545041
public String forProcessInstance(String alias, long processInstanceId) {
        return registry.getContainerId(alias, new ByProcessInstanceIdContainerLocator(processInstanceId));
    }
796707
@JmxOperation(description = "Retrieve operation status")
    public String getStatus(int id) {
        try {
            return getOperationStatus(id).toString();
        } catch(VoldemortException e) {
            return "No operation with id " + id + " found";
        }
    }
652483
public void resumeWorkflow(String workflowId) {
        Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "workflow id cannot be blank");
        stub.resumeWorkflow(WorkflowServicePb.ResumeWorkflowRequest.newBuilder()
                .setWorkflowId(workflowId)
                .build()
        );
    }
415035
public CmsScheduledJobInfo getJob(String id) {

        Iterator<CmsScheduledJobInfo> it = m_jobs.iterator();
        while (it.hasNext()) {
            CmsScheduledJobInfo job = it.next();
            if (job.getId().equals(id)) {
                return job;
            }
        }
        // not found
        return null;
    }
5269
private Long getMinTransformedProcessId(Long loadedProcessId) {
        ProcessMonitor processMonitor = ArbitrateFactory.getInstance(getPipelineId(), ProcessMonitor.class);
        List<Long> processIds = processMonitor.getCurrentProcessIds();
        // 如果需要当前node处理当前process的load时，rpc请求一定会将对应的stage状态发到这机器上，并保存到progress中
        if (!CollectionUtils.isEmpty(processIds) && !CollectionUtils.isEmpty(progress)) {
            // 上一次load成功的在当前的processId中不存在，可能有两种情况:
            // 1. zk还未将数据通知过来，当前current processIds还是为老版本的值
            // 2. processId已经被删除，比如好久没有数据同步了，定时触发时发觉列表一直为空
            // if (loadedProcessId != null && !processIds.contains(loadedProcessId)) {
            // // 强制刷新一次，不过也可能是刷到老版本的值，杭州leader还没同步到美国
            // processIds = processMonitor.getCurrentProcessIds(true);
            // }

            Long result = null;
            // 做的一个优化，如果上一个processId load成功是在本机，直接忽略
            // 因为存在一个问题：比如两个process，都先完成了T模块，然后逐个触发L模块，此时第二个process需要等zookeeper回调watcher时才会被触发
            for (Long processId : processIds) {
                if (loadedProcessId == null || processId > loadedProcessId) {
                    result = processId;
                    break;
                }
            }

            // 如果不存在符合>loadedProcessId的记录，直接假设下一个processId就是上一个id+1
            // 因为processId目前的机制永远只会递增
            if (result == null) {
                result = loadedProcessId + 1;
            }

            if (result != null) {
                StageProgress stage = progress.get(result);
                if (stage != null && stage.getStage().isTransform()) {
                    return result;
                } else {
                    logger.info("rpc compute [{}] but stage [{}]", result, stage == null ? null : stage.getStage());
                    return null;
                }
            }
        }

        return null;
    }
744564
public String getProcessInstanceId() {
    Execution execution = associationManager.getExecution();
    return execution != null ? execution.getProcessInstanceId() : null;
  }
1275565
@Override
	public TaskBase getTask(String processDefinitionName, Long taskid) {
		ProcessDefinition pd = getProcessDefinition(processDefinitionName);
		if (pd == null) {
			throw new WorkflowException("Could not find active process for "+processDefinitionName);
		}
		TaskBase task = getTask(pd,taskid);
		if (task == null) {
			throw new WorkflowException("Could not find task for "+processDefinitionName+":"+taskid);
		}
		return task;
	}