Start a process.
@param processId
@param masterRequestId
@param ownerType
@param ownerId
@param vars Input parameter bindings for the process instance to be created
@param headers
@return the process instance ID
976519
public Long startProcess(Long processId, String masterRequestId, String ownerType,
            Long ownerId, Map<String,String> vars, Map<String,String> headers) throws Exception {
        return startProcess(processId, masterRequestId, ownerType, ownerId, vars, null, null, headers);
    }
26467
@Override
    public void process(HttpServerRequest vertxRequest, ContainerRequest jerseyRequest, Handler<Void> done) {
        jerseyRequest.setProperty("custom.property", "Hello!");
        done.handle(null);
    }
71937
@Override
    public ThreadContext createDefaultThreadContext(Map<String, String> execProps) {
        String identityName = execProps.get(WSContextService.TASK_OWNER);
        SecurityContext defaultCtx = new SecurityContext() {
            private static final long serialVersionUID = 1924323423421234352L;

            @Override
            public void setupSecurityContext(CallbackHandler arg0, Subject arg1, Subject arg2) {
                // do nothing and instead use the default subjects passed in by the application server.
            }
        };
        CredentialsService credService = (CredentialsService) credServiceRef.getServiceWithException();
        WSSecurityService wss = (WSSecurityService) securityServiceRef.getServiceWithException();
        UnauthenticatedSubjectService unauthSubjService = (UnauthenticatedSubjectService) unauthSubjectServiceRef.getServiceWithException();
        AuthenticationService authService = (AuthenticationService) authServiceRef.getServiceWithException();
        return new SecurityInflowContext(credService, wss, unauthSubjService, authService, defaultCtx, identityName);
    }
372094
@Override
  public void registerProcessEngine(ProcessEngine processEngine) {
    ensureNotNull("Cannot register process engine in Jmx Runtime Container", "process engine", processEngine);

    String processEngineName = processEngine.getName();

    // build and start the service.
    JmxManagedProcessEngine managedProcessEngine = new JmxManagedProcessEngine(processEngine);
    serviceContainer.startService(ServiceTypes.PROCESS_ENGINE, processEngineName, managedProcessEngine);

  }
1100370
public static RequestContext create(String projectId, String instanceId, String appProfileId) {
    return new AutoValue_RequestContext(projectId, instanceId, appProfileId);
  }
1053585
public static InternalEvent createProcessStartMessage(
            Long processId, String parentType, Long parentId,
            String masterRequestId, Long procInstId,
            String secondaryOwnerType, Long secondaryOwnerId) {
        InternalEvent event = new InternalEvent();
        event.isProcess = true;
        event.workId = processId;
        event.eventType = EventType.START;
        event.ownerType = parentType;
        event.ownerId = parentId;
        event.masterRequestId = masterRequestId;
        event.workInstanceId = procInstId;
//        event.parameters = params;
        event.secondaryOwnerType = secondaryOwnerType;
        event.secondaryOwnerId = secondaryOwnerId;
        return event;
    }
148796
public Optional<Thread> startConsumer(final Process process) {
        Thread thread = null;
        if (consumerStream != null) {
            thread = ConsoleConsumer.start(process, consumerStream);
        }
        return Optional.ofNullable(thread);
    }
1235032
public Operation.Info create( String name , List<Variable> vars ) {
        InputN func = inputN.get(name);
        if( func == null )
            return null;
        return func.create(vars,managerTemp);
    }
1191768
@Override
    @Path("/{ownerType}/{ownerId}")
    @ApiOperation(value="Update attributes for an ownerType and ownerId", response=StatusMessage.class)
    @ApiImplicitParams({
        @ApiImplicitParam(name="Attributes", paramType="body", required=true, dataType="java.lang.Object")})
    public JSONObject put(String path, JSONObject content, Map<String,String> headers)
    throws ServiceException, JSONException {
        String ownerType = getSegment(path, 1);
        if (ownerType == null)
            throw new ServiceException(ServiceException.BAD_REQUEST, "Missing pathSegment: ownerType");
        String ownerId = getSegment(path, 2);
        if (ownerId == null)
            throw new ServiceException(ServiceException.BAD_REQUEST, "Missing pathSegment: ownerId");

        try {
            Map<String,String> attrs = JsonUtil.getMap(content);
            ServiceLocator.getWorkflowServices().updateAttributes(ownerType, Long.parseLong(ownerId), attrs);
            return null;
        }
        catch (NumberFormatException ex) {
            throw new ServiceException(ServiceException.BAD_REQUEST, "Invalid ownerId: " + ownerId);
        }
        catch (JSONException ex) {
            throw new ServiceException(ServiceException.INTERNAL_ERROR, ex.getMessage(), ex);
        }
    }
393869
protected void createDefaultAuthorizations(ProcessDefinition processDefinition) {
    if(isAuthorizationEnabled()) {
      ResourceAuthorizationProvider provider = getResourceAuthorizationProvider();
      AuthorizationEntity[] authorizations = provider.newProcessDefinition(processDefinition);
      saveDefaultAuthorizations(authorizations);
    }
  }
420110
public void setProcessPid(java.util.Collection<NumberFilter> processPid) {
        if (processPid == null) {
            this.processPid = null;
            return;
        }

        this.processPid = new java.util.ArrayList<NumberFilter>(processPid);
    }
1076364
private void startMaster() throws IOException, ConnectionFailedException {
    mMaster = AlluxioJobMasterProcess.Factory.create();

    ServerConfiguration
        .set(PropertyKey.JOB_MASTER_RPC_PORT, String.valueOf(mMaster.getRpcAddress().getPort()));
    Runnable runMaster = new Runnable() {
      @Override
      public void run() {
        try {
          mMaster.start();
        } catch (Exception e) {
          throw new RuntimeException(e + " \n Start Master Error \n" + e.getMessage(), e);
        }
      }
    };
    mMasterThread = new Thread(runMaster);
    mMasterThread.start();
  }
568826
public static snmpengineid get(nitro_service service, Long ownernode) throws Exception{
		snmpengineid obj = new snmpengineid();
		obj.set_ownernode(ownernode);
		snmpengineid response = (snmpengineid) obj.get_resource(service);
		return response;
	}
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;
	}
846889
private Runnable createProcessRunner(final BlockingQueue<FlowletProcessEntry<?>> processQueue,
                                       final List<FlowletProcessEntry<?>> processList,
                                       final ClassLoader classLoader) {
    return new Runnable() {
      @Override
      public void run() {
        Thread.currentThread().setContextClassLoader(classLoader);
        for (FlowletProcessEntry<?> entry : processList) {
          if (!handleProcessEntry(entry, processQueue)) {
            processQueue.offer(entry);
          }
        }
      }
    };
  }
1048335
protected boolean startProcessDocs(final RootDoc rootDoc) throws IOException {
        for (String[] options : rootDoc.options()) {
            parseOption(options);
        }

        // Make sure the user specified a settings directory OR that we should use the defaults.
        // Both are not allowed.
        // Neither are not allowed.
        if ( (useDefaultTemplates && isSettingsDirSet) ||
                (!useDefaultTemplates && !isSettingsDirSet)) {
            throw new RuntimeException("ERROR: must specify only ONE of: " + USE_DEFAULT_TEMPLATES_OPTION + " , " + SETTINGS_DIR_OPTION);
        }

        // Make sure we can use the directory for settings we have set:
        if (!useDefaultTemplates) {
            validateSettingsDir();
        }

        // Make sure we're in a good state to run:
        validateDocletStartingState();



        processDocs(rootDoc);
        return true;
    }
15507
protected ProcessInstance buildProcessInstance(ResultSet rs) throws SQLException {
        ProcessInstance pi = new ProcessInstance();
        pi.setMasterRequestId(rs.getString("master_request_id"));
        pi.setId(rs.getLong("process_instance_id"));
        pi.setProcessId(rs.getLong("process_id"));
        pi.setOwner(rs.getString("owner"));
        pi.setOwnerId(rs.getLong("owner_id"));
        int statusCode = rs.getInt("status_cd");
        pi.setStatus(WorkStatuses.getWorkStatuses().get(statusCode));
        pi.setStartDate(rs.getTimestamp("start_dt"));
        pi.setEndDate(rs.getTimestamp("end_dt"));
        pi.setCompletionCode(rs.getString("compcode"));
        pi.setComment(rs.getString("comments"));
        pi.setTemplate(rs.getString("template"));
        // avoid loading into ProcessCache
        if (pi.getComment() != null) {
            AssetHeader assetHeader = new AssetHeader(pi.getComment());
            pi.setProcessName(assetHeader.getName());
            pi.setProcessVersion(assetHeader.getVersion());
            pi.setPackageName(assetHeader.getPackageName());
        }
        if (pi.getTemplate() != null) {
            AssetHeader templateHeader = new AssetHeader(pi.getTemplate());
            pi.setTemplate(templateHeader.getName());
            pi.setTemplatePackage(templateHeader.getPackageName());
            pi.setTemplateVersion(templateHeader.getVersion());
        }
        return pi;
    }