Ejemplo n.º 1
0
 public void signalMatchingData(Program program, Table programTable, TargetModule module) {
   System.out.printf(
       "Program=%s uses %s module.table=%s.%s for %s \n",
       program.getPgmNameAndType(),
       module.getType(),
       module.getName(),
       programTable.getName(),
       program.getCRUDforTable(programTable));
 }
Ejemplo n.º 2
0
  public void signalTableUsageAcrossModules(
      TargetModule module,
      Program program,
      Table table,
      boolean external,
      boolean tocsv,
      boolean toStdOut) {
    try {
      {
        String usageType;
        if (external) {
          usageType = "external";
        } else {
          usageType = "internal";
        }

        if (toStdOut) {
          System.out.printf(
              "%s module.program=%s.%s uses %s %s module.table=%s.%s for %s \n",
              module.getType(),
              module.getName(),
              program.getPgmNameAndType(),
              usageType,
              table.getAssignedModule().getType(),
              table.getAssignedModule().getName(),
              table.getName(),
              program.getCRUDforTable(table));
        }
        // Output to csv-file  as well
        if (tocsv) {
          String module4NameProgram;
          String module4nameTable;
          String newUsageType;

          module4NameProgram = getModule4Name(module.getName());
          module4nameTable = getModule4Name(table.getAssignedModule().getName());

          if (module4NameProgram.equals(module4nameTable)) {
            newUsageType = usageType.concat("_equal_M4");
          } else {
            newUsageType = usageType;
          }

          String line =
              module.getType()
                  + ";module;program;"
                  + getModule4Name(module.getName())
                  + ";"
                  + module.getName()
                  + ";"
                  + program.getName()
                  + ";"
                  + program.getPgmType()
                  + ";uses;"
                  + table.getAssignedModule().getType()
                  + ";"
                  + newUsageType
                  + ";module;table;"
                  + getModule4Name(table.getAssignedModule().getName())
                  + ";"
                  + table.getAssignedModule().getName()
                  + ";"
                  + table.getName()
                  + ";for;"
                  + program.getCRUDforTable(table);
          CSVWriter writer = new CSVWriter();
          writer.writeLineToFile(Constants.CSV_USED, line);
        }
      }
    } catch (Exception e) { // Catch exception if any
      System.out.printf("Error to place table %s in a module \n", table.getName());
    }
  }