Nuclos RuleContext: ContextCache, addContextCacheValue, getContextCacheValue, log, logWarn, logError, server log. |
Language: Deutsch · English
Cross-event rule base – share data between rules via ContextCache and log to the server log.
Auf dieser Seite |
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.
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.
public void addContextCacheValue(String key, Object value); public Object getContextCacheValue(String key); public void removeContextCacheValue(String key); |
Messages are written to the server log by type. Important: even logError does not abort rule execution.
public void log(String message); public void logWarn(String message); public void logError(String message, Exception ex); |