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 commandsdoCmd()- 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 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 hashinghmacSha256()- HMAC-SHA256 signingbase64Encode()/base64Decode()- Base64 encoding
🔢 Utility Functions
Mathematical and formatting helpers
round()- Precision rounding for currenciesconsole.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
- 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 →