private StateVertex addStateToCurrentState ( StateVertex newState , Eventable eventable ) { LOGGER . debug ( "addStateToCurrentState currentState: {} newState {}" , currentState . getName ( ) , newState . getName ( ) ) ; // Add the state to the stateFlowGraph. Store the result StateVertex cloneState = stateFlowGraph . putIfAbsent ( newState ) ; // Is there a clone detected? if ( cloneState != null ) { LOGGER . info ( "CLONE State detected: {} and {} are the same." , newState . getName ( ) , cloneState . getName ( ) ) ; LOGGER . debug ( "CLONE CURRENT STATE: {}" , currentState . getName ( ) ) ; LOGGER . debug ( "CLONE STATE: {}" , cloneState . getName ( ) ) ; LOGGER . debug ( "CLONE CLICKABLE: {}" , eventable ) ; boolean added = stateFlowGraph . addEdge ( currentState , cloneState , eventable ) ; if ( ! added ) { LOGGER . debug ( "Clone edge !! Need to fix the crawlPath??" ) ; } } else { stateFlowGraph . addEdge ( currentState , newState , eventable ) ; LOGGER . info ( "State {} added to the StateMachine." , newState . getName ( ) ) ; } return cloneState ; }
Adds the newState and the edge between the currentState and the newState on the SFG .