Process data for an individual calendar.

@param row calendar data
324934
public void processCalendar(Row row)
   {
      ProjectCalendar calendar = m_project.addCalendar();

      Integer id = row.getInteger("clndr_id");
      m_calMap.put(id, calendar);
      calendar.setName(row.getString("clndr_name"));

      try
      {
         calendar.setMinutesPerDay(Integer.valueOf((int) NumberHelper.getDouble(row.getDouble("day_hr_cnt")) * 60));
         calendar.setMinutesPerWeek(Integer.valueOf((int) (NumberHelper.getDouble(row.getDouble("week_hr_cnt")) * 60)));
         calendar.setMinutesPerMonth(Integer.valueOf((int) (NumberHelper.getDouble(row.getDouble("month_hr_cnt")) * 60)));
         calendar.setMinutesPerYear(Integer.valueOf((int) (NumberHelper.getDouble(row.getDouble("year_hr_cnt")) * 60)));
      }
      catch (ClassCastException ex)
      {
         // We have seen examples of malformed calendar data where fields have been missing
         // from the record. We'll typically get a class cast exception here as we're trying
         // to process something which isn't a double.
         // We'll just return at this point as it's not clear that we can salvage anything
         // sensible from this record.
         return;
      }

      // Process data
      String calendarData = row.getString("clndr_data");
      if (calendarData != null && !calendarData.isEmpty())
      {
         Record root = Record.getRecord(calendarData);
         if (root != null)
         {
            processCalendarDays(calendar, root);
            processCalendarExceptions(calendar, root);
         }
      }
      else
      {
         // if there is not DaysOfWeek data, Primavera seems to default to Mon-Fri, 8:00-16:00
         DateRange defaultHourRange = new DateRange(DateHelper.getTime(8, 0), DateHelper.getTime(16, 0));
         for (Day day : Day.values())
         {
            if (day != Day.SATURDAY && day != Day.SUNDAY)
            {
               calendar.setWorkingDay(day, true);
               ProjectCalendarHours hours = calendar.addCalendarHours(day);
               hours.addRange(defaultHourRange);
            }
            else
            {
               calendar.setWorkingDay(day, false);
            }
         }
      }

      m_eventManager.fireCalendarReadEvent(calendar);
   }
1091507
public function onInput($row)
    {
        //Process data here
        foreach ($this->params as $copy => $original) {
            $row[$copy] = $row[$original] - Utility::get($this->previousRow, $original, 0);
        }
        $this->previousRow = $row;
        $this->next($row);
    }
885909
public void processPredecessors(List<Row> rows)
   {
      for (Row row : rows)
      {
         Integer currentID = mapTaskID(row.getInteger("task_id"));
         Integer predecessorID = mapTaskID(row.getInteger("pred_task_id"));
         Task currentTask = m_project.getTaskByUniqueID(currentID);
         Task predecessorTask = m_project.getTaskByUniqueID(predecessorID);
         RelationType type = RELATION_TYPE_MAP.get(row.getString("pred_type"));
         Duration lag = row.getDuration("lag_hr_cnt");
         if (currentTask != null)
         {
            Integer uniqueID = row.getInteger("task_pred_id");
            if (predecessorTask != null)
            {
               Relation relation = currentTask.addPredecessor(predecessorTask, type, lag);
               relation.setUniqueID(uniqueID);
               m_eventManager.fireRelationReadEvent(relation);
            }
            else
            {
               // if we can't find the predecessor, it must lie outside the project
               ExternalPredecessorRelation relation = new ExternalPredecessorRelation(predecessorID, currentTask, type, lag);
               m_externalPredecessors.add(relation);
               relation.setUniqueID(uniqueID);
            }
         }
      }
   }
1325570
private void processCalendarHours(ProjectCalendar calendar, Record dayRecord)
   {
      // ... for each day of the week
      Day day = Day.getInstance(Integer.parseInt(dayRecord.getField()));
      // Get hours
      List<Record> recHours = dayRecord.getChildren();
      if (recHours.size() == 0)
      {
         // No data -> not working
         calendar.setWorkingDay(day, false);
      }
      else
      {
         calendar.setWorkingDay(day, true);
         // Read hours
         ProjectCalendarHours hours = calendar.addCalendarHours(day);
         for (Record recWorkingHours : recHours)
         {
            addHours(hours, recWorkingHours);
         }
      }
   }
441496
public void processResources(List<Row> rows)
   {
      for (Row row : rows)
      {
         Resource resource = m_project.addResource();
         processFields(m_resourceFields, row, resource);
         resource.setResourceCalendar(getResourceCalendar(row.getInteger("clndr_id")));

         // Even though we're not filling in a rate, filling in a time unit can still be useful
         // so that we know what rate time unit was originally used in Primavera.
         TimeUnit timeUnit = TIME_UNIT_MAP.get(row.getString("cost_qty_type"));
         resource.setStandardRateUnits(timeUnit);
         resource.setOvertimeRateUnits(timeUnit);

         // Add User Defined Fields
         populateUserDefinedFieldValues("RSRC", FieldTypeClass.RESOURCE, resource, resource.getUniqueID());

         m_eventManager.fireResourceReadEvent(resource);
      }
   }
664629
public void write(Iterable<?> row) throws IOException {
      if (row != null) {
         writer.write(formatter.format(row));
      }
      writer.write(SystemInfo.LINE_SEPARATOR);
   }
1209578
public static void dumpRow(Map<String, Object> row)
   {
      for (Entry<String, Object> entry : row.entrySet())
      {
         Object value = entry.getValue();
         System.out.println(entry.getKey() + " = " + value + " ( " + (value == null ? "" : value.getClass().getName()) + ")");
      }
   }
127272
private function processImportRow(&$row)
    {
        // Get the model to represent this row.
        $model = $this->lookupModel($row);

        // Assign values to the model.
        foreach ($row as $key => $value) {
            if (empty($model->getKey()) || $model->$key !== $value) {
                $model->$key = $value;
            }
        }

        $model->save();

        $this->progress_bar->advance();
    }
1010257
private void processCalendars(APIBusinessObjects apibo)
   {
      for (CalendarType row : apibo.getCalendar())
      {
         ProjectCalendar calendar = m_projectFile.addCalendar();
         Integer id = row.getObjectId();
         m_calMap.put(id, calendar);
         calendar.setName(row.getName());
         calendar.setUniqueID(id);

         StandardWorkWeek stdWorkWeek = row.getStandardWorkWeek();
         if (stdWorkWeek != null)
         {
            for (StandardWorkHours hours : stdWorkWeek.getStandardWorkHours())
            {
               Day day = DAY_MAP.get(hours.getDayOfWeek());
               List<WorkTimeType> workTime = hours.getWorkTime();
               if (workTime.isEmpty() || workTime.get(0) == null)
               {
                  calendar.setWorkingDay(day, false);
               }
               else
               {
                  calendar.setWorkingDay(day, true);

                  ProjectCalendarHours calendarHours = calendar.addCalendarHours(day);
                  for (WorkTimeType work : workTime)
                  {
                     if (work != null)
                     {
                        calendarHours.addRange(new DateRange(work.getStart(), getEndTime(work.getFinish())));
                     }
                  }
               }
            }
         }

         HolidayOrExceptions hoe = row.getHolidayOrExceptions();
         if (hoe != null)
         {
            for (HolidayOrException ex : hoe.getHolidayOrException())
            {
               Date startDate = DateHelper.getDayStartDate(ex.getDate());
               Date endDate = DateHelper.getDayEndDate(ex.getDate());
               ProjectCalendarException pce = calendar.addCalendarException(startDate, endDate);

               List<WorkTimeType> workTime = ex.getWorkTime();
               for (WorkTimeType work : workTime)
               {
                  if (work != null)
                  {
                     pce.addRange(new DateRange(work.getStart(), getEndTime(work.getFinish())));
                  }
               }
            }
         }
      }
   }
1293499
public function beforeInsert(Row $row): void
    {
        foreach ($row->values() as $column => $value) {
            if (null !== $value) {
                $row->changeColumnValue($column, $this->parseKeyIfNeeded($value));
            }
        }
    }
70063
public function process(array $row)
    {
        foreach ($row as &$item) {
            if ($item instanceof DateTimeInterface) {
                $item = $item->format($this->format);
            }
        }

        return $row;
    }
943643
protected void processLink(Row row)
   {
      Task predecessorTask = m_project.getTaskByUniqueID(row.getInteger("LINK_PRED_UID"));
      Task successorTask = m_project.getTaskByUniqueID(row.getInteger("LINK_SUCC_UID"));
      if (predecessorTask != null && successorTask != null)
      {
         RelationType type = RelationType.getInstance(row.getInt("LINK_TYPE"));
         TimeUnit durationUnits = MPDUtility.getDurationTimeUnits(row.getInt("LINK_LAG_FMT"));
         Duration duration = MPDUtility.getDuration(row.getDouble("LINK_LAG").doubleValue(), durationUnits);
         Relation relation = successorTask.addPredecessor(predecessorTask, type, duration);
         relation.setUniqueID(row.getInteger("LINK_UID"));
         m_eventManager.fireRelationReadEvent(relation);
      }
   }
1163513
private void processResourceAssignment(Task task, MapRow row)
   {
      Resource resource = m_resourceMap.get(row.getUUID("RESOURCE_UUID"));
      task.addResourceAssignment(resource);
   }
253939
public function process(array $row)
    {
        foreach ($this->processors as $processor) {
            $row = call_user_func($processor, $row);
        }

        return $row;
    }
242214
protected void processProjectListItem(Map<Integer, String> result, Row row)
   {
      Integer id = row.getInteger("PROJ_ID");
      String name = row.getString("PROJ_NAME");
      result.put(id, name);
   }
1169681
protected void processField(Row row, String fieldIDColumn, String entityIDColumn, Object value)
   {
      processField(row, fieldIDColumn, row.getInteger(entityIDColumn), value);
   }
980091
private void processResources() throws SQLException
   {
      List<Row> permanentRows = getTable("PERMANENT_RESOURCE");
      List<Row> consumableRows = getTable("CONSUMABLE_RESOURCE");

      Collections.sort(permanentRows, PERMANENT_RESOURCE_COMPARATOR);
      Collections.sort(consumableRows, CONSUMABLE_RESOURCE_COMPARATOR);

      m_reader.processResources(permanentRows, consumableRows);
   }