Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.
Auszug
hiddentrue

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.

Status
colourGrey
titleReferenz
Status
colourBlue
titleDeveloper
Status
colourGreen
titleUpdated: Jul 2026
Status
colourGrey
titleapplies to Nuclos 4.2026.x

Panel
bgColor#F4F5F7

On this page

Inhalt
maxLevel2
minLevel2

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
languagejava
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
languagejava
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.

Open →

clipboard Events and event rules


Events.

Open →