Package org.apache.commons.scxml2

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


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


    @Override
    public void execute(ActionExecutionContext exctx) throws ModelException, SCXMLExpressionException {
        Context ctx = exctx.getContext(getParentEnterableState());
        Evaluator eval = exctx.getEvaluator();
        ctx.setLocal(getNamespacesKey(), getNamespaces());
        exctx.getAppLog().info(label + ": " + String.valueOf(eval.eval(ctx, expr)));
        ctx.setLocal(getNamespacesKey(), null);
    }
}
View Full Code Here

    @Override
    public void execute(ActionExecutionContext exctx) throws ModelException, SCXMLExpressionException {
        Context ctx = exctx.getContext(getParentEnterableState());
        Evaluator eval = exctx.getEvaluator();
        ctx.setLocal(getNamespacesKey(), getNamespaces());
        Object varObj = eval.eval(ctx, expr);
        ctx.setLocal(getNamespacesKey(), null);
        ctx.setLocal(name, varObj);
        if (exctx.getAppLog().isDebugEnabled()) {
            exctx.getAppLog().debug("<var>: Defined variable '" + name
                + "' with initial value '" + String.valueOf(varObj) + "'");
View Full Code Here

    public void execute(ActionExecutionContext exctx) throws ModelException, SCXMLExpressionException {
        Context ctx = exctx.getContext(getParentEnterableState());
        Evaluator eval = exctx.getEvaluator();
        ctx.setLocal(getNamespacesKey(), getNamespaces());
        try {
            Object arrayObject = eval.eval(ctx,array);
            if (arrayObject != null && (arrayObject instanceof Iterable || arrayObject.getClass().isArray())) {
                if (arrayObject.getClass().isArray()) {
                    for (int currentIndex = 0, size = Array.getLength(arrayObject); currentIndex < size; currentIndex++) {
                        ctx.setLocal(item, Array.get(arrayObject, currentIndex));
                        ctx.setLocal(index, currentIndex);
View Full Code Here

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

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

                    + "\" evaluated to null or empty String");
            }
        }
        String typeValue;
        if (type != null) {
            typeValue = (String) eval.eval(ctx, type);
            if ((typeValue == null || typeValue.trim().length() == 0)
                    && exctx.getAppLog().isWarnEnabled()) {
                exctx.getAppLog().warn("<send>: type expression \"" + type
                    + "\" evaluated to null or empty String");
            }
View Full Code Here

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

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

            } else {
                Object varObj;
                if (src != null && src.trim().length() > 0) {
                    varObj = getSrcNode();
                } else {
                    varObj = eval.eval(ctx, expr);
                }
                ctx.set(name, varObj);
                if (exctx.getAppLog().isDebugEnabled()) {
                    exctx.getAppLog().debug("<assign>: Set variable '" + name + "' to '"
                        + String.valueOf(varObj) + "'");
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.