We are using older version of HR.Net and did not upgrade to the latest version just yet. So for those who use the fresh version this article will not be very useful, as I believe this is implemented as a standard tool of HR.Net.
For people who are stuck with older version (like us) this will be handy, so keep reading.
On many occasions we were in position where after some event in HR.Net we need to do something out of control of HR.Net. One of examples is creating domain user for new employee: when new employee is hired we wanted a new domain account created automatically. Our version of HR.Net can not do this.
For this exact reason we are using a “trigger” trick: you can set HR.Net trigger on any event inside of the system. So on inserting into PEOPLE table we can have trigger that writes in EXTERNALEVENTS table. This table has standard set of columns plus our parameter-columns (legend, key1, key2, date1, date2, etc).
In SQL Server we have a trigger sitting and listening for everything happening to EXTERNALEVENTS table. And on insert into this table, this table fires off its own logic. For example if a record with legend “New AD-User” goes into this table, trigger know that it needs to launch VisualBasic script that creates a new domain user.
That is just an idea for the technique. I’m not going to go into detailed explanations, this might take very long time to explain. But if you are interested in this, please let me know in comments – I’ll get more details on the pages.
Interesting. I’m interested in doing the opposite as well. That is, writing data into an HR.net table using an external program and getting HR.net to fire a trigger workflow in response. This doesn’t seem to happen by default. Any ideas?
That can be a bit involved, but still possible. Look into `OC_WORKFLOWINSTANCES` table – that is a queue of all unprocessed workflows that are about to be processed. If you put the right info there, you’ll be able to fire a HR.Net worfklow.
Also see this post: https://hrnet.trailmax.info/2017/07/workflow-service-borked-again/ to check out what workflows are actually sitting in your queue just now (hopefully none). Will give you ideas of what and how the data is connected.