The executable for the windows service UBIK.EnterpriseService.exe can be found in the installation directory of UBIK® Studio. A windows service can be added using the command line tool sc.exe from Microsoft, detailed information how to use this tool is provided as command line help or can be found on MSDN. Once a windows service has been created and started properly, the UBIK® Enterprise Service processes the corresponding command files and carries out the operations. For more information about command files and interfacing operations in general see Interfacing.
Installation as a Windows Service
To install UBIK® Enterprise Service
- Locate the UBIK.EnterpriseService.exe in your local UBIK® installation directory
- Add a windows service using the command line tool sc.exe where
- <SERVERNAME> is the name of the local machine, eg. MYCOMPUTER
- <PATH_TO> is the installation directory of UBIK®
sc \\<SERVERNAME> create "UBIK Enterprise Service" binPath= "<PATH_TO>\UBIK.EnterpriseService.exe" start= auto DisplayName= "UBIK Enterprise Service"
sc \\<SERVERNAME> description "UBIK Enterprise Service" "UBIK Enterprise Service"
sc \\<SERVERNAME> start "UBIK Enterprise Service"
Use the command line tool sc.exe from Microsoft to add and configure an appropriate windows service! |
Fault Recovery
In case the Enterprise Service crashes for some reason, you can configure an automatic restart.
To do so, open the "Services" app (e.g., using the Windows search). Right-click the respective service entry to open the context menu for it and click "Properties". In the properties dialog, there is a tab "Recovery" where you can configure what to do in case of an unexpected shutdown.
Logging
Especially for complex interfacing tasks, good logging is paramount.
Log entries are really your best way to find out what happens during the execution of an Enterprise Service task. They are also much more versatile than any UI we could provide. So even though it looks cumbersome, logs can help you a lot after you get used to them!
Our best practice recommendation is:
- In the custom code executed by the Enterprise Service, do very detailed logging in critical places (e.g., conditional actions depending on runtime input), especially for exceptional cases (missing or unexpected parameters).
- This detailed logging can be done with log level "Verbose". This way, you can switch it on and off on demand, for debugging - without filling the hard disk with irrelevant logs in production.
- For every log entry, create a randomly generated large number for finding the correct place in the code later. The random number helps you avoiding to maintain an incremental log ID list.