Nuclos RuleContext: ContextCache, addContextCacheValue, getContextCacheValue, log, logWarn, logError, server log.

globe with meridians Language: Deutsch · English

open book RuleContext

Cross-event rule base – share data between rules via ContextCache and log to the server log.

Auf dieser Seite

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.

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.

public void log(String message);

public void logWarn(String message);

public void logError(String message,  Exception ex);

Related pages

open book Server-side rules


Rules.

Öffnen →

clipboard Events and event rules


Events.

Öffnen →