gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/functions/GfdExportFunction.java
public void execute(FunctionContext<Object> fc)
	{
		
		ResultSender<Object> rs = fc.getResultSender();
		try
		{
			boolean didExport = false;
			
			if(fc instanceof RegionFunctionContext)
			{
				didExport = exportOnRegion((RegionFunctionContext)fc);	
			}
			else
			{
				
				//get region name from argument
				String[] args = (String[])fc.getArguments();
				
				if(args == null || args.length == 0)
					throw new IllegalArgumentException("Region name argument required");
				
				String regionName = args[0];
				
				Cache cache = CacheFactory.getAnyInstance();
				
	
				
				Region<Object,Object> region = cache.getRegion(regionName);
				
				if(region != null)
					didExport = exportRegion(region);
				else
					didExport = false;		
				
			}
			
			rs.lastResult(didExport);
		}
		catch (Exception e)
		{
			
			String stackTrace = Debugger.stackTrace(e);
			
			FunctionException functionException = new FunctionException(stackTrace);
			
			LogManager.getLogger(getClass()).error(stackTrace);
			rs.sendException(functionException);
			throw functionException;
		}
		
	    
	}
public void execute(FunctionContext<Object> fc)
	{
		
		ResultSender<Object> rs = fc.getResultSender();
		try
		{
			boolean didExport = false;
			
			if(fc instanceof RegionFunctionContext)
			{
				didExport = exportOnRegion((RegionFunctionContext)fc);	
			}
			else
			{
				
				//get region name from argument
				String[] args = (String[])fc.getArguments();
				
				if(args == null || args.length == 0)
					throw new IllegalArgumentException("Region name argument required");
				
				String regionName = args[0];
				
				Cache cache = CacheFactory.getAnyInstance();
				
	
				
				Region<Object,Object> region = cache.getRegion(regionName);
				
				if(region != null)
					didExport = exportRegion(region);
				else
					didExport = false;		
				
			}
			
			rs.lastResult(didExport);
		}
		catch (Exception e)
		{
			
			String stackTrace = Debugger.stackTrace(e);
			
			FunctionException functionException = new FunctionException(stackTrace);
			
			LogManager.getLogger(getClass()).error(stackTrace);
			rs.sendException(functionException);
			throw functionException;
		}
		
	    
	}
Export region data in JSON format
@param fc the function context