⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 executetimercommand.java

📁 workflow first jbpm
💻 JAVA
字号:
package org.jbpm.scheduler.ejbtimer;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jbpm.JbpmContext;
import org.jbpm.command.Command;
import org.jbpm.job.Timer;

public class ExecuteTimerCommand implements Command {

  private static final long serialVersionUID = 1L;
  
  long timerId;

  public ExecuteTimerCommand(long timerId) {
    this.timerId = timerId;
  }

  public Object execute(JbpmContext jbpmContext) throws Exception {
    Timer timer = (Timer) jbpmContext.getJobSession().getJob(timerId);
    if (timer!=null) {
      log.debug("executing timer "+timerId);
      timer.execute(jbpmContext);
    } else {
      log.info("execution of timer "+timerId+" was skipped cause the timer was deleted from the database");
    }
    return timer;
  }

  private static Log log = LogFactory.getLog(ExecuteTimerCommand.class);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -