Package org.openbp.server.engine

Examples of org.openbp.server.engine.Engine


    TokenContext token = createToken();
    token.registerObserver(this, new String[] { EngineExceptionHandlerEvent.HANDLE_EXCEPTION });

    getProcessFacade().startToken(token, "/TestCase/RollbackLocalErrorHandlerTest.Start", null);

    Engine engine = this.getProcessServer().getEngine();
    engine.executeContext(token);
  }
View Full Code Here


          key = key.substring(KEY_RUNTIME_ATRIBUTE_PREFIX.length());
          tc.setRuntimeAttribute(key, entry.getValue());
        }
      }

      Engine engine = processServer.getEngine();

      if (ProcessJobDescriptor.START_MODE_RESUME.equals(startMode))
      {
        // Resume an existing token
        if (engine.hasActiveObservers(SchedulerEngineEvent.RESUME_JOB, tc))
        {
          ProcessJobDescriptor desc = ((QuartzProcessScheduler) processServer.getProcessScheduler()).createJobDescriptor(context.getJobDetail());
          engine.fireEngineEvent(new SchedulerEngineEvent(SchedulerEngineEvent.RESUME_JOB, tc, desc, engine));
        }
        processFacade.resumeToken(tc, positionRef, inputParamValues);
      }
      else
      {
        // Start a new token
        if (engine.hasActiveObservers(SchedulerEngineEvent.START_JOB, tc))
        {
          ProcessJobDescriptor desc = ((QuartzProcessScheduler) processServer.getProcessScheduler()).createJobDescriptor(context.getJobDetail());
          engine.fireEngineEvent(new SchedulerEngineEvent(SchedulerEngineEvent.START_JOB, tc, desc, engine));
        }
        processFacade.startToken(tc, positionRef, inputParamValues);
      }

      // Process the token immediately if desired, otherwise let the execution thread pool do this.
      if (ProcessJobDescriptor.EXECUTION_MODE_SYNCHRONOUS.equals(executionMode))
      {
        // We do not need to set the lifecycle to LifecycleState.SELECTED, it will be set to LifecycleState.RUNNING by the executeContext method
        tc = processFacade.getTokenById(tokenId);
        if (tc == null)
        {
          String msg = LogUtil.error(getClass(), "Cannot find the scheduled token context (id $0) for job $1.", tokenId, context
            .getJobDetail().getGroup()
            + context.getJobDetail().getName());
          JobExecutionException ex = new JobExecutionException(msg);
          ex.setUnscheduleAllTriggers(true);
          throw ex;
        }
        engine.executeContext(tc);
      }

      processFacade.commit();
    }
    catch (Exception e)
View Full Code Here

TOP

Related Classes of org.openbp.server.engine.Engine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.