public State getStateById(int id) throws ApplicationException {
   State state = (State) cache.get(id);
   if (state == null) {
     state = StateManager.getStateById(id);
     if (state != null) {
       cache.put(id, state);
       cache.put("<workflow>=" + state.getWorkflowId() + "/<name>=" + state.getName(), state);
     }
   }
   return state;
 }