1

error 4 exec core batch with clean up resul

Тема: error 4 exec core batch with clean up resul

Hello, i execute my report with sdk wialon php by core batch but when i clean the result report show me error 4.

When i send the request (batch) without cleanup_result_report the batch request  funtionally fine.

When i'm try send the request batch only with cleanup report resul and again get error 4.

When i'm send the request (cleanup result) whitout bath funcionally fine.

i have try it for 2 and always get error 4.

way1  [{"svc":"report\/cleanup_result","params":[]}]
way 2 : [{"svc":"report/cleanup_result","params":[]}]


Thanks in advantaje.

2

error 4 exec core batch with clean up resul

(15/12/2016 11:49:22 отредактировано deal)

Re: error 4 exec core batch with clean up resul

cerpas, report/cleanup_result request in batch is workin correctly:

https://hst-api.wialon.com/wialon/ajax.html?svc=core/batch&params=[{"svc":"report/cleanup_result","params":{}}]&sid=<sid>

But there is no need to call one request in batch. It is usefull to combine numerous requests in one batch.

Head of Wialon Local Department
Gurtam
3

error 4 exec core batch with clean up resul

Re: error 4 exec core batch with clean up resul

My user is desarrollador, I am use the sdk php.

For me is not working

http://hst-api.wialon.com/wialon/ajax.h … mp;params=[{"svc":"report\/exec_report","params":{"reportResourceId":23125,"reportTemplateId":0,"reportObjectId":13846903,"reportObjectSecId":0,"interval":{"flags":0,"from":1481608800,"to":1481867999},"reportTemplate":{"n":"Dispatch Fuel","ct":"avl_unit","p":"","tbl":[{"n":"unit_engine_hours","l":"Fuel","f":2097424,"c":"time_begin,time_end,trailer,fuel_consumption_imp,fuel_consumption_ins","cl":"Beginning,End,Trailer,By Impulse,By Instant","sl":"","s":"","p":"{\"grouping\":\"{\\\"type\\\":\\\"day\\\"}\",\"sensor_name\":\"*Fuel Dispensado*\",\"duration_format\":\"0\"}","sch":{"y":0,"m":0,"w":0,"f1":0,"f2":0,"t1":0,"t2":0}}]}}},{"svc":"report\/select_result_rows","params":{"tableIndex":0,"config":{"type":"range","data":{"from":0,"to":65535,"level":1}}}},{"svc":"report\/cleanup_result","params":[]}]&sid=<sid>

But i remove the request cleanup result it's works fine

http://hst-api.wialon.com/wialon/ajax.h … mp;params=[{"svc":"report\/exec_report","params":{"reportResourceId":23125,"reportTemplateId":0,"reportObjectId":13926449,"reportObjectSecId":0,"interval":{"flags":0,"from":1481608800,"to":1481867999},"reportTemplate":{"n":"Dispatch Fuel","ct":"avl_unit","p":"","tbl":[{"n":"unit_engine_hours","l":"Fuel","f":2097424,"c":"time_begin,time_end,trailer,fuel_consumption_imp,fuel_consumption_ins","cl":"Beginning,End,Trailer,By Impulse,By Instant","sl":"","s":"","p":"{\"grouping\":\"{\\\"type\\\":\\\"day\\\"}\",\"sensor_name\":\"*Fuel Dispensado*\",\"duration_format\":\"0\"}","sch":{"y":0,"m":0,"w":0,"f1":0,"f2":0,"t1":0,"t2":0}}]}}},{"svc":"report\/select_result_rows","params":{"tableIndex":0,"config":{"type":"range","data":{"from":0,"to":65535,"level":1}}}}]&sid=<sid>

I'll try execute only cleanup result is not working

http://hst-api.wialon.com/wialon/ajax.h … mp;params=[{"svc":"report\/cleanup_result","params":[]}]&sid=<sid>

Request fail if I include a clean up result report, I dont understand because its happens.

Thank you so much of your time.

4

error 4 exec core batch with clean up resul

Re: error 4 exec core batch with clean up resul

cerpas, instead of "params":[] use "params":{}.

Head of Wialon Local Department
Gurtam
5

error 4 exec core batch with clean up resul

Re: error 4 exec core batch with clean up resul

deal пишет:

cerpas, instead of "params":[] use "params":{}.

I got it, thank you so much.

6

error 4 exec core batch with clean up resul

Re: error 4 exec core batch with clean up resul

deal пишет:

cerpas, instead of "params":[] use "params":{}.

but this error is from sdk

7

error 4 exec core batch with clean up resul

Re: error 4 exec core batch with clean up resul

cerpas, when You call such request everything is fine:

var res = wialon.core.Session.getInstance().getItem(555);
wialon.core.Remote.getInstance().startBatch("cleanupBatch");
res.cleanupResult();
wialon.core.Remote.getInstance().finishBatch(null, "cleanupBatch");
Head of Wialon Local Department
Gurtam
8

error 4 exec core batch with clean up resul

Re: error 4 exec core batch with clean up resul

deal пишет:

cerpas, when You call such request everything is fine:

var res = wialon.core.Session.getInstance().getItem(555);
wialon.core.Remote.getInstance().startBatch("cleanupBatch");
res.cleanupResult();
wialon.core.Remote.getInstance().finishBatch(null, "cleanupBatch");

Yes with JS SDK is fine, but SDK PHP is not working fine.

9

error 4 exec core batch with clean up resul

Re: error 4 exec core batch with clean up resul

Here's 3 variants of working code

    # ?params=[]
    $params = array();
    $result = $wialon_api->report_cleanup_result(json_encode($params));
    echo "<p>$result</p>";
    # echo: {"error":0}

    # ?params={}
    $params = new ArrayObject();
    $result = $wialon_api->report_cleanup_result(json_encode($params));
    echo "<p>$result</p>";
    # echo: {"error":0}

    # core/batch, ?params=[{svc:'report/cleanup_result',params:{}}]
    $params = array();
    array_push($params, array(
        svc=>'report/cleanup_result',
        params=>new ArrayObject()
    ));
    $result = $wialon_api->core_batch(json_encode($params));
    echo "<p>$result</p>";
    # echo: [{"error":0}]