Service to wait for period of time

Hi Team,

We are trying to send a fax through webMethods using the fax server. They are exposing two webservices. One is to send a fax and another is to get the fax result (Pass/Fail) back.

The problem is after specified period of time only they can able to send the result back (after 10 mins). If you are accesing the web service to get the result before 10 min, it will return some unexpected result.

for eg they are having some 21 status like, preparing fax, preparing cover sheet, trying to send, retrying, etc… So if you try to get the result back before 10 min, you wont get the proper result as Pass/Fail.

I dont want to put a step like Sleep or Stall to hold the thread for long time. Because if there are more request at the same time it will end up in a thread pool empty condition.

Is there any way to create a task or scheduler as out of box feature to achieve this.

Thanks in advance.
Vijayakumar B

You can use the scheduler services.
adding a run-once scheduled job (WmPublic/pub.scheduler:addOneTimeTask) to run 10min later, with the parameter you want.

Based on this, it isn’t an “unexpected result” but rather a status which you can reasonably check in your code to distinguish in-progress vs. failed.

You can use the scheduler services to create one-time tasks within your code.

There are also other approaches but those would require other components that it sounds like you may not have/want to use. E.g. Modeler/BPM, TN.

Hi V1254788 ,

You can use Java service .
and in code use. Thread.sleep(Timeto wait);

it will wait for that time priode you menation.