private void writeTaskBaselines(Project.Tasks.Task xmlTask, Task mpxjTask)
   {
      Project.Tasks.Task.Baseline baseline = m_factory.createProjectTasksTaskBaseline();
      boolean populated = false;

      Number cost = mpxjTask.getBaselineCost();
      if (cost != null && cost.intValue() != 0)
      {
         populated = true;
         baseline.setCost(DatatypeConverter.printCurrency(cost));
      }

      Duration duration = mpxjTask.getBaselineDuration();
      if (duration != null && duration.getDuration() != 0)
      {
         populated = true;
         baseline.setDuration(DatatypeConverter.printDuration(this, duration));
         baseline.setDurationFormat(DatatypeConverter.printDurationTimeUnits(duration, false));
      }

      Date date = mpxjTask.getBaselineFinish();
      if (date != null)
      {
         populated = true;
         baseline.setFinish(date);
      }

      date = mpxjTask.getBaselineStart();
      if (date != null)
      {
         populated = true;
         baseline.setStart(date);
      }

      duration = mpxjTask.getBaselineWork();
      if (duration != null && duration.getDuration() != 0)
      {
         populated = true;
         baseline.setWork(DatatypeConverter.printDuration(this, duration));
      }

      if (populated)
      {
         baseline.setNumber(BigInteger.ZERO);
         xmlTask.getBaseline().add(baseline);
      }

      for (int loop = 1; loop <= 10; loop++)
      {
         baseline = m_factory.createProjectTasksTaskBaseline();
         populated = false;

         cost = mpxjTask.getBaselineCost(loop);
         if (cost != null && cost.intValue() != 0)
         {
            populated = true;
            baseline.setCost(DatatypeConverter.printCurrency(cost));
         }

         duration = mpxjTask.getBaselineDuration(loop);
         if (duration != null && duration.getDuration() != 0)
         {
            populated = true;
            baseline.setDuration(DatatypeConverter.printDuration(this, duration));
            baseline.setDurationFormat(DatatypeConverter.printDurationTimeUnits(duration, false));
         }

         date = mpxjTask.getBaselineFinish(loop);
         if (date != null)
         {
            populated = true;
            baseline.setFinish(date);
         }

         date = mpxjTask.getBaselineStart(loop);
         if (date != null)
         {
            populated = true;
            baseline.setStart(date);
         }

         duration = mpxjTask.getBaselineWork(loop);
         if (duration != null && duration.getDuration() != 0)
         {
            populated = true;
            baseline.setWork(DatatypeConverter.printDuration(this, duration));
         }

         if (populated)
         {
            baseline.setNumber(BigInteger.valueOf(loop));
            xmlTask.getBaseline().add(baseline);
         }
      }
   }
private void writeTaskBaselines ( Project . Tasks . Task xmlTask , Task mpxjTask ) { Project . Tasks . Task . Baseline baseline = m_factory . createProjectTasksTaskBaseline ( ) ; boolean populated = false ; Number cost = mpxjTask . getBaselineCost ( ) ; if ( cost != null && cost . intValue ( ) != 0 ) { populated = true ; baseline . setCost ( DatatypeConverter . printCurrency ( cost ) ) ; } Duration duration = mpxjTask . getBaselineDuration ( ) ; if ( duration != null && duration . getDuration ( ) != 0 ) { populated = true ; baseline . setDuration ( DatatypeConverter . printDuration ( this , duration ) ) ; baseline . setDurationFormat ( DatatypeConverter . printDurationTimeUnits ( duration , false ) ) ; } Date date = mpxjTask . getBaselineFinish ( ) ; if ( date != null ) { populated = true ; baseline . setFinish ( date ) ; } date = mpxjTask . getBaselineStart ( ) ; if ( date != null ) { populated = true ; baseline . setStart ( date ) ; } duration = mpxjTask . getBaselineWork ( ) ; if ( duration != null && duration . getDuration ( ) != 0 ) { populated = true ; baseline . setWork ( DatatypeConverter . printDuration ( this , duration ) ) ; } if ( populated ) { baseline . setNumber ( BigInteger . ZERO ) ; xmlTask . getBaseline ( ) . add ( baseline ) ; } for ( int loop = 1 ; loop <= 10 ; loop ++ ) { baseline = m_factory . createProjectTasksTaskBaseline ( ) ; populated = false ; cost = mpxjTask . getBaselineCost ( loop ) ; if ( cost != null && cost . intValue ( ) != 0 ) { populated = true ; baseline . setCost ( DatatypeConverter . printCurrency ( cost ) ) ; } duration = mpxjTask . getBaselineDuration ( loop ) ; if ( duration != null && duration . getDuration ( ) != 0 ) { populated = true ; baseline . setDuration ( DatatypeConverter . printDuration ( this , duration ) ) ; baseline . setDurationFormat ( DatatypeConverter . printDurationTimeUnits ( duration , false ) ) ; } date = mpxjTask . getBaselineFinish ( loop ) ; if ( date != null ) { populated = true ; baseline . setFinish ( date ) ; } date = mpxjTask . getBaselineStart ( loop ) ; if ( date != null ) { populated = true ; baseline . setStart ( date ) ; } duration = mpxjTask . getBaselineWork ( loop ) ; if ( duration != null && duration . getDuration ( ) != 0 ) { populated = true ; baseline . setWork ( DatatypeConverter . printDuration ( this , duration ) ) ; } if ( populated ) { baseline . setNumber ( BigInteger . valueOf ( loop ) ) ; xmlTask . getBaseline ( ) . add ( baseline ) ; } } }
Writes task baseline data.

@param xmlTask MSPDI task
@param mpxjTask MPXJ task