Package org.jbpm.db

Examples of org.jbpm.db.JobSession$DeleteJobsSynchronization


    }
  }

  void resumeJobs() {
    JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
    JobSession jobSession = (jbpmContext!=null ? jbpmContext.getJobSession() : null);
    if (jobSession!=null) {
      jobSession.resumeJobs(this);
    }
  }
View Full Code Here


    Collection acquiredJobs = null;
    Collection jobsToLock = new ArrayList();
    log.debug("acquiring jobs for execution...");

      try {
        JobSession jobSession = jbpmContext.getJobSession();
        log.debug("querying for acquirable job...");
        Job job = jobSession.getFirstAcquirableJob(getName());
        if (job!=null) {
          if (job.isExclusive()) {
            log.debug("exclusive acquirable job found ("+job+"). querying for other exclusive jobs to lock them all in one tx...");
            List otherExclusiveJobs = jobSession.findExclusiveJobs(getName(), job.getProcessInstance());
            jobsToLock.addAll(otherExclusiveJobs);
            log.debug("trying to obtain a process-instance exclusive locks for '"+otherExclusiveJobs+"'");
          } else {
            log.debug("trying to obtain a lock for '"+job+"'");
            jobsToLock.add(job);
View Full Code Here

    }
    return acquiredJobs;
  }

  protected void executeJob(Job job) {
      JobSession jobSession = jbpmContext.getJobSession();
      job = jobSession.loadJob(job.getId());

      try {
        log.debug("executing job "+job);
        if (job.execute(jbpmContext)) {
          jobSession.deleteJob(job);
        }

      } catch (Exception e) {
        log.debug("exception while executing '"+job+"'", e);
        StringWriter sw = new StringWriter();
View Full Code Here

      }

  }
  protected Date getNextDueDate() {
    Date nextDueDate = null;
      JobSession jobSession = jbpmContext.getJobSession();
      Job job = jobSession.getFirstDueJob(getName(), new ArrayList());
      if (job!=null) {
        nextDueDate = job.getDueDate();
      }
    return nextDueDate;
  }
View Full Code Here

      Collection jobsToLock = new ArrayList();
      log.debug("acquiring jobs for execution...");
      JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
      try {
        try {
          JobSession jobSession = jbpmContext.getJobSession();
          log.debug("querying for acquirable job...");
          Job job = jobSession.getFirstAcquirableJob(getName());
          if (job!=null) {
            if (job.isExclusive()) {
              log.debug("exclusive acquirable job found ("+job+"). querying for other exclusive jobs to lock them all in one tx...");
              List otherExclusiveJobs = jobSession.findExclusiveJobs(getName(), job.getProcessInstance());
              jobsToLock.addAll(otherExclusiveJobs);
              log.debug("trying to obtain a process-instance exclusive locks for '"+otherExclusiveJobs+"'");
            } else {
              log.debug("trying to obtain a lock for '"+job+"'");
              jobsToLock.add(job);
View Full Code Here

  }

  protected void executeJob(Job job) {
    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {
      JobSession jobSession = jbpmContext.getJobSession();
      job = jobSession.loadJob(job.getId());

      try {
        log.debug("executing job "+job);
        if (job.execute(jbpmContext)) {
          jobSession.deleteJob(job);
        }

      } catch (Exception e) {
        log.debug("exception while executing '"+job+"'", e);
        StringWriter sw = new StringWriter();
View Full Code Here

  }
  public JobSession getJobSession() {
    if (jobSession==null) {
      Session session = getSession();
      if (session!=null) {
        jobSession = new JobSession(session);
      }
    }
    return jobSession;
  }
View Full Code Here

  }
  protected Date getNextDueDate() {
    Date nextDueDate = null;
    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {
      JobSession jobSession = jbpmContext.getJobSession();
      Collection jobIdsToIgnore = jobExecutor.getMonitoredJobIds();
      Job job = jobSession.getFirstDueJob(getName(), jobIdsToIgnore);
      if (job!=null) {
        nextDueDate = job.getDueDate();
        jobExecutor.addMonitoredJobId(getName(), job.getId());
      }
    } finally {
View Full Code Here

TOP

Related Classes of org.jbpm.db.JobSession$DeleteJobsSynchronization

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.