Rules
Rules are programmable scripts that can be used to customize and override logic from their default behaviour. Basically, each individual atomic operation can be extended over overridden to accomodate.
Rules are technically also known as AtomicScripts, as how they're defined in the Core API reference.
Configuration of Rules
Atomic Script Type
Determines if it runs before running default logic, of after. For example, when executing GetPrice(), if you set this to Before it will allow you to intercept and make changes before the Heart.work data store fetches for prices. Setting it to After will allow you to manipulate the data store response.
Continue on Error
Flag to hault if any error occurs on false, or when true: swallows the error and continues.
Continue on error can cause side effects if not handled properly.
Rules: Type
Atomic (event topic) name to subscribe to.
Script
The actual code for the script. Technically this spins up on on-demand ClearScript engine, allowing csharp or JavaScript code to be dynamically executed.
Timeout
Specify a mandatory timeout, in milliseconds.
Remarks & Gotchas
- Use Rules only if you know exactly what you're doing!
- Be careful with rules: you can pretty much override all operations individually to do whatever you want. But with such great power comes great responsibility.
- Timeouts and delays are real: having a slow performing rule, for example when calling an external system, can slow down all processes that consume the same atomic.