AnsweredAssumed Answered

MessageAddedNotification not available

Question asked by matthiasmoke on Apr 30, 2015
Latest reply on May 7, 2015 by jbarrez
Hi all,

i have implemented a CustomFailedJobCommandFactory and a NoJobRetriesCmd with Activiti-5.14 as follows:


public class CustomFailedJobCommandFactory implements FailedJobCommandFactory{

   public Command<Object> getCommand(String jobId, Throwable exception) {
       return new NoJobRetriesCmd(jobId, exception);
   }
}



public class NoJobRetriesCmd implements Command<Object> {

  protected Throwable exception;
  protected String jobId;

  public NoJobRetriesCmd(String jobId, Throwable exception) {
    this.jobId = jobId;
    this.exception = exception;
  }

  public Object execute(CommandContext commandContext) {
      JobEntity job = Context.getCommandContext().getJobEntityManager().findJobById(jobId);
      job.setRetries(0);
      job.setLockOwner(null);
    job.setLockExpirationTime(null);
   
    if(exception != null) {
      job.setExceptionMessage(exception.getMessage());
      job.setExceptionStacktrace(getExceptionStacktrace());
    }
   
    JobExecutor jobExecutor = Context.getProcessEngineConfiguration().getJobExecutor();
    MessageAddedNotification messageAddedNotification = new MessageAddedNotification(jobExecutor);
    TransactionContext transactionContext = commandContext.getTransactionContext();
    transactionContext.addTransactionListener(TransactionState.COMMITTED, messageAddedNotification);
   
    return null;
  }
 
  private String getExceptionStacktrace() {
    StringWriter stringWriter = new StringWriter();
    exception.printStackTrace(new PrintWriter(stringWriter));
    return stringWriter.toString();
  }
}


I've updated my jars to version 5.17 and Eclipse notices, that the class org.activiti.engine.impl.jobexecutor.MessageAddedNotification is not available.
Has this class been removed or renamed? How can i correct this issue?

Greetings

Matthias

Outcomes