Package org.apache.ode.bpel.rtrep.v2

Examples of org.apache.ode.bpel.rtrep.v2.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


    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

* @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

  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

    private DebugInfo createDebugInfo(BpelObject bpelObject, String description) {
        int lineNo = bpelObject == null ? -1 : bpelObject.getLineNo();
        String str = description == null && bpelObject != null ? bpelObject.toString() : null;
        Map<QName, Object> extElmt = bpelObject == null ? null : bpelObject.getExtensibilityElements();
        DebugInfo debugInfo = new DebugInfo(_processDef.getSource(), lineNo, extElmt);
        debugInfo.description = str;
        return debugInfo;
    }
View Full Code Here

    }

    protected void compileChildren(OExtensionActivity dest, CompositeActivity src) {
        for (Activity child : src.getActivities()) {
            try {
                OActivity compiledChild = _context.compile(child);
                dest.children.add(compiledChild);
            }
            catch (CompilationException ce) {
                _context.recoveredFromError(child, ce);
            }
View Full Code Here

        if (src.getActivities().size() == 0)
            throw new CompilationException(__cmsgs.errEmptySequence().setSource(src));

        for (Activity child : src.getActivities()) {
            try {
                OActivity compiledChild = _context.compile(child);
                dest.sequence.add(compiledChild);
            }
            catch (CompilationException ce) {
                _context.recoveredFromError(child, ce);
            }
View Full Code Here

    public OLink resolveLink(String linkName) {
        OLink ret = null;

        // Fist find where the link is declared.
        for (Iterator<OActivity> i = _structureStack.iterator(); i.hasNext();) {
            OActivity oact = i.next();
            if (oact instanceof OFlow)
                ret = ((OFlow) oact).getLocalLink(linkName);
            if (ret != null)
                return ret;
        }
View Full Code Here

        case YES:
            _supressJoinFailure = true;
            break;
        }

        OActivity compiled;
        try {
            compiled = (source instanceof ScopeLikeActivity) ? compileSLC((ScopeLikeActivity) source, new OScope.Variable[0])
                    : compileActivity(true, source);
            compiled.suppressJoinFailure = _supressJoinFailure;
        } finally {
View Full Code Here

        return implicitScope;
    }

    private OActivity compileActivity(final boolean doLinks, final Activity source) {
        final ActivityGenerator actgen = findActivityGen(source);
        final OActivity oact = actgen.newInstance(source);
        oact.name = createName(source, "activity");
        oact.debugInfo = createDebugInfo(source, "Activity body for " + source);
        _compiledActivities.add(oact);
        compile(oact, source, new Runnable() {
            public void run() {
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.rtrep.v2.OSwitch

Copyright © 2018 www.massapicom. 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.