mailnode.java
来自「workflow first jbpm」· Java 代码 · 共 40 行
JAVA
40 行
package org.jbpm.graph.node;
import org.dom4j.Element;
import org.jbpm.JbpmException;
import org.jbpm.graph.def.Action;
import org.jbpm.graph.def.Node;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.instantiation.Delegation;
import org.jbpm.jpdl.xml.JpdlXmlReader;
public class MailNode extends Node {
private static final long serialVersionUID = 1L;
// xml //////////////////////////////////////////////////////////////////////
public void read(Element element, JpdlXmlReader jpdlReader) {
String template = element.attributeValue("template");
String actors = element.attributeValue("actors");
String to = element.attributeValue("to");
String subject = jpdlReader.getProperty("subject", element);
String text = jpdlReader.getProperty("text", element);
Delegation delegation = jpdlReader.createMailDelegation(template, actors, to, subject, text);
this.action = new Action(delegation);
}
public void execute(ExecutionContext executionContext) {
try {
executeAction(action, executionContext);
} catch (JbpmException e) {
throw e;
} catch (Exception e) {
throw new JbpmException("couldn't send email", e);
}
leave(executionContext);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?