Examples of OSwitch


Examples of org.apache.ode.bpel.o.OSwitch

  public SWITCH(ActivityInfo self, ScopeFrame scopeFrame, LinkFrame linkFrame) {
    super(self, scopeFrame, linkFrame);
  }

  public final void run() {
    OSwitch oswitch = (OSwitch)_self.o;
    OSwitch.OCase matchedOCase = null;
    FaultData faultData = null;
   
    EvaluationContext evalCtx = getEvaluationContext();
    for (Iterator i = oswitch.getCases().iterator(); i.hasNext();) {
      OSwitch.OCase ocase = (OSwitch.OCase) i.next();
      try{
        if(getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(ocase.expression, evalCtx)){
          matchedOCase = ocase;
          break;
        }
      } catch (EvaluationException e) {
        String msg = "Unexpected evaluation exception.";
        __log.error(msg,e);
        // TODO: Better location information.
        throw new InvalidProcessException(msg,e);
      }catch(FaultException e){
        __log.error(e.getMessage(),e);
        faultData = createFault(e.getQName(), ocase);
        _self.parent.completed(faultData, CompensationHandler.emptySet());

        // Dead path all the child activiites:
        for (Iterator<OSwitch.OCase> j = oswitch.getCases().iterator(); j.hasNext(); )
          dpe(j.next().activity);
        return;
      }
    }

    // Dead path cases not chosen
    for (Iterator<OSwitch.OCase> i = oswitch.getCases().iterator(); i.hasNext(); ) {
      OSwitch.OCase cs = i.next();
      if (cs != matchedOCase)
        dpe(cs.activity);
    }
View Full Code Here

Examples of org.apache.ode.bpel.o.OSwitch

  public SWITCH(ActivityInfo self, ScopeFrame scopeFrame, LinkFrame linkFrame) {
    super(self, scopeFrame, linkFrame);
  }

  public final void run() {
    OSwitch oswitch = (OSwitch)_self.o;
    OSwitch.OCase matchedOCase = null;
    FaultData faultData = null;

    EvaluationContext evalCtx = getEvaluationContext();
    for (Iterator i = oswitch.getCases().iterator(); i.hasNext();) {
      OSwitch.OCase ocase = (OSwitch.OCase) i.next();
      try{
          try {
            if(getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(ocase.expression, evalCtx)){
              matchedOCase = ocase;
              break;
            }
          } catch (EvaluationException e) {
              __log.error("Sub-Language execution failure evaluating " + ocase.expression, e);
            throw new FaultException(oswitch.getOwner().constants.qnSubLanguageExecutionFault, e.getMessage());
          }
      }catch(FaultException e){
        __log.error(e.getMessage(),e);
        faultData = createFault(e.getQName(), ocase);
        _self.parent.completed(faultData, CompensationHandler.emptySet());

        // Dead path all the child activiites:
        for (Iterator<OSwitch.OCase> j = oswitch.getCases().iterator(); j.hasNext(); )
          dpe(j.next().activity);
        return;
      }
    }

    // Dead path cases not chosen
    for (Iterator<OSwitch.OCase> i = oswitch.getCases().iterator(); i.hasNext(); ) {
      OSwitch.OCase cs = i.next();
      if (cs != matchedOCase)
        dpe(cs.activity);
    }
View Full Code Here

Examples of org.apache.ode.bpel.o.OSwitch

*/
class IfGenerator extends DefaultActivityGenerator {
    private static final IfGeneratorMessages __cmsgs = MessageBundle.getMessages(IfGeneratorMessages.class);

    public OActivity newInstance(Activity src) {
        return new OSwitch(_context.getOProcess(), _context.getCurrent());
    }
View Full Code Here

Examples of org.apache.ode.bpel.o.OSwitch

    public OActivity newInstance(Activity src) {
        return new OSwitch(_context.getOProcess(), _context.getCurrent());
    }

    public void compile(OActivity output, Activity src) {
        OSwitch oswitch = (OSwitch) output;
        IfActivity switchDef = (IfActivity)src;

        if (switchDef.getCondition() == null)
            throw new CompilationException(__cmsgs.errIfWithNoCondition());

        boolean first = true;
        if (switchDef.getActivity() != null) {
            OSwitch.OCase ocase = new OSwitch.OCase(_context.getOProcess());
            ocase.activity = _context.compile(switchDef.getActivity());
            ocase.expression = _context.compileExpr(switchDef.getCondition());
            oswitch.addCase(ocase);
            first = false;
        }

        for (IfActivity.Case ccase : switchDef.getCases()) {
            OSwitch.OCase ocase = new OSwitch.OCase(_context.getOProcess());
            ocase.activity = _context.compile(ccase.getActivity());
            ocase.expression = first ? _context.compileExpr(switchDef.getCondition())
                    : (ccase.getCondition() == null ? _context.constantExpr(true) : _context.compileExpr(ccase.getCondition()));
            oswitch.addCase(ocase);
            first = false;
        }
    }
View Full Code Here

Examples of org.apache.ode.bpel.o.OSwitch

* @author Maciej Szefler - m s z e f l e r @ g m a i l . c o m
*
*/
public class SwitchGenerator extends DefaultActivityGenerator {
  public OActivity newInstance(Activity src) {
        return new OSwitch(_context.getOProcess(), _context.getCurrent());
  }
View Full Code Here

Examples of org.apache.ode.bpel.o.OSwitch

  public OActivity newInstance(Activity src) {
        return new OSwitch(_context.getOProcess(), _context.getCurrent());
  }

  public void compile(OActivity output, Activity src) {
    OSwitch oswitch = (OSwitch) output;
    SwitchActivity switchDef = (SwitchActivity)src;

    for (SwitchActivity.Case ccase : switchDef.getCases()) {
      OSwitch.OCase ocase = new OSwitch.OCase(_context.getOProcess());
      ocase.activity = _context.compile(ccase.getActivity());
      ocase.expression = (ccase.getCondition() == null ? _context.constantExpr(true) : _context.compileExpr(ccase.getCondition()));
      oswitch.addCase(ocase);
    }
  }
View Full Code Here

Examples of org.apache.ode.bpel.o.OSwitch

  public SWITCH(ActivityInfo self, ScopeFrame scopeFrame, LinkFrame linkFrame) {
    super(self, scopeFrame, linkFrame);
  }

  public final void run() {
    OSwitch oswitch = (OSwitch)_self.o;
    OSwitch.OCase matchedOCase = null;
    FaultData faultData = null;
   
    EvaluationContext evalCtx = getEvaluationContext();
    for (Iterator i = oswitch.getCases().iterator(); i.hasNext();) {
      OSwitch.OCase ocase = (OSwitch.OCase) i.next();
      try{
        try {
          if(getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(ocase.expression, evalCtx)){
            matchedOCase = ocase;
            break;
          }
        } catch (EvaluationException e) {
          __log.error("Sub-Language execution failure evaluating " + ocase.expression, e);
          throw new FaultException(oswitch.getOwner().constants.qnSubLanguageExecutionFault, e.getMessage());
        }
      }catch(FaultException e){
        __log.error(e.getMessage(),e);
        faultData = createFault(e.getQName(), ocase);
        _self.parent.completed(faultData, CompensationHandler.emptySet());

        // Dead path all the child activiites:
        for (Iterator<OSwitch.OCase> j = oswitch.getCases().iterator(); j.hasNext(); )
          dpe(j.next().activity);
        return;
      }
    }

    // Dead path cases not chosen
    for (Iterator<OSwitch.OCase> i = oswitch.getCases().iterator(); i.hasNext(); ) {
      OSwitch.OCase cs = i.next();
      if (cs != matchedOCase)
        dpe(cs.activity);
    }
View Full Code Here

Examples of org.apache.ode.bpel.rtrep.v1.OSwitch

*/
class IfGenerator extends DefaultActivityGenerator {
    private static final IfGeneratorMessages __cmsgs = MessageBundle.getMessages(IfGeneratorMessages.class);

    public OActivity newInstance(Activity src) {
        return new OSwitch(_context.getOProcess(), _context.getCurrent());
    }
View Full Code Here

Examples of org.apache.ode.bpel.rtrep.v1.OSwitch

    public OActivity newInstance(Activity src) {
        return new OSwitch(_context.getOProcess(), _context.getCurrent());
    }

    public void compile(OActivity output, Activity src) {
        OSwitch oswitch = (OSwitch) output;
        IfActivity switchDef = (IfActivity)src;

        if (switchDef.getCondition() == null)
            throw new CompilationException(__cmsgs.errIfWithNoCondition());

        boolean first = true;
        if (switchDef.getActivity() != null) {
            OSwitch.OCase ocase = new OSwitch.OCase(_context.getOProcess());
            ocase.activity = _context.compile(switchDef.getActivity());
            ocase.expression = _context.compileExpr(switchDef.getCondition());
            oswitch.addCase(ocase);
            first = false;
        }

        for (IfActivity.Case ccase : switchDef.getCases()) {
            OSwitch.OCase ocase = new OSwitch.OCase(_context.getOProcess());
            ocase.activity = _context.compile(ccase.getActivity());
            ocase.expression = first ? _context.compileExpr(switchDef.getCondition())
                    : (ccase.getCondition() == null ? _context.constantExpr(true) : _context.compileExpr(ccase.getCondition()));
            oswitch.addCase(ocase);
            first = false;
        }
    }
View Full Code Here

Examples of org.apache.ode.bpel.rtrep.v1.OSwitch

* @author Maciej Szefler - m s z e f l e r @ g m a i l . c o m
*
*/
public class SwitchGenerator extends DefaultActivityGenerator {
  public OActivity newInstance(Activity src) {
        return new OSwitch(_context.getOProcess(), _context.getCurrent());
  }
View Full Code Here
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.