On its host computer, each USoft Rules Service must run on (must be listening at) a port number that is dedicated to it. (The same applies to an SFW server - a server defined in the USoft Services Framework.)
For each Rules Service you need, best practice is to make a clear choice between 2 alternatives. One gives you a temporary Rules Service and the other a permanent Rules Service:
|
Temporary Rules Service
|
Permanent Rules Service
|
Port number range
|
10000 - 99999 (5-digit)
|
1000 - 9999 (4-digit)
|
Create in Blend with
|
pc:RunRulesService
|
pc:ConfigRulesService
|
Choose port number yourself
|
No
|
Yes
|
Register as Windows service
|
No
|
Yes
|
Stops automatically when script ends
|
Yes
|
No
|
Use cases
|
USoft Blend scripts, batch processing
|
Interactive use of USoft application in Production
|
If you run a temporary Rules Service with pc:RunRulesService, USoft Blend will automatically find a so-called transient port number in the 10000-99999 range (5‑digit numbers). This is guaranteed to be a free port number, ie., a port not in use by any other process on the host computer while the Rules Service is running. You do not normally need to access the transient port number, but you can by applying the XPath expression /*/@port to the embedded XML of pc:RunRulesService.
If you create a permanent Rules Service with pc:ConfigRulesService, choose the port number yourself from the 1000-9999 range (4‑digit numbers). This choice is a delicate matter because you must steer clear of ports used by other programs. Port numbers often found to be occupied include 1521 (Oracle), 1433 (SQL Server) and 8080 (Apache). Also, if you are using both Rules Services and SFW servers, these must all use different port numbers.
There is some tradition in the USoft community to use 7777, 7778... for Rules Services and 8090, 8091... for SFW servers.
|
In USoft Blend scripts, for any operation that requires access to a Rules Engine, best practice is to use a temporary and not a permanent Rules Service because:
•A free port number is found automatically. •The Rules Service is automatically cleaned up after use (ie., when your script ends or terminates). An exception to this are Blend scripts whose purpose it is to test runtime application behaviour, because you want such scripts to simulate end user access to specifically configured, permanent Rules Services.
|
Typically you will register (install) a permanent Rules Service as a Windows service. This way, the service will show up in the Services panel, which is a standard Windows administrative tool. You will benefit from manageability and fail-over features visible in this panel.
USoft recommends using the port number as part of the Windows service name, even if this is not common practice for Windows services generally. A consistent naming strategy for Windows services, with port numbers appearing in the names, makes it much easier to manage port numbers occupied by USoft.
Thus, the best Windows service names for USoft Rules Services are RulesService-7777, RulesService-7778 ... The best Windows service names for USoft SFW servers either start with the word "USoft" or with the USoft application name, for example, USoft-TRAVEL-8090, TRAVEL-8090 ...
To install a Rules Service as a Windows service in a USoft Blend script, you typically call pc:ConfigRulesService with the <pc:ServiceInstall/> child element..
To install an SFW server as a Windows service in a USoft Blend script, you typically call pc:ServiceInstall.
|
See also
pc:ConfigRulesService
pc:RunRulesService
Rules Services
|