Manually set the parent process. Use with care!

        @type  process: L{Process}
        @param process: (Optional) Process object. Use C{None} for no process.
511314
def set_process(self, process = None):
        
        if process is None:
            self.__process = None
        else:
            global Process      # delayed import
            if Process is None:
                from winappdbg.process import Process
            if not isinstance(process, Process):
                msg  = "Parent process must be a Process instance, "
                msg += "got %s instead" % type(process)
                raise TypeError(msg)
            self.__process = process
859590
public function initChildProcess(Process $process)
    {
        if (!empty($this->name)) {
            swoole_set_process_name($this->name);
        }

        return call_user_func([$this, 'childProcess'], $process);
    }
730962
def init_process(self) -> None:
        
        default_loop = asyncio.get_event_loop()
        if default_loop.is_running():
            default_loop.close()
            self.loop = asyncio.new_event_loop()
            asyncio.set_event_loop(self.loop)
        else:
            self.loop = default_loop
        super().init_process()
1159642
public KProcess newProcess(Object context) {
		KProcess process = new KProcess(this, context);
		this.init(process);
		return process;
	}
987673
function process(parent, index, commands) {
    var cmd = commands[index],
        ret;

    switch (cmd.value[0].type) {
        case ConkittyTypes.TEMPLATE_NAME:
            ret = processCall(parent, false, cmd);
            break;

        case ConkittyTypes.COMMAND_NAME:
            switch (cmd.value[0].value) {
                case 'ATTR':
                    ret = processAttr(parent, true, cmd);
                    break;

                case 'CALL':
                    ret = processCall(parent, true, cmd, commands[index + 1]);
                    break;

                case 'CHOOSE':
                    ret = processChoose(parent, cmd);
                    break;

                case 'EACH':
                    ret = processEach(parent, cmd, commands[index + 1]);
                    break;

                case 'EXPOSE':
                    ret = processExpose(parent, cmd);
                    break;

                case 'JS':
                    ret = processJS(parent, cmd);
                    break;

                case 'MEM':
                    ret = processMem(parent, cmd);
                    break;

                case 'PAYLOAD':
                    ret = processPayload(parent, cmd);
                    break;

                case 'SET':
                    ret = processSet(parent, cmd);
                    break;

                case 'TEST':
                    ret = processTest(parent, cmd);
                    break;

                case 'TRIGGER':
                    ret = processTrigger(parent, cmd);
                    break;

                case 'WITH':
                    ret = processWith(parent, cmd, commands[index + 1]);
                    break;

                default:
                    throw new ConkittyErrors.InconsistentCommand(cmd.value[0]);
            }

            break;

        case ConkittyTypes.VARIABLE:
            ret = processVariable(parent, cmd);
            break;

        case ConkittyTypes.JAVASCRIPT:
            ret = processJavascript(parent, cmd);
            break;

        case ConkittyTypes.STRING:
            ret = processString(parent, cmd);
            break;

        case ConkittyTypes.CSS:
            ret = processElement(parent, cmd);
            break;

        case ConkittyTypes.ATTR:
            ret = processAttr(parent, false, cmd);
            break;

        case ConkittyTypes.INCLUDE:
            ret = processInclude(parent, cmd);
            break;

        case ConkittyTypes.NODE_APPENDER:
            ret = processAppender(parent, cmd);
            break;

        default:
            throw new ConkittyErrors.InconsistentCommand(cmd.value[0]);
    }

    return index + ret;
}
567628
ProcessInstance createProcessInstance(Long processId, String ownerType,
            Long ownerId, String secondaryOwnerType, Long secondaryOwnerId,
            String masterRequestId, Map<String,String> parameters, String label, String template)
    throws ProcessException, DataAccessException
    {
        ProcessInstance pi = null;
        try {
            Process processVO;
            if (OwnerType.MAIN_PROCESS_INSTANCE.equals(ownerType)) {
                ProcessInstance parentPi = getDataAccess().getProcessInstance(ownerId);
                Process parentProcdef = ProcessCache.getProcess(parentPi.getProcessId());
                processVO = parentProcdef.getSubProcessVO(processId);
                pi = new ProcessInstance(parentPi.getProcessId(), processVO.getName());
                String comment = processId.toString();
                if (parentPi.getProcessInstDefId() > 0L)  // Indicates instance definition
                    comment += "|HasInstanceDef|" + parentPi.getProcessInstDefId();
                pi.setComment(comment);
            } else {
                if (uniqueMasterRequestId && !(OwnerType.PROCESS_INSTANCE.equals(ownerType) || OwnerType.ERROR.equals(ownerType))) {
                    // Check for uniqueness of master request id before creating top level process instance, if enabled
                    List<ProcessInstance> list = edao.getProcessInstancesByMasterRequestId(masterRequestId);
                    if (list != null && list.size() > 0) {
                        String msg = "Could not launch process instance for " + (label != null ? label : template) + " because Master Request ID " + masterRequestId + " is not unique";
                        logger.error(msg);
                        throw new ProcessException(msg);
                    }
                }
                processVO = ProcessCache.getProcess(processId);
                pi = new ProcessInstance(processId, processVO.getName());
            }
            pi.setOwner(ownerType);
            pi.setOwnerId(ownerId);
            pi.setSecondaryOwner(secondaryOwnerType);
            pi.setSecondaryOwnerId(secondaryOwnerId);
            pi.setMasterRequestId(masterRequestId);
            pi.setStatusCode(WorkStatus.STATUS_PENDING_PROCESS);
            if (label != null)
                pi.setComment(label);
            if (template != null)
                pi.setTemplate(template);
            edao.createProcessInstance(pi);
            createVariableInstancesFromEventMessage(pi, parameters);
        } catch (SQLException e) {
            if (pi != null && pi.getId() != null && pi.getId() > 0L)
                try {
                    edao.setProcessInstanceStatus(pi.getId(), WorkStatus.STATUS_FAILED);
                } catch (SQLException ex) { logger.severeException("Exception while updating process status to 'Failed'", ex);}
            throw new DataAccessException(-1, e.getMessage(), e);
        }
        return pi;
    }
1044905
public void setProcessParentPid(java.util.Collection<NumberFilter> processParentPid) {
        if (processParentPid == null) {
            this.processParentPid = null;
            return;
        }

        this.processParentPid = new java.util.ArrayList<NumberFilter>(processParentPid);
    }
1061125
def _create_process_thread(self):
        
        thread = threading.Thread(target=self._process_data_events)
        thread.setDaemon(True)
        thread.start()
576476
public function setProcess(\Minibus\Model\Entity\Process $process = null)
    {
        $this->process = $process;
        
        return $this;
    }
1256566
private void startProcess() throws IOException {
    LOG.info("Building process");
    ProcessBuilder processBuilder = new ProcessBuilder(command);
    processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT);
    processBuilder.redirectOutput(ProcessBuilder.Redirect.INHERIT);
 
    LOG.info("Starting process");
    process = processBuilder.start();
    LOG.info("Process started");
  }
1178830
@Reference(name = "libertyProcess", service = LibertyProcess.class, target = "(wlp.process.type=client)", cardinality = ReferenceCardinality.OPTIONAL)
    protected void setLibertyProcess(ServiceReference<LibertyProcess> sr) {
        isClientProcess = true;
    }
246219
protected function setProcessName($process)
    {

        $serverName = 'swoole_http_server';
        $appName    = $this->container->config->get('app.name', 'ThinkPHP');

        $name = sprintf('%s: %s for %s', $serverName, $process, $appName);

        swoole_set_process_name($name);
    }
735674
public void execute(org.parallelj.mirror.Process process) {

		if (!(process instanceof KProcess)) {
			return;
		}
		this.execute((KProcess) process);
	}
916840
void handleProcessFinish(InternalEvent event) throws ProcessException
    {
        try {
            String ownerType = event.getOwnerType();
            String secondaryOwnerType = event.getSecondaryOwnerType();
            if (!OwnerType.ACTIVITY_INSTANCE.equals(secondaryOwnerType)) {
                // top level processes (non-remote) or ABORT embedded processes
                ProcessInstance pi = edao.getProcessInstance(event.getWorkInstanceId());
                Process subProcVO = getProcessDefinition(pi);
                if (pi.isEmbedded()) {
                    subProcVO.getSubProcessVO(event.getWorkId());
                    String embeddedProcType = subProcVO.getAttribute(WorkAttributeConstant.EMBEDDED_PROCESS_TYPE);
                    if (ProcessVisibilityConstant.EMBEDDED_ABORT_PROCESS.equals(embeddedProcType)) {
                        Long parentProcInstId = event.getOwnerId();
                        pi = edao.getProcessInstance(parentProcInstId);
                        this.cancelProcessInstanceTree(pi);
                        if (logger.isInfoEnabled()) {
                            logger.info(logtag(pi.getProcessId(), pi.getId(), pi.getMasterRequestId()),
                                    "Process cancelled");
                        }
                        InternalEvent procFinishMsg = InternalEvent.createProcessFinishMessage(pi);
                        if (OwnerType.ACTIVITY_INSTANCE.equals(pi.getSecondaryOwner())) {
                            procFinishMsg.setSecondaryOwnerType(pi.getSecondaryOwner());
                            procFinishMsg.setSecondaryOwnerId(pi.getSecondaryOwnerId());
                        }
                        this.sendInternalEvent(procFinishMsg);
                    }
                }
            } else if (ownerType.equals(OwnerType.PROCESS_INSTANCE)
                    || ownerType.equals(OwnerType.MAIN_PROCESS_INSTANCE)
                    || ownerType.equals(OwnerType.ERROR)) {
                // local process call or call to error/correction/delay handler
                Long activityInstId = event.getSecondaryOwnerId();
                ActivityInstance actInst = edao.getActivityInstance(activityInstId);
                ProcessInstance procInst = edao.getProcessInstance(actInst.getProcessInstanceId());
                BaseActivity cntrActivity = prepareActivityForResume(event,procInst, actInst);
                if (cntrActivity!=null) {
                    resumeProcessInstanceForSecondaryOwner(event, cntrActivity);
                }    // else the process is completed/cancelled
            }
        } catch (Exception e) {
            throw new ProcessException(-1, e.getMessage(), e);
        }
    }
929794
def _add_process(self, aProcess):
        
##        if not isinstance(aProcess, Process):
##            if hasattr(aProcess, '__class__'):
##                typename = aProcess.__class__.__name__
##            else:
##                typename = str(type(aProcess))
##            msg = "Expected Process, got %s instead" % typename
##            raise TypeError(msg)
        dwProcessId = aProcess.dwProcessId
##        if dwProcessId in self.__processDict:
##            msg = "Process already exists: %d" % dwProcessId
##            raise KeyError(msg)
        self.__processDict[dwProcessId] = aProcess
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;
	}
1359051
public void setProcessPath(java.util.Collection<StringFilter> processPath) {
        if (processPath == null) {
            this.processPath = null;
            return;
        }

        this.processPath = new java.util.ArrayList<StringFilter>(processPath);
    }