Skip to Content
Plugin FrameworkVariables reference GuideQuick Reference

Context Variables Quick Reference

Quick lookup for all built-in variables available in your plugins

Variable Summary Table

VariableTypePurposeQuick Example
named_jdbcNamedParameterJdbcTemplateSQL queries with named parameters (recommended)named_jdbc.queryForMap("SELECT * FROM table WHERE id = :id", ["id": 123])
httpPluginHttpClientHTTP requests with retry supporthttp.get("https://api.example.com/data")
filesPluginFileClientFile I/O operationsfiles.read("config.json")
stateStatePlugin-specific persistent storagestate.put("lastBlock", 12345)
global_stateStateGlobal storage shared across pluginsglobal_state.get("networkTip")
envEnvironmentAccess configuration propertiesenv.getProperty("api.key")

Which Variable Should I Use?

For Database Operations

For HTTP/API Calls

For File Operations

For State Management

  • Store data for this plugin only? → Use state
  • Share data between plugins? → Use global_state
  • Need atomic operations? → Both support atomic methods
  • 📖 Full State Management Guide

For Configuration

Common Code Patterns

Database Query with Results

// MVEL - Get count from database params = ["status": "active"]; result = named_jdbc.queryForMap( "SELECT COUNT(*) as count FROM users WHERE status = :status", params ); count = result["count"];

HTTP POST with Retry

// JavaScript - Send webhook with automatic retry const response = http.postJson("https://webhook.site/unique-id", { event: "user_action", count: eventCount });

State with Atomic Counter

// MVEL - Track processed items itemCount = state.increment("items_processed"); if (itemCount % 100 == 0) { log.info("Processed " + itemCount + " items"); }

File Operations with JSON

// JavaScript - Read config and write results const config = files.readJson("config.json"); if (config.isSuccess()) { const settings = config.getData(); // Process with settings... files.writeJson("output.json", results); }
Last updated on