Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

How to wait until OnRunFinished is executed

 Post Reply Post Reply
Author
Adrian Morawiec View Drop Down
New Member
New Member
Avatar

Joined: 29 Dec 2015
Posts: 22
Post Options Post Options   Quote Adrian Morawiec Quote  Post ReplyReply Direct Link To This Post Topic: How to wait until OnRunFinished is executed
    Posted: 27 Jan 2017 at 12:11pm
I do change taskInstance status onside a loop

while not dataset.eof do
begin
WorkflowStudio.TaskManager.LoadTaskInstance(taskInstance);
taskInstance.Status := pStatus;
WorkflowStudio.TaskManager.SaveTaskInstance(taskInstance);
end;

But I have some code on WorkflowStudio.OnRunFinished.
My loop change status faster than WorkflowStudio.OnRunFinished is executed;

How to force my loop to wait until the OnRunFinished event ends?


I tried add boolean variable on OnRunFinished and inside my loop I added empty while loop
 while not task_completed do; but the loop blocks my whole application and OnRunFinished event never execute!


Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2402
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 27 Jan 2017 at 12:52pm
You can't do that currently because the instances are signaled to run and they only execute on main thread (after your loop finished and execution goes idle).
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down