Get Package
@param processInstanceId
@return
192714
private static Package getPackage(Long processInstanceId) {
        try {
            EventServices eventManager = ServiceLocator.getEventServices();
            Process process = eventManager.findProcessByProcessInstanceId(processInstanceId);
            Package packageVO = PackageCache.getProcessPackage(process.getId());
            return packageVO;
        }
        catch (Exception ex) {
            return null;
        }
    }
697876
func (s *storageRESTServer) GetInstanceID(w http.ResponseWriter, r *http.Request) {
	if err := storageServerRequestValidate(r); err != nil {
		s.writeErrorResponse(w, err)
		return
	}
	w.Header().Set("Content-Length", strconv.Itoa(len(s.instanceID)))
	w.Write([]byte(s.instanceID))
	w.(http.Flusher).Flush()
}
12682
public static final void assertProcessEnded(final String processInstanceId) {
        Validate.notNull(processInstanceId);

        apiCallback.debug(LogMessage.PROCESS_5, processInstanceId);
        try {
            getProcessInstanceAssertable().processIsEnded(processInstanceId);
        } catch (final AssertionError ae) {
            apiCallback.fail(ae, LogMessage.ERROR_PROCESS_2, processInstanceId);
        }
    }
392317
public static String getProcess(Long channelId, Long pipelineId, String processNode) {
        // 根据channelId , pipelineId构造path
        return MessageFormat.format(ArbitrateConstants.NODE_PROCESS_FORMAT,
            String.valueOf(channelId),
            String.valueOf(pipelineId),
            processNode);
    }
174340
@Override
    public List<NodeInstanceLog> findNodeInstances(long processInstanceId, String nodeId) {
        EntityManager em = getEntityManager();
        Query query = em
            .createQuery("FROM NodeInstanceLog n WHERE n.processInstanceId = :processInstanceId AND n.nodeId = :nodeId ORDER BY date,id")
                .setParameter("processInstanceId", processInstanceId)
                .setParameter("nodeId", nodeId);
        return executeQuery(query, em, NodeInstanceLog.class);
    }
924875
@Override
	public TaskBase getCurrentTask(ProcessInstance processInstance) {
		if (processInstance == null) {
			throw new NullPointerException("processInstance was null");
		}
		return getTask(processInstance.getProcessDefinitionName(),processInstance.getTaskId());
	}
570651
public ServiceInstanceEntity get(final String serviceId)
	{
		try
		{
			return serviceCache.get(serviceId, () -> dao.getById(serviceId));
		}
		catch (Exception e)
		{
			throw new RuntimeException("Error loading service: " + serviceId, e);
		}
	}
1186992
@Transactional
	public ProcessInstance launch(String processName, Object context, String comment,
			String bundleName, ProcessInstance processInstance) {
		ProcessDefinition processDefinition = getProcessDefinition(processName);
		if (processDefinition == null) {
			throw new WorkflowException("Failed to find process definition named "+processName);
		}
		Object mergedContext = getContextDAO().mergeContext(context);
		processInstance.setComment(comment==null?" ":comment);
		processInstance.setBundleName(bundleName);
		processInstance.setObjectInstance(getContextDAO().createContextDescriptor(mergedContext));
		if (!ContextUtils.getContextClass(processInstance.getObjectInstance()).equals(mergedContext.getClass())) {
			throw new WorkflowException("Context object does not match process context in "+processName);
		}
		processDefinition.startProcess(processInstance);

		ProcessInstance processInstanceRet = getWorkflowDAO().mergeProcessInstance(processInstance);
		getWorkflowDAO().flush();
		return processInstanceRet;
	}
141344
protected String getIdForNewProcessDefinition(ProcessDefinitionEntity processDefinition) {
        String nextId = idGenerator.getNextId();

        String result = processDefinition.getKey() + ":" + processDefinition.getVersion() + ":" + nextId; // ACT-505
        // ACT-115: maximum id length is 64 characters
        if (result.length() > 64) {
            result = nextId;
        }

        return result;
    }
1201762
def process_get(self, pid):
        
        if not isinstance(pid, baseinteger):
            raise TypeError("pid can only be an instance of type baseinteger")
        guest_process = self._call("processGet",
                     in_p=[pid])
        guest_process = IGuestProcess(guest_process)
        return guest_process
780767
async function fetch(
  serviceInstance,
  { baseUrl, packageName, includePrereleases = false }
) {
  const json = await serviceInstance._requestJson({
    schema,
    url: await searchQueryServiceUrl(baseUrl),
    options: {
      qs: {
        q: `packageid:${encodeURIComponent(packageName.toLowerCase())}`,
        // Include prerelease versions.
        prerelease: 'true',
        // Include packages with SemVer 2 version numbers.
        semVerLevel: '2',
      },
    },
  })

  if (json.data.length === 1) {
    return json.data[0]
  } else {
    throw new NotFound({ prettyMessage: 'package not found' })
  }
}
655512
public static Package getTaskTemplatePackage(Long taskId) {
        try {
            for (Package pkg : getPackageList()) {
              if (pkg.containsTaskTemplate(taskId))
                  return pkg;
            }
            return Package.getDefaultPackage();
        }
        catch (CachingException ex) {
            logger.severeException(ex.getMessage(), ex);
            return null;
        }
    }
1085513
@Override
    public Publisher<List<ServiceInstance>> getInstances(String serviceId) {
        if (serviceId == null) {
            serviceId = getRoute53ClientDiscoveryConfiguration().getAwsServiceId();  // we can default to the config file
        }
        ListInstancesRequest instancesRequest = new ListInstancesRequest().withServiceId(serviceId);
        Future<ListInstancesResult> instanceResult = getDiscoveryClient().listInstancesAsync(instancesRequest);
        Flowable<ListInstancesResult> observableInstanceResult = Flowable.fromFuture(instanceResult);
        return observableInstanceResult.flatMap(this::convertInstancesResulttoServiceInstances);
    }
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;
    }
1101762
public static com.liferay.commerce.product.model.CPInstance fetchCPInstanceByUuidAndGroupId(
		String uuid, long groupId) {
		return getService().fetchCPInstanceByUuidAndGroupId(uuid, groupId);
	}
16942
def _get_instance(project_id, instance_zone, name, service):
    '''
    
    '''
    return service.instances().get(project=project_id,
                                   zone=instance_zone,
                                   instance=name).execute()
393613
@Override
    public ProcessInstanceLog findProcessInstance(long processInstanceId) {
        EntityManager em = getEntityManager();
        Object newTx = joinTransaction(em);
        try {
        	return (ProcessInstanceLog) em
        	        .createQuery("FROM ProcessInstanceLog p WHERE p.processInstanceId = :processInstanceId")
        	        .setParameter("processInstanceId", processInstanceId).getSingleResult();
        } catch (NoResultException e) {
        	return null;
        } finally {
        	closeEntityManager(em, newTx);
        }
    }