Package org.apache.commons.scxml.model

Examples of org.apache.commons.scxml.model.Param


            b.append(" srcexpr=\"").append(srcexpr).append("\"");
        }
        b.append(">\n");
        List params = i.params();
        for (Iterator iter = params.iterator(); iter.hasNext();) {
            Param p = (Param) iter.next();
            b.append(indent).append(INDENT).append("<param name=\"").
                append(p.getName()).append("\" expr=\"").
                append(p.getExpr()).append("\"/>\n");
        }
        Finalize f = i.getFinalize();
        if (f != null) {
            b.append(indent).append(INDENT).append("<finalize>\n");
            serializeActions(b, f.getActions(), indent + INDENT + INDENT);
View Full Code Here


                inv.setParentStateId(s.getId());
                inv.setSCInstance(scInstance);
                List params = i.params();
                Map args = new HashMap();
                for (Iterator pIter = params.iterator(); pIter.hasNext();) {
                    Param p = (Param) pIter.next();
                    String argExpr = p.getExpr();
                    Object argValue = null;
                    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 {
                        // No. Does value of "name" attribute refer to a valid
                        // location in the data model?
                        try {
                            argValue = eval.evalLocation(ctx, p.getName());
                            if (argValue == null) {
                                // Generate error, 4.3.1 in WD-scxml-20080516
                                TriggerEvent te = new TriggerEvent(s.getId()
                                    + ERR_ILLEGAL_ALLOC,
                                    TriggerEvent.ERROR_EVENT);
                                internalEvents.add(te);
                            }
                        } catch (SCXMLExpressionException see) {
                            errRep.onError(ErrorConstants.EXPRESSION_ERROR,
                                see.getMessage(), i);
                        }
                    }
                    ctx.setLocal(NAMESPACES_KEY, null);
                    args.put(p.getName(), argValue);
                }
                try {
                    inv.invoke(source, args);
                } catch (InvokerException ie) {
                    TriggerEvent te = new TriggerEvent(s.getId()
View Full Code Here

            b.append(" srcexpr=\"").append(srcexpr).append("\"");
        }
        b.append(">\n");
        List params = i.params();
        for (Iterator iter = params.iterator(); iter.hasNext();) {
            Param p = (Param) iter.next();
            b.append(indent).append(INDENT).append("<param name=\"").
                append(p.getName()).append("\" expr=\"").
                append(SCXMLHelper.escapeXML(p.getExpr())).append("\"/>\n");
        }
        Finalize f = i.getFinalize();
        if (f != null) {
            b.append(indent).append(INDENT).append("<finalize>\n");
            serializeActions(b, f.getActions(), indent + INDENT + INDENT);
View Full Code Here

                inv.setParentStateId(s.getId());
                inv.setSCInstance(scInstance);
                List params = i.params();
                Map args = new HashMap();
                for (Iterator pIter = params.iterator(); pIter.hasNext();) {
                    Param p = (Param) pIter.next();
                    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);
                        }
                    }
                    args.put(p.getName(), argValue);
                }
                try {
                    inv.invoke(source, args);
                } catch (InvokerException ie) {
                    TriggerEvent te = new TriggerEvent(s.getId()
View Full Code Here

            b.append(" srcexpr=\"").append(srcexpr).append("\"");
        }
        b.append(">\n");
        List params = i.params();
        for (Iterator iter = params.iterator(); iter.hasNext();) {
            Param p = (Param) iter.next();
            b.append(indent).append(INDENT).append("<param name=\"").
                append(p.getName()).append("\" expr=\"").
                append(p.getExpr()).append("\"/>\n");
        }
        Finalize f = i.getFinalize();
        if (f != null) {
            b.append(indent).append(INDENT).append("<finalize>\n");
            serializeActions(b, f.getActions(), indent + INDENT + INDENT);
View Full Code Here

                inv.setParentStateId(s.getId());
                inv.setSCInstance(scInstance);
                List params = i.params();
                Map args = new HashMap();
                for (Iterator pIter = params.iterator(); pIter.hasNext();) {
                    Param p = (Param) pIter.next();
                    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);
                        }
                    }
                    args.put(p.getName(), argValue);
                }
                try {
                    inv.invoke(source, args);
                } catch (InvokerException ie) {
                    TriggerEvent te = new TriggerEvent(s.getId()
View Full Code Here

            b.append(" srcexpr=\"").append(srcexpr).append("\"");
        }
        b.append(">\n");
        List params = i.params();
        for (Iterator iter = params.iterator(); iter.hasNext();) {
            Param p = (Param) iter.next();
            b.append(indent).append(INDENT).append("<param name=\"").
                append(p.getName()).append("\" expr=\"").
                append(p.getExpr()).append("\"/>\n");
        }
        Finalize f = i.getFinalize();
        if (f != null) {
            b.append(indent).append(INDENT).append("<finalize>\n");
            serializeActions(b, f.getActions(), indent + INDENT + INDENT);
View Full Code Here

TOP

Related Classes of org.apache.commons.scxml.model.Param

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.