SYSPRO 8 Rules Engine Service
Exploring
 Where it fits in?
Where it fits in?
                                                                        This service processes the data extracted by the SYSPRO 8 Rules Data Service after monitoring the SYSPRO transaction log.
The service is responsible for:
- Processing each log entry relayed by the SYSPRO 8 Rules Data Service service.
- Gathering the required data and calculating the additional values required.
- Evaluating sets of conditional statements.
- Executing all actions required per rule.
This service communicates to the following platforms:
- SYSPRO Espresso
- SYSPRO Avanti
- SYSPRO Bot
This service is used by:
- SYSPRO Rules Engine
- SYSPRO Harmony
 Terminology
Terminology
                                                                         Rule
Rule
                                                                                Rules consist of conditions and actions.
A condition is evaluated and (if true) the SYSPRO Rules Engine initiates the defined actions.
 Rule Action
Rule Action
                                                                                Actions are executed when the conditions of a rule are met.
For example:
These actions range from displaying a Harmony message, to creating a log file in a specific location, or tracking the history of a specific database column.
 Rule Condition
Rule Condition
                                                                                Conditions act as triggers that initiate a specific action according to how they have been configured.
They let you fine-tune a rule with the records to be excluded and when certain actions must be performed (i.e. they act as a set of conditional expressions that must be met before any rule actions are performed).
 Rule Target
Rule Target
                                                                                A rule target indicates the database table to which a rule applies, as well as the operation on that table (e.g. All, Insert, Update or Delete).
Targets can be set as company-specific or system-wide.
 Rule Variable
Rule Variable
                                                                                Variables are used to define or manipulate any values required in the conditions or actions of a rule. The different property packets of a variable include the following:
| Variable | Description | 
|---|---|
| New | Variables that begin with this property packet contain the new values of a record after an insert or update occurs. They are only available for Insert or Update type operations. | 
| Old | Variables that begin with this property packet contain the previous value of a record before an update or delete occurs. They are only available for Update or Delete type operations. | 
| Current | Variables that begin with this property packet contain the current value of a record. This is useful if the record has changed since the SYSPRO 8 Rules Data Service flagged the transaction. Most of the time these values are the same as the New variables. We recommend using the New property packet, as Current variables have a slight overhead. | 
| Global | Variables that begin with this property packet are values related to the transaction, such as: 
 | 
| Var | Variables that begin with this property packet are custom variables that have been defined in the Variables pane of the Rules Administrator program. | 
Starting
 Prerequisites
Prerequisites
                                                                        - Microsoft .NET Framework 4.6
- SYSPRO 8 Service Upgrade Manager
- SYSPRO 8 e.net Communications Load Balancer
 Configuring
Configuring
                                                                        The following setup options must be configured to use this service:
 System Setup
System Setup
                                                                                SYSPRO Ribbon bar > Setup > General Setup
Rules Engine/Harmony
Ensure that you define which companies you want the SYSPRO 8 Rules Engine Service to monitor:
- 
                                                                                            - 
                                                                                                    Active company list 
 
- 
                                                                                                    
Database
Ensure that your SQL credentials are defined as the service uses these settings for its database connections.
- 
                                                                                            Database connection - SQL Server name
 
- 
                                                                                            SQL Server administrative information - Login
- Password
 
 Installation considerations
Installation considerations
                                                                        - 
                                                                                    This service is installed using the SYSPRO Installer. 
Solving
 Debugging and Diagnostics
Debugging and Diagnostics Service Config.exe file
Service Config.exe file
                                                                                You can debug this service by editing the associated config file in elevated mode (i.e. with administrator privileges).
The SYSPRORulesEngineService.exe.config file is located in the in the folder to which you installed the service.
 Windows Event Viewer function
Windows Event Viewer function
                                                                                You can view monitoring and troubleshooting messages about this service using the Event Viewer function in Windows:
(Control Panel > System and Security Administrative Tools > Event Viewer > Applications and Service Logs)
This service outputs an event log to the SYSPRORUL file.
 Windows Services function
Windows Services function
                                                                                You can start, stop, restart and configure this service using the Services function in Windows:
(Control Panel > System and Security Administrative Tools > Services)
 FAQs
FAQs
                                                                         What is the default interval timing?
What is the default interval timing?
                                                                                The SYSPRO 8 Rules Engine Service has the following internal interval loops:
- 
                                                                                            MessageQueueLoop This loop retrieves records highlighted by the SYSPRO 8 Rules Data Service and processes the appropriate rules for each of these transactions. This process evaluates all variables and conditions and prepares a list of actions to process for each rule. The default delay (MessageQueueLoopDelay) for this loop is 10 seconds. 
- 
                                                                                            ActionQueueLoop This loop sequentially processes all the actions queued by the MessageQueueLoop. The default delay (ActionQueueLoopDelay) for this loop is 11 seconds. 
- 
                                                                                            RefreshLoop This loop refreshes all data for the service. This includes updating the list of active rules, checking for a service update, and retrieving the latest database schemas for all active companies. The default delay (RefreshLoopDelay) for this loop is 61 seconds. 
 What is the purpose of the persistence file?
What is the purpose of the persistence file?
                                                                                The actions processed between the MessageQueueLoop and ActionQueueLoop are persisted to the \Temp folder for the Service User.
For example:
C:\Windows\Temp\SYSPRO_8_RulesEngineService_Persistence
This persistence file is used to process any forwarded actions in case the service shuts down before processing all required actions.
 Do I need to restart the service when updating the config file?
Do I need to restart the service when updating the config file?
                                                                                Settings are refreshed with each Refresh Loop, excluding loop delay settings.
Therefore, for changes to loop delays (or to have new settings apply immediately) we recommend refreshing the service.
Using
 Hints and Tips
Hints and Tips
                                                                        - 
                                                                                    Ensure that you restart the service if your Database connection options change (Database tab of the System Setup program). This refreshes the subscriber entry in the RulMessageQueue and clearing the old SQL connection settings. 
Referencing
 Configuration file
Configuration file
                                                                    You should only edit this file for debugging purposes.
Don't use this as a method to update values for the service. This is because a wizard installation updates the system registry, which is what is read when using the service. A fresh installation overwrites these values, which may cause problems when you next run the service.
| Key | Description | 
|---|---|
| BaseDir | This indicates the SYSPRO instance to use when connecting to the SYSPRO 8 e.net Communications Load Balancer service. The default is 8. | 
| MessageQueueLoopDelay (milliseconds) | This indicates how often the service must read the Message Queue table. The default is 10000. | 
| MessageQueueBatch | This indicates how many records the service must retrieve from the Message Queue table. The default is 1000. | 
| ActionQueueLoopDelay (milliseconds) | This indicates how often the service must process the action queue The default is 11000. | 
| ActionQueueBatch | This indicates how many actions the service must action from the Action Queue. The default is 1000. | 
| RefreshLoopDelay (milliseconds) | This indicates how often to refresh data for the service, including: 
 The default is 61000. | 
| Debug specific options | 
 | 
| CreateDetailsLog | This creates an output log in the temp drive = C:\Windows\Temp\SYSPRORulesEngine_Detail_{date}.Log The default is False. | 
| FullErrorLogging | This outputs a full error message including stack trace. The default is False. | 
| MessageQueuePurge | This deletes processed transactions from Message Queue. The default is True. | 
| Debug | This creates extra debug logging lines. For example: Rule ID with Harmony Beat. The default is False. | 
| ConstantRefresh | This refreshes rules before every MessageQueueLoop. This is useful to apply new rules immediately. The default is False. |