@Override
	public ConnectionData toData( AbstractConnection item ) {
		if( item.getSourceItem() == null || item.getTargetItem() == null ){
			// in such cases the user is still drawing the item - do not save it.
			return null;
		}
		
		ConnectionData data = new ConnectionData( item.getKey() );
		data.setConnectionType( item.getConnectionType() );
		data.setSource( item.getSourceItem().getKey() );
		data.setTarget( item.getTargetItem().getKey() );
		return data;
	}