IPreparedQuery query = dteDataEngine.prepare( queryDefn );
IPreparedQuery query = dteDataEngine.prepare( queryDefn, this.appContext );
	public void evaluateQuery( String parameterGroupName )	{		CascadingParameterGroupHandle parameterGroup = getCascadingParameterGroup( parameterGroupName );		if ( dataCache == null )			dataCache = new HashMap( );		if ( parameterGroup == null )			return;		//If a IResultIterator with the same name has already existed in the dataCache,		//this IResultIterator and its IQueryResults should be closed.		IResultIterator iterOld = (IResultIterator) dataCache.get( parameterGroup.getName( ) );		if ( iterOld != null )		{			dataCache.remove( parameterGroup.getName( ) );			try			{				IQueryResults iresultOld = iterOld.getQueryResults();				iterOld.close( );				iresultOld.close( );			}			catch ( BirtException ex )			{				log.log( Level.WARNING, ex.getMessage( ) );			}		}				DataSetHandle dataSet = parameterGroup.getDataSet( );		if ( dataSet != null )		{			try			{				// Handle data source and data set				DataEngine dteDataEngine = getDataEngine( );				IDataEngine dataEngine = executionContext.getDataEngine( );				dataEngine.defineDataSet( dataSet );				QueryDefinition queryDefn = new QueryDefinition( );				queryDefn.setDataSetName( dataSet.getQualifiedName( ) );				SlotHandle parameters = parameterGroup.getParameters( );				Iterator iter = parameters.iterator( );/*				if ( labelMap == null )					labelMap = new HashMap( );				if ( valueMap == null )					valueMap = new HashMap( );*/								if ( labelColumnBindingNames == null )					labelColumnBindingNames = new ArrayList();								while ( iter.hasNext( ) )				{					Object param = iter.next( );					if ( param instanceof ScalarParameterHandle )					{						String valueExpString = ( (ScalarParameterHandle) param )								.getValueExpr( );						ScriptExpression valueExpObject = new ScriptExpression(								valueExpString );												String keyValue = VALUE_PREFIX+parameterGroup.getName( ) + "_"						+ ( (ScalarParameterHandle) param ).getName( );							/*					valueMap.put( keyValue,								valueExpObject );*/												queryDefn.addResultSetExpression( keyValue, valueExpObject );						//queryDefn.getRowExpressions( ).add( valueExpObject );						String labelExpString = ( (ScalarParameterHandle) param )								.getLabelExpr( );						if ( labelExpString != null								&& labelExpString.length( ) > 0 )						{							ScriptExpression labelExpObject = new ScriptExpression(									labelExpString );														String keyLabel = LABEL_PREFIX+parameterGroup.getName( ) + "_"							+ ( (ScalarParameterHandle) param ).getName( );	/*						labelMap.put( keyLabel, labelExpObject );							queryDefn.getRowExpressions( ).add( labelExpObject );*/							labelColumnBindingNames.add( keyLabel );							queryDefn.addResultSetExpression( keyLabel, labelExpObject );						}						GroupDefinition groupDef = new GroupDefinition( );						groupDef.setKeyExpression( valueExpString );						queryDefn.addGroup( groupDef );					}				}				queryDefn.setAutoBinding( true );								IPreparedQuery query = dteDataEngine.prepare( queryDefn );				IQueryResults result = query.execute( executionContext						.getSharedScope( ) );				IResultIterator resultIter = result.getResultIterator( );				dataCache.put( parameterGroup.getName( ), resultIter );				return;			}			catch ( BirtException ex )			{				ex.printStackTrace( );			}		}		dataCache.put( parameterGroup.getName( ), null );	}