Package org.jbpm.job

Examples of org.jbpm.job.Job


          Collection acquiredJobs = acquireJobs();

          if (! acquiredJobs.isEmpty()) {
            Iterator iter = acquiredJobs.iterator();
            while (iter.hasNext() && isActive) {
              Job job = (Job) iter.next();
              executeJob(job);
            }

          } else { // no jobs acquired
            if (isActive) {
View Full Code Here


      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);
            }
           
            Iterator iter = jobsToLock.iterator();
            while (iter.hasNext()) {
              job = (Job) iter.next();
              job.setLockOwner(getName());
              job.setLockTime(new Date());
              // jbpmContext.getSession().update(job);
            }

            // HACKY HACK : this is a workaround for a hibernate problem that is fixed in hibernate 3.2.1
            if (job instanceof Timer) {
View Full Code Here

    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 {
      jbpmContext.close();
    }
    return nextDueDate;
View Full Code Here

TOP

Related Classes of org.jbpm.job.Job

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.