1 package org.jbpm.scheduler.def; 2 3 import org.dom4j.Element; 4 import org.jbpm.graph.def.Action; 5 import org.jbpm.graph.exe.ExecutionContext; 6 import org.jbpm.jpdl.xml.JpdlXmlReader; 7 8 public class CancelTimerAction extends Action { 9 10 private static final long serialVersionUID = 1L; 11 12 String timerName = null; 13 14 public void read(Element actionElement, JpdlXmlReader jpdlReader) { 15 timerName = actionElement.attributeValue("name"); 16 if (timerName==null) { 17 jpdlReader.addWarning("no 'name' specified in CancelTimerAction '"+actionElement.asXML()+"'"); 18 } 19 } 20 21 public void execute(ExecutionContext executionContext) throws Exception { 22 executionContext.getSchedulerInstance().cancel(timerName, executionContext.getToken()); 23 } 24 25 public String getTimerName() { 26 return timerName; 27 } 28 public void setTimerName(String timerName) { 29 this.timerName = timerName; 30 } 31 } 32 | Popular Tags |