public static function add($params)
 {
     $expression = $params->get('expression');
     $name = $params->get('name');
     $task = $params->get('task');
     $description = $params->get('description');
     $parameters = $params->get('parameters');
     try {
         $result = Jobs::addToScheduler($expression, $name, $task, $description, $parameters);
     } catch (Exception $e) {
         throw new RpcException($e->getMessage(), -31001);
     }
     return $result;
 }
 private function add($name, $expression, $task, $description, $parameters, $enable)
 {
     $parameters = self::processParameters($this->color, $parameters);
     try {
         $result = SourceJobs::add($expression, $name, $task, $description, $parameters, $enable);
     } catch (Exception $e) {
         throw $e;
     }
     $id = $result["id"];
     $nextrun = $result["nextrun"];
     $enabled = $result["enabled"];
     if ($enabled) {
         return $this->color->convert("\n%gJob added and activated (id: " . $id . "); next calculated runtime: " . $nextrun . "%n");
     } else {
         return $this->color->convert("\n%gJob added but not activated (id: " . $id . ").%n");
     }
 }