Restart HR.Net services

HR.Net is full of WTF moments. This whole blog is based on these moments: from ancient version of jQuery to obscure bugs in places where “things should just work”.

This time I run into Workflow service that sometimes gets stuck: the actual windows service gets hanged and stop responding and processing any new workflows. But the whole system heavily depends on workflows being processed in a timely manner, the system just crashes and I have a lot of unhappy customers calling me in panic. The fix is simple – restart the workflow service. Though the fix does not show signs of life – it works. HR.Net queues workflows in a table and the service picks up one workflow at a time and runs it. Usually by the time I get a phone call there are hundreds of unprocessed workflows already and the service needs some time to crunch through them. This bit of SQL will show you how many workflow instances are there

select count(*) from OC_WORKFLOWINSTANCES
where STARTEDDATETIME > '2017-07-10 00:00:00.000'

replace the date with your current date to show how many have been queued during your day.

Solution to this problem is to restart HR.Net Workflow Service regularly. Do this via commands:

net stop " Workflow Service"
net Start " Workflow Service"

Put this as a scheduled task and be done with this. I’ve scheduled this command to be executed every hour, but I suggest you start from every 24 hours. I already had HR.Net Reports service restarted every hour because it caused problems too. And I’ve included workflow service there as well to save myself some typing -)

So my whole bat file looks like this:


net stop " Reports Service"
net stop " Workflow Service"

net Start " Reports Service"
net Start " Workflow Service"

This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

4 Responses to Restart HR.Net services

  1. Anonymous says:

    Good to see you back, Sir.

    • admin says:

      I’ve not really been away. Just not been doing anything new in HR.Net. My other blog is a lot more active with more up-to-date technologies

Leave a Reply

Your email address will not be published. Required fields are marked *