@Override
	public void onEntry(TransitionTarget state) {
		logger.info("/"+ state.getId());	
		// if parallel state, then store the child branch states to a hashmap for later cleanup
		if(state instanceof Parallel) {			
			Set <TransitionTarget> children = ((Parallel) state).getChildren();
			Iterator <TransitionTarget> chi = children.iterator();
			int i = 0; 
			while(chi.hasNext()) {
				i++;
				String temp = chi.next().getId();
				branches.put(temp, state.getId());
				if(i == children.size())
					layoutManager.getMultipartPage(smSession).setCurrentVirtualScreensForRemoval(temp, state.getId()); 
			}
		} else {
			String branch = null;
			String parallel = null;
			if(branches.size() > 0) {
				branch = recursiveFindBranch(state);
				parallel = branches.get(branch);
			}
			// if yes, then don't create the UI, as it is recovered separately			
			if(recoveryState != null) {
				recoveryState = null;
			} else {
				DBUtil.setState(this.smSession, state.getId());
				try {
					List <Operation> overrideList = getOverrideOperation(state);
					//remove from opensource
					if(persistent) {				
						publisher.publish("{\"message_type\":\""+Event.EVENT_CHANGE_STATE+"\","
								 +"\"instance_id\":\""+smSession+"\","
								 +"\"target_state\":\""+state.getId()+"\","
								 +"\"timestamp\":\""+fmt.print(new DateTime())+"\""
								 +Event.getOperationsJSON(overrideList)
								 +"}");
					}
					//--
					if( state.getDatamodel() != null) {
						List <Data> list = state.getDatamodel().getData();
						if (list.size() != 1) {
							logger.info("Unexpected number of Data elements size "+list.size());
						} else {
							Data data = (Data)list.get(0);
							Node multipartpage = data.getNode().getFirstChild();
							// parse the target state virtual multipartpage to newMultipartpage
							Map <String, VirtualScreen> newMultipartpage = MultipartPage.parseMultipartPage(multipartpage);
							// override newVirtualScreens with possible overrides 
							Set <String> operationTypes = overrideVirtualScreens(overrideList, newMultipartpage, state);
							
							layoutManager.changeLayout(smSession, newMultipartpage, operationTypes, branch, parallel);
							
						}
					}
				} catch (ParsingException e) {
					logger.log(Level.SEVERE,e.getMessage(),e);
				}
			}
		}
	}