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
Hello, Thank you very much for the help. Best Regards, Daniel...
07:07 28 Apr 2024
Andis Blicāns, Grasko
Hi, We have client using 8.5 2021-09-26 (build 85400383). The fields "Max Web Users" and "Max Sessions" ar blank. Server is closing itself almost every day. Message in hansa....
15:52 26 Apr 2024