Skip to main content

BankLingo Functions Reference

BankLingo provides a comprehensive set of built-in JavaScript functions that are available within the command execution engine. These functions enable you to interact with the banking system, perform secure operations, manage caching, and more.

Function Categories

🎯 Command Execution

Execute commands and backend operations

  • doCmd() - Execute custom commands
  • doCmd() - Execute native backend commands

🔐 Security & Credentials

Manage secure credentials and access control

  • $.secure.get() - Retrieve encrypted credentials
  • hasRole() / requireRole() - Role-based access
  • hasClaim() / requireClaim() - Claims-based access
  • requireAdmin() / requireAnyRole() - Complex authorization

💾 Memory Cache

High-performance in-memory caching with automatic prefixing

  • $.cache.set() - Store values with expiry
  • $.cache.get() - Retrieve cached values
  • $.cache.remove() - Delete cache entries
  • $.cache.exists() - Check cache existence
  • $.cache.getOrSet() - Get or create pattern

🔐 Cryptographic Functions

Hash and encode data securely

  • sha512() - SHA-512 hashing
  • hmacSha256() - HMAC-SHA256 signing
  • base64Encode() / base64Decode() - Base64 encoding

🔢 Utility Functions

Mathematical and formatting helpers

  • round() - Precision rounding for currencies
  • console.log() / console.error() - Logging (limited)

Quick Start Examples

Execute a Backend Command

var result = doCmd('GetExistingLoanSchedules', {
accountNumber: 'LN00001234'
});

Use Secure Credentials

var apiKey = $.secure.get('PAYMENT_GATEWAY_API_KEY');
var response = callExternalAPI(apiKey);

Cache Expensive Operations

var schedules = $.cache.getOrSet('loan_schedules_' + loanId, function() {
return doCmd('GetExistingLoanSchedules', { loanId: loanId });
}, 300); // Cache for 5 minutes

Compute HMAC Signature

var signature = hmacSha256('secret_key', 'data_to_sign');

Function Availability

All BankLingo functions are available in:

  • ✅ Custom command formulas
  • ✅ Business process scripts
  • ✅ Workflow expressions
  • ✅ Validation rules
  • ✅ Calculated fields

Best Practices

  1. Use caching for expensive operations to improve performance
  2. Validate inputs before passing to backend commands
  3. Handle errors gracefully with try-catch blocks
  4. Use secure storage for sensitive credentials
  5. Test authorization requirements before deploying
  6. Round currency values to avoid floating-point errors

See Also