| Auszug |
|---|
|
Nuclos RuleContext: ContextCache, addContextCacheValue, getContextCacheValue, log, logWarn, logError, server log. |
Language: Deutsch · English
RuleContext
Cross-event rule base – share data between rules via ContextCache and log to the server log.
| Status |
|---|
| colour | Green |
|---|
| title | Updated: Jul 2026 |
|---|
|
| Status |
|---|
| colour | Grey |
|---|
| title | applies to Nuclos 4.2026.x |
|---|
|
What is the RuleContext?
The RuleContext is the base of almost every context in rules (except the JobContext). It offers event-independent core functions – regardless of whether saving, deleting or updating.
ContextCache
When several rules run within one event (e.g. saving), you can store objects in the context cache and read them back in another rule. The cache only lives during the event – afterwards it is discarded.
| Codeblock |
|---|
|
public void addContextCacheValue(String key, Object value);
public Object getContextCacheValue(String key);
public void removeContextCacheValue(String key); |
Logging
Messages are written to the server log by type. Important: even logError does not abort rule execution.
| Codeblock |
|---|
|
public void log(String message);
public void logWarn(String message);
public void logError(String message, Exception ex); |
Related pages
Events and event rules
Events.
Open →