Package org.uscxml

Examples of org.uscxml.Event


    String expr = location + "=" + content;
    ctx.evaluateString(scope, expr, "uscxml", 1, null);
  }

  public void handleException(String cause) {
    Event exceptionEvent = new Event();
    exceptionEvent.setName("error.execution");
    exceptionEvent.setEventType(Event.Type.PLATFORM);

    interpreter.receiveInternal(exceptionEvent);
  }
View Full Code Here


  @Override
  public void send(SendRequest req) {
    System.out.println(req);
    // send in s1.onentry
    if ("This is some content!".equals(req.getContent())) {
      returnEvent(new Event("received1"));
      return;
    }
    // send in s2.onentry
    if (req.getParams().containsKey("foo")
        && "bar".equals(req.getParams().get("foo").get(0).getAtom())) {
      returnEvent(new Event("received2"));
      return;
    }
    // send in s3
    if (req.getXML().length() > 0) {
      try {
        DocumentBuilderFactory factory = DocumentBuilderFactory
            .newInstance();
        Document doc = factory.newDocumentBuilder().parse(
            new InputSource(new StringReader(req.getXML())));
        System.out.println("Root element :"
            + doc.getDocumentElement().getNodeName());
        if ("this".equals(doc.getDocumentElement().getNodeName())) {
          returnEvent(new Event("received3"));
          return;
        }
      } catch (ParserConfigurationException e) {
        e.printStackTrace();
      } catch (SAXException e) {
View Full Code Here

  @Override
  public void send(SendRequest req) {
    System.out.println(req);
    // send in s1.onentry
    if ("This is some content!".equals(req.getContent())) {
      returnEvent(new Event("received1"));
      return;
    }
    // send in s2.onentry
    if (req.getParams().containsKey("foo")
        && "bar".equals(req.getParams().get("foo").get(0).getAtom())) {
      returnEvent(new Event("received2"));
      return;
    }
    // send in s3
    if (req.getXML().length() > 0) {
      try {
        DocumentBuilderFactory factory = DocumentBuilderFactory
            .newInstance();
        Document doc = factory.newDocumentBuilder().parse(
            new InputSource(new StringReader(req.getXML())));
        System.out.println("Root element :"
            + doc.getDocumentElement().getNodeName());
        if ("this".equals(doc.getDocumentElement().getNodeName())) {
          returnEvent(new Event("received3"));
          return;
        }
      } catch (ParserConfigurationException e) {
        e.printStackTrace();
      } catch (SAXException e) {
View Full Code Here

  }
 
  /**  KeyListener */
  @Override
  public void keyPressed(KeyEvent e) {
    Event evt = new Event("key.pressed");
    evt.setData(keyEventToData(e));
    returnEvent(evt);
  }
View Full Code Here

  }

  /**  KeyListener */
  @Override
  public void keyReleased(KeyEvent e) {
    Event evt = new Event("key.released");
    evt.setData(keyEventToData(e));
    returnEvent(evt);
  }
View Full Code Here

  }

  /**  KeyListener */
  @Override
  public void keyTyped(KeyEvent e) {
    Event evt = new Event("key.typed");
    evt.setData(keyEventToData(e));
    returnEvent(evt);
  }
View Full Code Here

  @Override
  public void send(SendRequest req) {
    System.out.println(req);
    if ("foo".equals(req.getName()))
      returnEvent(new Event("received2")); // enqueue an external event
  }
View Full Code Here

  @Override
  public void invoke(InvokeRequest req) {
    System.out.println(req);
    if ("Some string content".equals(req.getContent())) {
      returnEvent(new Event("received1")); // enqueue an external event
    }
  }
View Full Code Here

  @Override
  public void send(SendRequest req) {
    System.out.println(req);
    if ("foo".equals(req.getName()))
      returnEvent(new Event("received2"), true); // enqueue an external event
  }
View Full Code Here

  @Override
  public void invoke(InvokeRequest req) {
    System.out.println(req);
    if ("Some string content".equals(req.getContent())) {
      returnEvent(new Event("received1")); // enqueue an external event
    }
  }
View Full Code Here

TOP

Related Classes of org.uscxml.Event

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.