protected function addWorkPackage($name, $size, array $oids, $callback, $args=null) {
    $request = $this->getRequest();
    $response = $this->getResponse();
    if (strlen($callback) == 0) {
      throw new ApplicationException($request, $response,
              ApplicationError::getGeneral("Wrong work package description '".$name."': No callback given."));
    }

    $workPackages = $this->getLocalSessionValue(self::PACKAGES_VAR);
    $counter = 1;
    $total = sizeof($oids);
    while(sizeof($oids) > 0) {
      $items = [];
      for($i=0; $i<$size && sizeof($oids)>0; $i++) {
        $nextItem = array_shift($oids);
        $items[] = sprintf('%s', $nextItem);
      }

      // define status text
      $start = $counter;
      $end = ($counter+sizeof($items)-1);
      $stepsText = $counter;
      if ($start != $end) {
        $stepsText .= '-'.($counter+sizeof($items)-1);
      }
      $statusText = "";
      if ($total > 1) {
        $statusText = $stepsText.'/'.$total;
      }

      $curWorkPackage = [
        'name' => $name.' '.$statusText,
        'oids' => $items,
        'callback' => $callback,
        'args' => $args
      ];
      $workPackages[] = $curWorkPackage;
      $counter += $size;
    }
    $this->workPackages = $workPackages;

    // update session
    $this->setLocalSessionValue(self::PACKAGES_VAR, $workPackages);
    $this->setLocalSessionValue(self::NUM_STEPS_VAR, sizeof($workPackages));
  }