Bug 131011 Support running query based on report document data
Data Engine should support running a query based on data set and expression data stored in a report document. This bugzilla entry serves as a repository for design docs and notes related to this feature.
data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/document/RDGroupUtil.java
if ( groups.length == 0 )
			return 1;
		
		int childGroupIdx = cacheProvider.getCurrentIndex( );
		int currentGroupIdx = leafGroupIdx;
		int level;
		for ( level = groups.length - 1; level >= 0; level-- )
		{
			
			
			GroupInfo nextGroup = findGroup( level, currentGroupIdx + 1 );
			if ( nextGroup != null && childGroupIdx == nextGroup.firstChild - 1 )
			{
				
				childGroupIdx = currentGroupIdx;
				currentGroupIdx = findGroup( level, currentGroupIdx ).parent;
				continue;
			}
			break;
		}
		
		
		return level + 2;
	}
	/**
	 * Returns the 1-based index of the outermost group
	 * in which the current row is the first row. 
	 * For example, if a query contain N groups 
	 * (group with index 1 being the outermost group, and group with 
	 * index N being the innermost group),