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 commandsdoBackend()- Execute native backend commands
🔐 Security & Credentials
Manage secure credentials and access control
$.secure.get()- Retrieve encrypted credentialshasRole()/requireRole()- Role-based accesshasClaim()/requireClaim()- Claims-based accessrequireAdmin()/requireAnyRole()- Complex authorizationgetUserRoles()/getUserClaims()/getUserClaimsByType()- Inspect the current identity
💾 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 hashinghmacSha256()- HMAC-SHA256 signingbase64Encode()/base64Decode()- Base64 encoding
🔢 Utility Functions
Mathematical and formatting helpers
round()- Precision rounding for currenciesnumberToWords()- Convert a non-negative number into English wordsconsole.log()/console.warn()/console.error()- Formula diagnostics
🧰 Formula Helpers
Helpers injected into standard command-formula execution
- Null and object helpers:
isNullOrEmpty(),coalesce(),safeGet(),generateUUID() - Date helpers:
now(),addDays(),diffDays(),formatDate() - String helpers:
toUpper(),toLower(),trim(),contains(),replaceAll(),slugify() - Numeric helpers:
round(),toFixed(),percentageOf() - Validation helpers:
isEmail(),isPhoneNumber(),isNumber(),isDate() - Business errors:
BpmnError
📊 List and Monitoring Helpers
Specialized helpers for ExecuteListExpressionAsync
- Windowed transaction functions:
txnCount(),txnSum(),txnAvg() - Behavior and anomaly functions:
isNewValue(),amountZScore(),isAbovePercentile() - Device, merchant, channel, and location analysis functions
🏦 Loan Request ID Generation
Internal loan-origination utility
LoanRequestIdGenerator.Generate()- Creates a readable, unique request ID from the persistedLoanQuote.Id- Used automatically by self-service and administrator loan-creation commands
- Not callable from JavaScript execution-engine scripts
Quick Start Examples
Execute a Backend Command
var result = doBackend('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
Availability depends on which JavaScript runtime evaluates the expression:
| Execution context | Available functions |
|---|---|
Command formulas and ExeFormula | Base engine functions plus Formula Helpers |
BPMN formula execution through ExecuteFormulaWithLogsAsync | Base engine functions plus Formula Helpers |
Monitoring rules through ExecuteListExpressionAsync | Base engine functions plus List and Monitoring Helpers |
| Dual/reconciliation formulas | Base engine functions only |
| Process-trigger conditions | Standard JavaScript and context only |
| Browser/client scripts | No server-side BankLingo functions |
Base engine functions include command dispatch, security and identity helpers,
cache and secure access, cryptography, numberToWords(), round(), and
BpmnError.
Best Practices
- Use caching for expensive operations to improve performance
- Validate inputs before passing to backend commands
- Handle errors gracefully with try-catch blocks
- Use secure storage for sensitive credentials
- Test authorization requirements before deploying
- Round currency values to avoid floating-point errors
Navigation
- Command Execution Functions →
- Security & Credentials →
- Memory Cache Functions →
- Cryptographic Functions →
- Utility Functions →
- Formula Helper Functions →
- List and Monitoring Expression Helpers →
- numberToWords →
- Loan Request ID Generation →