Package org.apache.commons.scxml.model

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


        try {
            String documentURI = getCanonicalURI(uri);
            Context rootCtx = evaluator.newContext(null);
            EventDispatcher ed = new SimpleDispatcher();
            Tracer trc = new Tracer();
            SCXML doc = SCXMLDigester.digest(new URL(documentURI), trc);
            if (doc == null) {
                System.err.println("The SCXML document " + uri
                        + " can not be parsed!");
                System.exit(-1);
            }
View Full Code Here


    /**
     * Test the SCXML documents, usage of <invoke>
     */
    public void testInvoke01Sample() {
        try {
            SCXML scxml = SCXMLDigester.digest(invoke01,
                new SimpleErrorHandler());
            exec = new SCXMLExecutor(new JexlEvaluator(), new SimpleDispatcher(),
                new SimpleErrorReporter());
            assertNotNull(exec);
            exec.setRootContext(new JexlContext());
View Full Code Here

            fail(e.getMessage());
        }
    }

    public void testWizard02Sample() {
        SCXML scxml = SCXMLTestHelper.digest(wizard02);
        exec = SCXMLTestHelper.getExecutor(new JexlContext(),
            new JexlEvaluator(), scxml, new TestEventDispatcher(),
            new Tracer());
        assertNotNull(exec);
        try {
View Full Code Here

    /**
     * {@inheritDoc}.
     */
    public void invoke(final String source, final Map params)
    throws InvokerException {
        SCXML scxml = null;
        try {
            scxml = SCXMLDigester.digest(source,
                new SimpleErrorHandler(), null);
        } catch (ModelException me) {
            throw new InvokerException(me.getMessage(), me.getCause());
View Full Code Here

        String[] testCaseName = { SCXMLSerializerTest.class.getName()};
        junit.textui.TestRunner.main(testCaseName);
    }
   
    public void testSerializeSCXMLNoStates() {
        SCXML scxml = new SCXML();
        scxml.setXmlns("namespace");
        scxml.setVersion("version1");
        scxml.setInitialstate("off");
        scxml.addState(new State());
       
        String assertValue = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
            + "<scxml xmlns=\"namespace\" version=\"version1\" "
            + "initialstate=\"off\">\n <state>\n </state>\n</scxml>\n";
       
View Full Code Here

    public static SCXML digest(final URL url, final ErrorHandler errHandler,
            final List customActions) {
        Assert.assertNotNull(url);
        // SAX ErrorHandler may be null
        SCXML scxml = null;
        try {
            scxml = SCXMLDigester.digest(url, errHandler, customActions);
        } catch (Exception e) {
            Log log = LogFactory.getLog(SCXMLTestHelper.class);
            log.error(e.getMessage(), e);
View Full Code Here

        Assert.assertNotNull(scxml);
        return scxml;
    }

    public static SCXMLExecutor getExecutor(final URL url) {
        SCXML scxml = digest(url);
        Evaluator evaluator = new JexlEvaluator();
        return getExecutor(evaluator, scxml);
    }
View Full Code Here

        return getExecutor(evaluator, scxml);
    }

    public static SCXMLExecutor getExecutor(final URL url,
            final Evaluator evaluator) {
        SCXML scxml = digest(url);
        return getExecutor(evaluator, scxml);
    }
View Full Code Here

        return getExecutor(evaluator, scxml);
    }

    public static SCXMLExecutor getExecutor(final URL url,
            final ErrorHandler errHandler) {
        SCXML scxml = digest(url, errHandler);
        Evaluator evaluator = new JexlEvaluator();
        return getExecutor(evaluator, scxml);
    }
View Full Code Here

        return getExecutor(context, evaluator, scxml, ed, trc);
    }

    public static SCXMLExecutor getExecutor(final URL url, final Context ctx,
            final Evaluator evaluator) {
        SCXML scxml = digest(url);
        EventDispatcher ed = new SimpleDispatcher();
        Tracer trc = new Tracer();
        return getExecutor(ctx, evaluator, scxml, ed, trc);
    }
View Full Code Here

TOP

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

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.