Package org.apache.commons.scxml

Examples of org.apache.commons.scxml.Evaluator.eval()


            final Log appLog, final Collection derivedEvents)
    throws ModelException, SCXMLExpressionException {
        Context ctx = scInstance.getContext(getParentTransitionTarget());
        Evaluator eval = scInstance.getEvaluator();
        ctx.setLocal(getNamespacesKey(), getNamespaces());
        Object varObj = eval.eval(ctx, expr);
        ctx.setLocal(getNamespacesKey(), null);
        ctx.setLocal(name, varObj);
        if (appLog.isDebugEnabled()) {
            appLog.debug("<var>: Defined variable '" + name
                + "' with initial value '" + String.valueOf(varObj) + "'");
View Full Code Here


        Evaluator eval = scInstance.getEvaluator();
        // Most attributes of <send> are expressions so need to be
        // evaluated before the EventDispatcher callback
        Object hintsValue = null;
        if (!SCXMLHelper.isStringEmpty(hints)) {
            hintsValue = eval.eval(ctx, hints);
        }
        String targetValue = target;
        if (!SCXMLHelper.isStringEmpty(target)) {
            targetValue = (String) eval.eval(ctx, target);
            if (SCXMLHelper.isStringEmpty(targetValue)
View Full Code Here

        if (!SCXMLHelper.isStringEmpty(hints)) {
            hintsValue = eval.eval(ctx, hints);
        }
        String targetValue = target;
        if (!SCXMLHelper.isStringEmpty(target)) {
            targetValue = (String) eval.eval(ctx, target);
            if (SCXMLHelper.isStringEmpty(targetValue)
                    && appLog.isWarnEnabled()) {
                appLog.warn("<send>: target expression \"" + target
                    + "\" evaluated to null or empty String");
            }
View Full Code Here

                    + "\" evaluated to null or empty String");
            }
        }
        String targettypeValue = targettype;
        if (!SCXMLHelper.isStringEmpty(targettype)) {
            targettypeValue = (String) eval.eval(ctx, targettype);
            if (SCXMLHelper.isStringEmpty(targettypeValue)
                    && appLog.isWarnEnabled()) {
                appLog.warn("<send>: targettype expression \"" + targettype
                    + "\" evaluated to null or empty String");
            }
View Full Code Here

                            oldNode.appendChild(importedNode);
                        }
                    }
                } catch (SCXMLExpressionException see) {
                    // or something else, stuff toString() into lvalue
                    Object valueObject = eval.eval(ctx, expr);
                    SCXMLHelper.setNodeValue(oldNode, valueObject.toString());
                }
                if (appLog.isDebugEnabled()) {
                    appLog.debug("<assign>: data node '" + oldNode.getNodeName()
                        + "' updated");
View Full Code Here

            } else {
                Object varObj = null;
                if (src != null && src.trim().length() > 0) {
                    varObj = getSrcNode();
                } else {
                    varObj = eval.eval(ctx, expr);
                }
                ctx.set(name, varObj);
                if (appLog.isDebugEnabled()) {
                    appLog.debug("<assign>: Set variable '" + name + "' to '"
                        + String.valueOf(varObj) + "'");
View Full Code Here

                if (src == null) {
                    String srcexpr = i.getSrcexpr();
                    Object srcObj = null;
                    try {
                        ctx.setLocal(NAMESPACES_KEY, i.getNamespaces());
                        srcObj = eval.eval(ctx, srcexpr);
                        ctx.setLocal(NAMESPACES_KEY, null);
                        src = String.valueOf(srcObj);
                    } catch (SCXMLExpressionException see) {
                        errRep.onError(ErrorConstants.EXPRESSION_ERROR,
                            see.getMessage(), i);
View Full Code Here

                    String argExpr = p.getExpr();
                    Object argValue = null;
                    if (argExpr != null && argExpr.trim().length() > 0) {
                        try {
                            ctx.setLocal(NAMESPACES_KEY, p.getNamespaces());
                            argValue = eval.eval(ctx, argExpr);
                            ctx.setLocal(NAMESPACES_KEY, null);
                        } catch (SCXMLExpressionException see) {
                            errRep.onError(ErrorConstants.EXPRESSION_ERROR,
                                see.getMessage(), i);
                        }
View Full Code Here

        State parentState = getParentState();
        Context ctx = scInstance.getContext(parentState);
        Evaluator eval = scInstance.getEvaluator();
        Object hintsValue = null;
        if (!SCXMLHelper.isStringEmpty(hints)) {
            hintsValue = eval.eval(ctx, hints);
        }
        Map params = null;
        if (!SCXMLHelper.isStringEmpty(namelist)) {
            StringTokenizer tkn = new StringTokenizer(namelist);
            params = new HashMap(tkn.countTokens());
View Full Code Here

            final org.apache.commons.logging.Log appLog,
            final Collection derivedEvents)
    throws ModelException, SCXMLExpressionException {
        Context ctx = scInstance.getContext(getParentState());
        Evaluator eval = scInstance.getEvaluator();
        appLog.info(label + ": " + String.valueOf(eval.eval(ctx, expr)));
    }
}
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.