Package org.activiti.engine.impl.persistence.entity

Examples of org.activiti.engine.impl.persistence.entity.JobEntity


    } else {
     
      if (job.getProcessDefinitionId() != null) {
       
        // This is a hack .. need to cleanify this in the engine
        JobEntity jobEntity = (JobEntity) job;
        if (jobEntity.getJobHandlerType().equals(TimerSuspendProcessDefinitionHandler.TYPE)) {
          addLinkToProcessDefinition(layout, i18nManager.getMessage(Messages.JOB_SUSPEND_PROCESSDEFINITION), false);
        } else if (jobEntity.getJobHandlerType().equals(TimerActivateProcessDefinitionHandler.TYPE)) {
          addLinkToProcessDefinition(layout, i18nManager.getMessage(Messages.JOB_ACTIVATE_PROCESSDEFINITION), true);
        } else {
          addNotYetExecutedLabel(layout);
        }
       
View Full Code Here


  private void setRetries(final String processInstanceId, final int retries) {
    final Job job = managementService.createJobQuery().processInstanceId(processInstanceId).singleResult();
    commandExecutor.execute(new Command<Void>() {
     
      public Void execute(CommandContext commandContext) {
        JobEntity timer = commandContext.getDbSqlSession().selectById(JobEntity.class, job.getId());
        timer.setRetries(retries);
        return null;
      }
     
    });
  }
View Full Code Here

  public String execute(CommandContext commandContext) {
    if(jobId == null) {
      throw new ActivitiException("jobId is null");
    }
   
    JobEntity job = commandContext
      .getJobManager()
      .findJobById(jobId);
   
    if(job == null) {
      throw new ActivitiException("No job found with id " + jobId);
    }
   
    return job.getExceptionStacktrace();
  }
View Full Code Here

    }
   
    if (log.isLoggable(Level.FINE)) {
      log.fine("Executing job " + jobId);
    }
    JobEntity job = commandContext
      .getJobManager()
      .findJobById(jobId);
   
    if (job == null) {
      throw new JobNotFoundException(jobId);
    }
   
    JobExecutorContext jobExecutorContext = Context.getJobExecutorContext();
    if(jobExecutorContext != null) { // if null, then we are not called by the job executor    
      jobExecutorContext.setCurrentJob(job);
    }
   
    try {
      job.execute(commandContext);
    } catch (RuntimeException exception) {
      // When transaction is rolled back, decrement retries
      CommandExecutor commandExecutor = Context
        .getProcessEngineConfiguration()
        .getCommandExecutorTxRequiresNew();
View Full Code Here

            this.waitBetweenRetriesInSeconds = waitBetweenRetriesInSeconds;
        }

        @Override
        public Object execute(CommandContext commandContext) {
            JobEntity job = Context.getCommandContext()
                .getJobManager()
                .findJobById(jobId);

            updateNumberOfRetries(job);

            if (exception != null) {
                job.setExceptionMessage(exception.getMessage());
                job.setExceptionStacktrace(getExceptionStacktrace());
            }

            return null;
        }
View Full Code Here

TOP

Related Classes of org.activiti.engine.impl.persistence.entity.JobEntity

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.