public Long startProcess(Long processId, String masterRequestId, String ownerType,
            Long ownerId, Map<String,String> vars,
            String secondaryOwnerType, Long secondaryOwnerId, Map<String,String> headers) throws Exception {
        Process procdef = getProcessDefinition(processId);
        int performance_level = procdef.getPerformanceLevel();
        if (performance_level<=0) performance_level = default_performance_level_regular;
        EngineDataAccess edao = EngineDataAccessCache.getInstance(false, performance_level);
        InternalMessenger msgBroker = MessengerFactory.newInternalMessenger();
        // do not set internal messenger with cache options, as this engine does not process it directly - Unless PL 9
        if (performance_level >= 9)
            msgBroker.setCacheOption(InternalMessenger.CACHE_ONLY);
        if (masterRequestId == null)
            masterRequestId = genMasterRequestId();
        ProcessExecutor engine = new ProcessExecutor(edao, msgBroker, false);
        ProcessInstance processInst = engine.createProcessInstance(processId,
                ownerType, ownerId, secondaryOwnerType, secondaryOwnerId,
                masterRequestId, vars);
        if (ownerType.equals(OwnerType.DOCUMENT) && ownerId != 0L) {
            setOwnerDocumentProcessInstanceId(engine, ownerId, processInst.getId(), masterRequestId);
            bindRequestVariable(procdef, ownerId, engine, processInst);
        }
        if (headers != null) {
            bindRequestHeadersVariable(procdef, headers, engine, processInst);
        }
        // Delay for ensuring document document content is available for the processing thread
        // It is also needed to ensure the message is really sent, instead of cached
        int delay = PropertyManager.getIntegerProperty(PropertyNames.MDW_PROCESS_LAUNCH_DELAY, 2);
        engine.startProcessInstance(processInst, delay);
        return processInst.getId();
    }
public Long startProcess ( Long processId , String masterRequestId , String ownerType , Long ownerId , Map < String , String > vars , String secondaryOwnerType , Long secondaryOwnerId , Map < String , String > headers ) throws Exception { Process procdef = getProcessDefinition ( processId ) ; int performance_level = procdef . getPerformanceLevel ( ) ; if ( performance_level <= 0 ) performance_level = default_performance_level_regular ; EngineDataAccess edao = EngineDataAccessCache . getInstance ( false , performance_level ) ; InternalMessenger msgBroker = MessengerFactory . newInternalMessenger ( ) ; if ( performance_level >= 9 ) msgBroker . setCacheOption ( InternalMessenger . CACHE_ONLY ) ; if ( masterRequestId == null ) masterRequestId = genMasterRequestId ( ) ; ProcessExecutor engine = new ProcessExecutor ( edao , msgBroker , false ) ; ProcessInstance processInst = engine . createProcessInstance ( processId , ownerType , ownerId , secondaryOwnerType , secondaryOwnerId , masterRequestId , vars ) ; if ( ownerType . equals ( OwnerType . DOCUMENT ) && ownerId != 0L ) { setOwnerDocumentProcessInstanceId ( engine , ownerId , processInst . getId ( ) , masterRequestId ) ; bindRequestVariable ( procdef , ownerId , engine , processInst ) ; } if ( headers != null ) { bindRequestHeadersVariable ( procdef , headers , engine , processInst ) ; } int delay = PropertyManager . getIntegerProperty ( PropertyNames . MDW_PROCESS_LAUNCH_DELAY , 2 ) ; engine . startProcessInstance ( processInst , delay ) ; return processInst . getId ( ) ; }
Starting a regular process.
@param processId ID of the process to be started
@param masterRequestId
@param ownerType
@param ownerId
@param vars Input parameter bindings for the process instance to be created
@return Process instance ID