Package org.apache.commons.scxml

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


                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


                    ctx.setLocal(NAMESPACES_KEY, p.getNamespaces());
                    // Do we have an "expr" attribute?
                    if (argExpr != null && argExpr.trim().length() > 0) {
                        // Yes, evaluate and store as parameter value
                        try {
                            argValue = eval.eval(ctx, argExpr);
                        } catch (SCXMLExpressionException see) {
                            errRep.onError(ErrorConstants.EXPRESSION_ERROR,
                                see.getMessage(), i);
                        }
                    } else {
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

        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

                params.put(varName, varObj);
            }
        }
        long wait = 0L;
        if (!SCXMLHelper.isStringEmpty(delay)) {
            Object delayValue = eval.eval(ctx, delay);
            if (delayValue != null) {
                String delayString = delayValue.toString();
                wait = parseDelay(delayString, appLog);
            }
        }
View Full Code Here

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

            final Collection derivedEvents)
    throws ModelException, SCXMLExpressionException {
        Context ctx = scInstance.getContext(getParentTransitionTarget());
        Evaluator eval = scInstance.getEvaluator();
        ctx.setLocal(getNamespacesKey(), getNamespaces());
        appLog.info(label + ": " + String.valueOf(eval.eval(ctx, expr)));
        ctx.setLocal(getNamespacesKey(), null);
    }
}
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.