Package org.apache.commons.scxml.model

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


        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

            System.err.println("SKIPPED SERIALIZATION: Failed directory creation");
            return scxml;
        }
        String filename = SERIALIZATION_FILE_PREFIX
            + System.currentTimeMillis() + SERIALIZATION_FILE_SUFFIX;
        SCXML roundtrip = null;
        try {
            ObjectOutputStream out =
                new ObjectOutputStream(new FileOutputStream(filename));
            out.writeObject(scxml);
            out.close();
View Full Code Here

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

        }
    }

    public void testInvoke02Sample() {
        try {
            SCXML scxml = SCXMLParser.parse(invoke02,
                new SimpleErrorHandler());
            exec = new SCXMLExecutor(new JexlEvaluator(), new SimpleDispatcher(),
                new SimpleErrorReporter());
            assertNotNull(exec);
            exec.setRootContext(new JexlContext());
View Full Code Here

        }
    }

    public void testInvoke03Sample() {
        try {
            SCXML scxml = SCXMLParser.parse(invoke03,
                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

        if (scxmlDocument == null) {
          log.warn("No SCXML document at: " + dialogIdentifier);
          return null;
        }
       
        SCXML scxml = null;
        ShaleDialogELEvaluator evaluator = new ShaleDialogELEvaluator();
        evaluator.setFacesContext(context);
        try {
            scxml = SCXMLDigester.digest(scxmlDocument,
                new SimpleErrorHandler(), new SessionContext(context),
                  evaluator);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }

        if (scxml == null) {
          log.warn("Could not parse SCXML document at: " + dialogIdentifier);
          return null;
        }
       
        SCXMLExecutor exec = null;
        try {
            exec = new SCXMLExecutor(evaluator, new SimpleDispatcher(),
                new SimpleErrorReporter());
            scxml.addListener(new SimpleSCXMLListener());
            exec.setSuperStep(true);
            exec.setStateMachine(scxml);
        } catch (ModelException me) {
          log.warn(me.getMessage(), me);
          return null;
View Full Code Here

        if (scxmlDocument == null) {
          log.warn("No SCXML document at: " + dialogIdentifier);
          return null;
        }
       
        SCXML scxml = null;
        ShaleDialogELEvaluator evaluator = new ShaleDialogELEvaluator();
        evaluator.setFacesContext(context);
        try {
            scxml = SCXMLDigester.digest(scxmlDocument,
                new SimpleErrorHandler(), new SessionContext(context),
                  evaluator);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }

        if (scxml == null) {
          log.warn("Could not parse SCXML document at: " + dialogIdentifier);
          return null;
        }
       
        SCXMLExecutor exec = null;
        try {
            exec = new SCXMLExecutor(evaluator, new SimpleDispatcher(),
                new SimpleErrorReporter());
            scxml.addListener(new SimpleSCXMLListener());
            exec.setSuperStep(true);
            exec.setStateMachine(scxml);
        } catch (ModelException me) {
          log.warn(me.getMessage(), me);
          return null;
View Full Code Here

                    customDialogActions.add(customAction);
                }

                URL resource = new URL(getResource(), scxmlconfig);

                SCXML dialog = null;
                try {
                    // Parse document, with rules for custom actions in place
                    dialog = SCXMLDigester.digest(resource,
                        new SimpleErrorHandler(), customDialogActions);
                } catch (ModelException me) {
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.