faultactionhandler.java

来自「jbpm-bpel-1.1.Beta3 JBoss jBPM Starters」· Java 代码 · 共 35 行

JAVA
35
字号
package org.jbpm.bpel.graph.scope;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.jbpm.bpel.graph.exe.BpelFaultException;
import org.jbpm.bpel.graph.exe.FaultInstance;
import org.jbpm.bpel.graph.exe.ScopeInstance;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.graph.exe.Token;

/**
 * Delivers the {@linkplain FaultInstance fault} carried by a
 * {@link BpelFaultException} to the nearest enclosing scope.
 * @author Alejandro Guizar
 * @version $Revision: 1.2 $ $Date: 2007/01/22 00:24:55 $
 */
public class FaultActionHandler implements ActionHandler {

  private static final Log log = LogFactory.getLog(FaultActionHandler.class);
  private static final long serialVersionUID = 1L;

  public void execute(ExecutionContext exeContext) throws Exception {
    Token token = exeContext.getToken();

    BpelFaultException faultException = (BpelFaultException) exeContext.getException();
    FaultInstance faultInstance = faultException.getFaultInstance();

    ScopeInstance scopeInstance = Scope.getInstance(token);
    log.debug("handling fault: " + scopeInstance, faultException);

    scopeInstance.faulted(faultInstance);
  }
}

⌨️ 快捷键说明

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