Package org.jbpm.graph.node

Source Code of org.jbpm.graph.node.MailNode

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);
  }
 
 
}
TOP

Related Classes of org.jbpm.graph.node.MailNode

TOP
Copyright © 2018 www.massapi.com. 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.