NewPeriodicTask
Lee D Papworth
8-4-18
Seems my original post has been deleted. So I am posting again and would appreciate some technical advice. (Please do not delete my post)

Erik suggested in a Skype chat with a colleague several weeks ago that we look at using NewPeriodicTask2 rather than the Background Hal routine in Timed Operations.

I cannot get NewPeriodTask2 to work but NewPeriodicTask works but I have several questions.

1) What is the difference between NewPeriodicTask and NewPeriodTask2?
2) In standalone mode running Single User Server I can use these commands ChangeTaskTiming, RemoveTask, TaskExists However in normal client server mode these do not work for me. It is as though it cannot find the task. I use the TaskExists command to check if active before issuing ChangeTaskTiming. Any ideas why these command wouldn't be working in server mode?

For reference I include below the hal code I have for application startup.

external updating function SDProcessUserXml(string);
external updating function SDProcessOrderXml(string);


global
updating procedure OnApplicationStartupComplete()
begin


record SDTradeITBlock SDTBr;
blockload(SDTBr);

inner.OnApplicationStartupComplete;
if (ServerMode or SingleUserMode) then begin
if (SDTBr.UserImportSeconds >0) then begin
NewPeriodicTask("SDProcessUserXml","Auto Import Users","SDProcessUserXml","Auto",SDTBr.UserImportSeconds,"");
Logtext(0,"Starting Timed Task - Auto Import Users");
end;
if (SDTBr.OrderImportSeconds >0) then begin
NewPeriodicTask("SDProcessOrderXml","Auto Import Order","SDProcessOrderXml","Auto",SDTBr.OrderImportSeconds,"");
Logtext(0,"Starting Timed Task - Auto Import Orders");
end;
end;

return;
end;
Giuseppe L.
8-5-18
Hello Lee,
thank you for submitting twice your question. Something should have gone wrong with your previous post.
I apologize for the inconvenience but none has deleted your post intentionally.

We will update you as soon as a programmer will give us the information required.
Stay tuned.

Best regards,
Giuseppe
HansaWorld Italy
Lee D Papworth
8-5-18
Created byGiuseppe L.16:14 5 Aug 2018
Hello Lee, thank you for submitting twice your question. Something should have gone wrong with your previous post. I apologize for the inconvenience but none has deleted your post intentionally. We will update you as soon as a programmer will give us the
Thanks Giuseppe,

I need to implement this in the next week or so. Any help you and the team can give me I would really appreciate it.


Regards

Lee
Giuseppe L.
8-6-18
Hello Lee,
I sent your inquiry to one of our Programmer and his answer is:

1. NewPeriodTask2 runs on a background thread and must be non-updating (use queued and updating to store results)
2. The Task functions work in client-server mode but must be executed where the task exists. So if you have a button to e.g. stop a task it must call a remote procedure that calls RemoveTask.

If you still have problems, it would be better to show each problem with a separate piece of sample code.

Best regards,

Giuseppe
HansaWorld Italy
Lee D Papworth
8-8-18
Created byGiuseppe L.12:41 6 Aug 2018
Hello Lee, I sent your inquiry to one of our Programmer and his answer is: 1. NewPeriodTask2 runs on a background thread and must be non-updating (use queued and updating to store results) 2. The Task functions work in client-server mode but must be exec
Thanks Giuseppe, that makes sense to me.


Regards

Lee
Leave Comment
You can subscribe to notifications for this post by selecting the 'star' icon on the top right corner of the post.
Back to the list
Latest Posts
Reino Botha
Please check your version of android if it is the same as the server you are connecting too. ...
08:24 21 Nov 2024
Bror-Erik Kotiranta
In NC you hace operations>>ai chats. They are used for these Br, Bror-Erik...
05:12 21 Nov 2024