pc:ConfigRulesService

Previous Next

Configures a named Rules Service with an encrypted password and, optionally, installs and starts that Rules Service. Also, optionally, first stops and uninstalls a (differently configured) Rules Service previously running on the same port. To run an anynomous Rules Service, use pc:RunRulesService instead.

If you supply a port number (recommended), the configuration step consists of writing a configuration file in the USoft BIN directory, silently overwriting any existing file with the same name. There is no return value.

If you do not supply a port number, no configuration file is produced. Instead, there is a return value: what would be the configuration file's contents is returned as a text document.

You can base your new configuration file on an existing configuration file.

Calling pc:ConfigRulesService may be compared to configuring a Rules Service manually through the ure.config wizard accessible from USoft Binder's Rules Service item.

 

Syntax

<pc:ConfigRulesService

         port="{ port-number freeport }"

         application="application"

         user="user"

         owner="owner"

         {password|pwd}="pwd"

         rdbms="{jdbc|oledb|oracle}"

         dbconnectstr="dbconnectstr"

 

         alias="name-literal"

         select="templatefile"

 

         messagemode="messagemode"

         tls="tls"

         peerlist="peerlist"

         autostart="autostart"

         definitionsfrom="definitionsfrom"

         flatfilelocation="flatfilelocation"

 

         languages="languages"

         decisions="decisions"

         interval="interval"

         idletimeout="idletimeout"

         servertimeout="servertimeout"

 

         loglevel="loglevel"

         {logdirectory|logdir}="logdir"

         logfilenameprefix="logfilenameprefix"

         minengines="minengines"

         maxengines="maxengines"

 

  {    

     <pc:RunRulesService/> |

 

     <pc:ServiceStop/>

     <pc:ServiceUninstall/>

     <pc:ServiceInstall/>

     <pc:ServiceStart/>

  }

 

/>

 

templatefile        ::=  path

 

message-mode        ::=  { developer | enduser }

tls                 ::=  { yes | no }

autostart           ::=  { yes | no }

definitionsfrom     ::=  { Auto | DictTable | DictLocated }

flatfilelocation    ::=  { null | path }

 

languages           ::=  { DEFAULT | language-name }

decisions           ::=  { null | decision-name }

interval            ::=  { 0   | integer }

idletimeout         ::=  { 0   | integer }

servertimeout       ::=  { 600 | integer }

 

loglevel            ::=  { No Logging | Error | Information | Debug }

logdir              ::=  { usoft-log-dir\rules_engine | absolute-path }

logfilenameprefix   ::=  { application name-literal }

minengines          ::=  { 1  | integer }

maxengines          ::=  50 | integer }

For the port attribute, typically you choose a 4‑digit port number (eg., 7777). This must be a port number not occupied by any other program on the host computer. An alternative option NOT GENERALLY RECOMMENDED is to specify port=freeport, in which case USoft Blend will assign a transient port number to the Rules Engine.

The configuration file is generated in the following location and with the following filename:

usoft-bin-dir\RulesService-port.config

 

where usoft-bin-dir is the directory returned by:

SELECT RulesEngine.GetProperty( 'BinDir' )

 

and port is the value that you choose for the port attribute. If you omit the port attribute, no configuration file will be generated but instead, what would be its content is returned as a return value.

The required password is the human-readable version of the password that will be stored in encrypted form in the configuration file.

The optional alias attribute allows you to specify a string that can be used as a handle for referring to the configured Rules Service in subsequent calls. If you do not pass alias, then the configured Rules Service can still be referenced by an internal name traceable by pointing at the alias attribute of the directive's embedded XML. If you plan to install the Rules Service as a Windows service you can refer to the name of the Windows service, so that in this case you may not need an alias. The alias value is allowed to be any literal string value.

The optional select may be used to point at an existing .config file from which you want to copy configuration settings. See "Configuring a Rules Service on the basis of an existing file".

In addition to writing a configuration file, you can start a Rules Service with the configuration described. If you want to do this WITHOUT declaring the Rules Service as a Windows service, include the following child directive:

<pc:RunRulesService />

 

To start the Rules Service as a Windows service, include one or more of the optional child directives instead, as necessary. (If the Windows service is new, all you need is to install and start it. If it already exists, but with a now obsolete configuration, then you want to stop and then uninstall it first.)

<pc:ServiceStop/>

<pc:ServiceUninstall/>

<pc:ServiceInstall/>

<pc:ServiceStart>

 

In this use, the <pc:RunRulesService> and the 4 <pc:Service...> directives must have empty content and they must be direct child elements of <pc:ConfigRulesService>, not grandchildren or descendent elements at a lower level.

When you install a Windows service in this way, the Rules Service is installed as a Windows service by the following name:

RulesService-port

 

The list of possible attributes of pc:ConfigRulesService corresponds to the list of Rules Service settings that you can set in USoft Binder's Rules Service Property Sheet and in the ure.config wizard. Details are in the "Manual configuration..." section below.

For each optional attribute, if you omit the attribute, the indicated default will be applied.

Flatfilelocation is only allowed to be other than null if you set definitionsfrom to DictLocated.

If you omit logdir, the log directory will be set to the rules_engine subdirectory of the USoft log directory that you chose during Setup.

If you omit logfilenameprefix, the Logfile Name Prefix will be set to the value that you pass for the application attribute.

 

See also

Choosing a port number for a Rules Service

Configuring a Rules Service on the basis of an existing file

Manual Rules Service configuration

pc:RunRulesService

pc:ServiceInstall

pc:ServiceStart

pc:ServiceStop

pc:ServiceUninstall