this.engine = engine;  taskIDString = "Task" + new Integer( taskID ).toString( );  locale = Locale.getDefault( );  ScriptableObject rootScope = null; if ( engine != null ) { Object scope = engine.getRootScope( ); if ( scope instanceof ScriptableObject ) { rootScope = (ScriptableObject) scope; } } if ( rootScope != null ) { scriptContext = new ScriptContext( rootScope ); } else { scriptContext = new ScriptContext( ); }  initailizeScriptContext( scriptContext.getContext( ), scriptContext .getRootScope( ) );    scriptContext.registerBean( "report", new ReportObject( ) ); scriptContext .registerBean( "params", new ScriptableParameters( params, scriptContext.getScope( ) ) ); scriptContext.registerBean( "config", configs ); scriptContext.registerBean( "currentPage", new Long( pageNumber ) ); scriptContext.registerBean( "totalPage", new Long( totalPage ) ); scriptContext.registerBean( "_jsContext", this ); scriptContext .eval( "function registerGlobal( name, value) { _jsContext.registerGlobalBean(name, value); }" ); scriptContext .eval( "function unregisterGlobal(name) { _jsContext.unregisterGlobalBean(name); }" );  applicationClassLoader = new ApplicationClassLoader( this ); scriptContext.getContext( ).setApplicationClassLoader( applicationClassLoader );
this(null, -1);
	public ExecutionContext( IReportEngine engine, int taskID )	{		this.engine = engine;		taskIDString = "Task" + new Integer( taskID ).toString( ); //$NON-NLS-1$		locale = Locale.getDefault( );		ScriptableObject rootScope = null;		if ( engine != null )		{			Object scope = engine.getRootScope( );			if ( scope instanceof ScriptableObject )			{				rootScope = (ScriptableObject) scope;			}		}		if ( rootScope != null )		{			scriptContext = new ScriptContext( rootScope );		}		else		{			scriptContext = new ScriptContext( );		}		initailizeScriptContext( scriptContext.getContext( ), scriptContext				.getRootScope( ) );		// create script context used to execute the script statements		// register the global variables in the script context		scriptContext.registerBean( "report", new ReportObject( ) );		scriptContext				.registerBean(						"params", new ScriptableParameters( params, scriptContext.getScope( ) ) ); //$NON-NLS-1$		scriptContext.registerBean( "config", configs ); //$NON-NLS-1$		scriptContext.registerBean( "currentPage", new Long( pageNumber ) );		scriptContext.registerBean( "totalPage", new Long( totalPage ) );		scriptContext.registerBean( "_jsContext", this );		scriptContext				.eval( "function registerGlobal( name, value) { _jsContext.registerGlobalBean(name, value); }" );		scriptContext				.eval( "function unregisterGlobal(name) { _jsContext.unregisterGlobalBean(name); }" );				applicationClassLoader = new ApplicationClassLoader( this );		scriptContext.getContext( ).setApplicationClassLoader(				applicationClassLoader );			}