public static void handleInitialize(ModuleHandle design, ExecutionContext context) {
   try {
     String scriptText = design.getInitialize();
     Expression.Script scriptExpr = null;
     if (null != scriptText) {
       String id =
           ModuleUtil.getScriptUID(design.getPropertyHandle(IModuleModel.INITIALIZE_METHOD));
       scriptExpr = Expression.newScript(scriptText);
       scriptExpr.setFileName(id);
     }
     if (handleScript(null, scriptExpr, context).didRun()) return;
     IReportEventHandler eh = (IReportEventHandler) getInstance(design, context);
     if (eh != null) eh.initialize(context.getReportContext());
   } catch (Exception e) {
     addException(context, e, design);
   }
 }
 public static void handleOnPrepare(ReportDesignHandle report, ExecutionContext context) {
   try {
     String scriptText = report.getOnPrepare();
     Expression.Script scriptExpr = null;
     if (null != scriptText) {
       String id =
           ModuleUtil.getScriptUID(report.getPropertyHandle(IReportDesignModel.ON_PREPARE_METHOD));
       scriptExpr = Expression.newScript(scriptText);
       scriptExpr.setFileName(id);
     }
     if (handleScript(null, scriptExpr, context).didRun()) return;
     IReportEventHandler eh = (IReportEventHandler) getInstance(report, context);
     if (eh != null) eh.onPrepare(context.getReportContext());
   } catch (Exception e) {
     addException(context, e, report);
   }
 }
 public static void handleBeforeFactory(ReportDesignHandle report, ExecutionContext context) {
   try {
     IDesignElement element = SimpleElementFactory.getInstance().getElement(report);
     IReportDesign reportDesign = new ReportDesign(report);
     String scriptText = report.getBeforeFactory();
     Expression.Script scriptExpr = null;
     if (null != scriptText) {
       String id =
           ModuleUtil.getScriptUID(
               report.getPropertyHandle(IReportDesignModel.BEFORE_FACTORY_METHOD));
       scriptExpr = Expression.newScript(scriptText);
       scriptExpr.setFileName(id);
     }
     if (handleScript(element, scriptExpr, context).didRun()) return;
     IReportEventHandler eh = (IReportEventHandler) getInstance(report, context);
     if (eh != null) eh.beforeFactory(reportDesign, context.getReportContext());
   } catch (Exception e) {
     addException(context, e, report);
   }
 }