Example usage for org.apache.commons.scxml.model TransitionTarget getId

List of usage examples for org.apache.commons.scxml.model TransitionTarget getId

Introduction

In this page you can find the example usage for org.apache.commons.scxml.model TransitionTarget getId.

Prototype

public final String getId() 

Source Link

Document

Get the identifier for this transition target (may be null).

Usage

From source file:de.dfki.iui.mmds.scxml.engine.events.SCXMLOnExitEvent.java

private static Map<String, Object> getMap(String id, TransitionTarget state) {
    Map<String, Object> properties = new HashMap<String, Object>(3);
    properties.put(TRANSITION_TARGET, state.getId());
    properties.put(ID, id);/*  w w  w.j  a  v  a  2  s . com*/
    properties.put(EventConstants.TIMESTAMP, System.currentTimeMillis());
    return properties;
}

From source file:de.dfki.iui.mmds.scxml.engine.events.SCXMLOnEntryEvent.java

private static Map<String, Object> getMap(String id, TransitionTarget state) {
    Map<String, Object> properties = new HashMap<String, Object>(3);
    properties.put(ID, id);/*from w  w  w  .  ja v a  2  s.  c om*/
    properties.put(TRANSITION_TARGET, state.getId());
    properties.put(EventConstants.TIMESTAMP, System.currentTimeMillis());
    return properties;
}

From source file:de.dfki.iui.mmds.scxml.engine.events.SCXMLOnTransitionEvent.java

private static Map<String, Object> getMap(String id, TransitionTarget from, TransitionTarget to,
        Transition transition) {/*from  ww w.  ja v a  2s .  com*/
    Map<String, Object> properties = new HashMap<String, Object>(6);
    properties.put(FROM, from.getId());
    properties.put(TO, to.getId());
    properties.put(TRANSITION, transition.getEvent());
    properties.put(CONDITION, transition.getCond());
    properties.put(ID, id);
    properties.put(EventConstants.TIMESTAMP, System.currentTimeMillis());
    return properties;
}

From source file:de.dfki.iui.mmds.dialogue.ScxmlLogger.java

@Override
public void onEntry(TransitionTarget state) {
    activeStates.add(state.getId());
    logger.debug(logActiveStates() + "// ENTERED: " + state.getId());

}

From source file:de.dfki.iui.mmds.dialogue.ScxmlLogger.java

@Override
public void onExit(TransitionTarget state) {
    activeStates.remove(state.getId());
    logger.debug(logActiveStates() + " // LEFT: " + state.getId());
}

From source file:de.dfki.iui.mmds.dialogue.ScxmlLogger.java

@Override
public void onTransition(TransitionTarget from, TransitionTarget to, Transition transition) {
    Log log = (Log) transition.getActions().get(0);
    logger.debug(String.format("TRANS %s: %s --> %s", log.getLabel(), from.getId(), to.getId()));
}

From source file:alma.acs.nc.sm.generic.AcsScxmlEngine.java

/**
 * Checks if a given state is active. /*from  ww  w.  ja v a  2  s.  c  om*/
 * The matching against the current state is done via String comparison, so that
 * especially for hierarchical states it makes sense to call this method
 * asking only for the outer state name(s).
 * <p>
 * TODO: Protect against mismatches that can occur if one state name includes another state name as a substring, 
 *       e.g. by splitting names at "::" and comparing those fragements.
 *  
 * @param stateName The state name (fragment). 
 *         Hierarchical states are separated by "::", with outer state first, e.g. "EnvironmentCreated::Connected".
 * @return <code>true</code> if the given state is active.
 */
public synchronized boolean isStateActive(String stateName) {
    @SuppressWarnings("unchecked")
    Set<TransitionTarget> activeStates = exec.getCurrentStatus().getStates();

    for (TransitionTarget tt : activeStates) {
        if (tt.getId().indexOf(stateName) >= 0) {
            return true;
        }
    }
    return false;
}

From source file:de.dfki.iui.mmds.application.ScxmlDebugGui.java

@Override
public void onEntry(TransitionTarget state) {
    append("ENTER", state.getId(), ProjectManager.dialogueManager.idToDialogueNode.get(state.getId()).getId());
    activeStates.add(state.getId());//from   ww w .  j  a  va2 s  .c  o  m
    activeStatesChanged = true;
}

From source file:de.dfki.iui.mmds.application.ScxmlDebugGui.java

@Override
public void onExit(TransitionTarget state) {
    append("LEAVE", state.getId(), "");
    activeStates.remove(state.getId());//from ww w  . j a  v  a 2 s.  c o m
    activeStatesChanged = true;
}

From source file:de.dfki.iui.mmds.application.ScxmlDebugGui.java

@Override
public void onTransition(TransitionTarget from, TransitionTarget to, Transition transition) {
    Log log = (Log) transition.getActions().get(0);
    append("TRANS ", log.getLabel() + ": " + from.getId() + " --> " + to.getId(), "");
}