User Tools

Site Tools


Sidebar



en:objects:scheduler:one_task:edit

edit

edit($num_task,$path,$type=0,$date="",$time="",$count=-1,$active=true,$comments="",$add_params=""); - change the task data with the specified number in the script schedule

The function accepts parameters as input:

  • $num_task – task number
  • $path – new path to the script being executed
  • $type – new task type :

      • 0 - once
      • 1 - Once an hour
      • 2 - Once a day
      • 3 - once a week
      • 4 - once a month
      • 5 - once a year
      • 6 - optional
      • 7 - Times per minute
      • 8 Times in 5 minutes
      • 9 - every 10 minutes
      • 10 - Times in half an hour
      • 11 - N times
      • 12 - endlessly
  • $date – date - format system - for example 07/03/15
  • $time – time - format system - for example 08:01:02
  • $count – the new number of launches
  • $active – new activity tasks
  • $comments – comments
  • $add_params – additional information to the task selection - after how many minutes to run zaadchu (available from 4.10.6)

    After testing, the function returns the result of its work to the script :
  • true – completed successfully
  • true – failed

    PHP example:

    <?php $xhe_host = "127.0.0.1:7010";
     
    //connect the object to control the emulator, if not already connected
    if(!isset($path))
       $path = "../../../Templates/xweb_human_emulator.php";
    require($path);
     
    //Start
    echo "<hr> <font color = blue> window->".basename(__FILE__)."</font> <hr>";
     
    //1
    echo "1.Get the zero problem:";
    echo $scheduler->get(0, $path, $type, $date, $time, $count, $active, $comments, $add_param)."<br>";
     
    //2
    echo "2.Let's edit the zero problem:";
    $next_time = date("H: i: s", time() + 200);
    $new_date = date("Y-m-d");
    $add_param = 15;
    echo $scheduler->edit(0, $path, $type, $new_date, $next_time, $count, true, $comments, $add_param);
     
    //$app->restart('', '', $app->get_port());
     
    //end
    echo "<hr> <br>";
     
    //Quit
    $app->quit();
    ?>

    Python example:

    # Additional paths
    import sys
    sys.path.insert(0, '../../../Templates PY/')
     
    xhe_host = "127.0.0.1:7010"
    from xweb_human_emulator import *
     
    # Start
    echo("<hr> <font color = blue> scheduler.xxxxxxxxx </font> <hr>")
     
    # 1
    echo("1.Get the zero problem:")
    path, type, date, time, count, active, comments, add_param = scheduler.get(0)
    echo(scheduler.get(0), "<br>")
     
     
    # 2
    echo("2.Let's edit the zero problem:")
    add_param = 15
    comments = comments + "edited"
    echo(scheduler.edit(0, path, type, date, time, count, true, comments, add_param))
     
    # app.restart('', '', app.get_port()))
     
    # end
    echo("<hr> <br>")
     
    # Quit
    app.quit()

    C# example:

    #region using
     
    using System;
    using System.Diagnostics;
    using System.Collections.Generic;
    using System.Linq;
    using System.IO;
    using System.Text;
    using System.Threading;
     
    using XHE;
    using XHE.XHE_DOM;
    using XHE.XHE_System;
    using XHE.XHE_Window;
    using XHE.XHE_Web;
     
    #endregion
     
      class Program: XHEScript
      {
    static void Main(string [] args)
    {
    //init XHE
    server = "127.0.0.1:7015";
    InitXHE();
     
    //Start
    echo("<hr> <font color = blue> scheduler.clear_tab_content </font> <hr>");
     
    //1 step
    echo("1.Let's edit the zero problem:");
    echo(scheduler.edit(0, "test 0.php", 0, "2015.07.10", "10: 2: 3", - 1, true, "task 10"));
     
    //end
    echo("<hr> <br>");
     
    app.quit();
    }
    }

    Java Script example:

    //connect the object to control the emulator, if not already connected
    xhe_host = "127.0.0.1:7011";
    echo = require("../../../Templates JS/xweb_human_emulator.js");
     
    //Start
    echo("<hr> <font color = blue> window.edit </font> <hr>");
     
    //1 step
    echo("1.Get the zero problem:");
    var task = new Array(7);
    echo(scheduler.get(0, task) + "<br>");
     
    //get from the array - task data
    var path_, type, date, time, count, active, comments;
    path_ = task [0];
    type = task [1];
    date = task [2];
    time = task [3];
    count = task [4];
    active = task [5];
    comments = task [6];
     
    //display task data
    echo("path =" + path_);
    echo(" ntype =" + type);
    echo(" ndate =" + date);
    echo(" ntime =" + time);
    echo(" ncount =" + count);
    echo(" nactive =" + active);
    echo(" ncomments =" + comments);
     
    //step 2
    echo(" n2.Let's edit the zero problem:");
    var timeInMs = new Date(Date.now() + 900000);//now + 90 second
    var new_date = timeInMs.getFullYear() + "-" + timeInMs.getDate() + "-" + timeInMs.getMonth();
    var new_time = timeInMs.getHours() + ":" + timeInMs.getMinutes() + ":" + timeInMs.getSeconds();
    console.log(new_date);
    console.log(new_time);
    echo(scheduler.edit(0, "path", "type", new_date, new_time, count, false, "comments"));
     
    //end
    echo("<hr> <br>");
     
    //Quit
    app.quit();
  • en/objects/scheduler/one_task/edit.txt · Last modified: 2026/08/05 22:47 (external edit)