Package org.apache.ode.bpel.evt

Examples of org.apache.ode.bpel.evt.VariableModificationEvent


        }

        VariableInstance vinst = _scopeFrame.resolve(onMessage.variable);
        initializeVariable(vinst, msgEl);
        // Generating event
        VariableModificationEvent se = new VariableModificationEvent(vinst.declaration.name);
        se.setNewValue(msgEl);
        if (_opick.debugInfo != null)
            se.setLineNo(_opick.debugInfo.startLine);
        sendEvent(se);
    }
View Full Code Here


                            throw new RuntimeException(e);
                        }

                        initializeVariable(outputVar, response);
                        // Generating event
                        VariableModificationEvent se = new VariableModificationEvent(outputVar.declaration.name);
                        se.setNewValue(response);
                        if (_oinvoke.debugInfo != null)
                            se.setLineNo(_oinvoke.debugInfo.startLine);
                        sendEvent(se);

                        try {
                            for (OScope.CorrelationSet anInitCorrelationsOutput : _oinvoke.initCorrelationsOutput) {
                                initializeCorrelation(_scopeFrame.resolve(anInitCorrelationsOutput), outputVar);
View Full Code Here

                _oforEach.innerScope, getBpelRuntimeContext().createScopeInstance(_scopeFrame.scopeInstanceId,
                _oforEach.innerScope), _scopeFrame, null);
        VariableInstance vinst = newFrame.resolve(_oforEach.counterVariable);
        getBpelRuntimeContext().initializeVariable(vinst, counterNode);
        // Generating event
        ScopeEvent se = new VariableModificationEvent(vinst.declaration.name);
        if (_oforEach.debugInfo != null)
            se.setLineNo(_oforEach.debugInfo.startLine);
        sendEvent(se);

        instance(new SCOPE(child.activity, newFrame, _linkFrame));
    }
View Full Code Here

                                if (msgEl != null) {
                                    try {
                                        VariableInstance vinst = ehScopeFrame.resolve(_oevent.variable);
                                        getBpelRuntimeContext().initializeVariable(vinst, msgEl);

                                        ScopeEvent se = new VariableModificationEvent(vinst.declaration.name);
                                        _scopeFrame.fillEventInfo(se);
                                        if (_oevent.debugInfo != null)
                                            se.setLineNo(_oevent.debugInfo.startLine);
                                        getBpelRuntimeContext().sendEvent(se);
                                    } catch (Exception ex) {
                                        __log.fatal(ex);
                                        throw new InvalidProcessException(ex);
                                    }
View Full Code Here

            se = new PartnerLinkModificationEvent(
                    ((OAssign.PartnerLinkRef) ocopy.to).partnerLink.getName());
        } else {
            final VariableInstance lval = _scopeFrame.resolve(ocopy.to
                    .getVariable());
            se = new VariableModificationEvent(lval.declaration.name);
        }
        if (ocopy.debugInfo != null)
            se.setLineNo(ocopy.debugInfo.startLine);
        sendEvent(se);
    }
View Full Code Here

                            try {
                                VariableInstance vinst =  faultHandlerScopeFrame.resolve(catchBlock.faultVariable);
                                ntive.initializeVariable(vinst, _fault.getFaultMessage());

                                // Generating event
                                ScopeEvent se = new VariableModificationEvent(vinst.declaration.name);
                                if (_oscope.debugInfo != null)
                                    se.setLineNo(_oscope.debugInfo.startLine);
                                sendEvent(se);
                            } catch (Exception ex) {
                                __log.fatal(ex);
                                throw new InvalidProcessException(ex);
                            }
View Full Code Here

        }

        VariableInstance vinst = _scopeFrame.resolve(onMessage.variable);
        getBpelRuntimeContext().initializeVariable(vinst, msgEl);
        // Generating event
        ScopeEvent se = new VariableModificationEvent(vinst.declaration.name);
        if (_opick.debugInfo != null)
            se.setLineNo(_opick.debugInfo.startLine);
        sendEvent(se);
    }
View Full Code Here

                            throw new RuntimeException(e);
                        }

                        getBpelRuntimeContext().initializeVariable(outputVar, response);
                        // Generating event
                        ScopeEvent se = new VariableModificationEvent(outputVar.declaration.name);
                        if (_oinvoke.debugInfo != null)
                            se.setLineNo(_oinvoke.debugInfo.startLine);
                        sendEvent(se);

                        try {
                            for (OScope.CorrelationSet anInitCorrelationsOutput : _oinvoke.initCorrelationsOutput) {
                                initializeCorrelation(_scopeFrame.resolve(anInitCorrelationsOutput), outputVar);
View Full Code Here

                _oforEach.innerScope), _scopeFrame, null);
        VariableInstance vinst = newFrame.resolve(_oforEach.counterVariable);
        initializeVariable(vinst, counterNode);

        // Generating event
        VariableModificationEvent se = new VariableModificationEvent(vinst.declaration.name);
        se.setNewValue(counterNode);
        if (_oforEach.debugInfo != null)
            se.setLineNo(_oforEach.debugInfo.startLine);
        sendEvent(se);

        instance(new SCOPE(child.activity, newFrame, _linkFrame));
    }
View Full Code Here

                        .getVariable());
                final VariableInstance rval = _scopeFrame
                        .resolve(((VariableRef) ocopy.from).getVariable());
                Element lvalue = (Element) fetchVariableData(rval, false);
                initializeVariable(lval, lvalue);
                se = new VariableModificationEvent(lval.declaration.name);
                ((VariableModificationEvent)se).setNewValue(lvalue);
            } else {
                // This really should have been cought by the compiler.
                __log
                        .fatal("Message/Non-Message Assignment, should be caught by compiler:"
                                + ocopy);
                throw new FaultException(
                        ocopy.getOwner().constants.qnSelectionFailure,
                        "Message/Non-Message Assignment:  " + ocopy);
            }
        } else {
            // Conventional Assignment logic.
            Node rvalue = evalRValue(ocopy.from);
            Node lvalue = evalLValue(ocopy.to);
            if (__log.isDebugEnabled()) {
                __log.debug("lvalue after eval " + lvalue);
                if (lvalue != null) __log.debug("content " + DOMUtils.domToString(lvalue));
            }

            // Get a pointer within the lvalue.
            Node lvaluePtr = lvalue;

            if (ocopy.to instanceof OAssign.DirectRef) {
                DirectRef dref = ((DirectRef) ocopy.to);
                Element el = DOMUtils.findChildByName((Element)lvalue, dref.elName);
                if (el == null) {
                    el = (Element) ((Element)lvalue).appendChild(lvalue.getOwnerDocument()
                            .createElementNS(dref.elName.getNamespaceURI(), dref.elName.getLocalPart()));
                }
                lvaluePtr = el;
            } else if (ocopy.to instanceof OAssign.VariableRef) {
                VariableRef varRef = ((VariableRef) ocopy.to);
                lvaluePtr = evalQuery(
                        lvalue,
                        varRef.part,
                        varRef.location,
                        new EvaluationContextProxy(varRef.getVariable(), lvalue));
            } else if (ocopy.to instanceof OAssign.PropertyRef) {
                PropertyRef propRef = ((PropertyRef) ocopy.to);
                lvaluePtr = evalQuery(lvalue, propRef.propertyAlias.part,
                        propRef.propertyAlias.location,
                        new EvaluationContextProxy(propRef.getVariable(),
                                lvalue));
            } else if (ocopy.to instanceof OAssign.LValueExpression) {
                LValueExpression lexpr = (LValueExpression) ocopy.to;
                lvaluePtr = evalQuery(lvalue, null, lexpr.expression,
                        new EvaluationContextProxy(lexpr.getVariable(), lvalue));
                if (__log.isDebugEnabled())
                    __log.debug("lvaluePtr expr res " + lvaluePtr);
            }

            // For partner link assignmenent, the whole content is assigned.
            if (ocopy.to instanceof OAssign.PartnerLinkRef) {
                OAssign.PartnerLinkRef pLinkRef = ((OAssign.PartnerLinkRef) ocopy.to);
                PartnerLinkInstance plval = _scopeFrame
                        .resolve(pLinkRef.partnerLink);
                replaceEndpointRefence(plval, rvalue);
                se = new PartnerLinkModificationEvent(((OAssign.PartnerLinkRef) ocopy.to).partnerLink.getName());
            } else {
                // Sneakily converting the EPR if it's not the format expected by the lvalue
                if (ocopy.from instanceof OAssign.PartnerLinkRef) {
                    rvalue = getBpelRuntimeContext().convertEndpointReference((Element)rvalue, lvaluePtr);
                    if (rvalue.getNodeType() == Node.DOCUMENT_NODE)
                        rvalue = ((Document)rvalue).getDocumentElement();
                }

                if (rvalue.getNodeType() == Node.ELEMENT_NODE
                        && lvaluePtr.getNodeType() == Node.ELEMENT_NODE) {
                    lvalue = replaceElement((Element)lvalue, (Element) lvaluePtr, (Element) rvalue,
                            ocopy.keepSrcElementName);
                } else {
                    lvalue = replaceContent(lvalue, lvaluePtr, rvalue
                            .getTextContent());
                }
                final VariableInstance lval = _scopeFrame.resolve(ocopy.to.getVariable());
                if (__log.isDebugEnabled())
                    __log.debug("ASSIGN Writing variable '" + lval.declaration.name +
                                "' value '" + DOMUtils.domToString(lvalue) +"'");
                commitChanges(lval, lvalue);
                se = new VariableModificationEvent(lval.declaration.name);
                ((VariableModificationEvent)se).setNewValue(lvalue);
            }
        }

        if (ocopy.debugInfo != null)
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.evt.VariableModificationEvent

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.