Finacle Scripting Syntax Link

# interest_post.fin include "common_functions.fin" var acctList = ["SAV001", "SAV002", "SAV003"] var rate = 4.5

While loop var count = 1 while (count <= 5) print "Iteration: " + count count = count + 1 finacle scripting syntax

for each acct in acctList try var balance = getAccountBalance(acct) if (balance > 0) var interest = calculateInterest(balance, rate, 30) postTransaction("CREDIT", acct, interest) logMessage("INFO", "Interest credited to " + acct) # interest_post

for each acct in accounts print "Processing: " + acct 0) var interest = calculateInterest(balance

| Command | Purpose | Example | |---------|---------|---------| | getCustomerDetails(custId) | Fetch customer info | var cust = getCustomerDetails("C12345") | | getAccountBalance(acctId) | Get balance | var bal = getAccountBalance("SAV001") | | postTransaction(...) | Post a transaction | postTransaction("DEBIT", "SAV001", 1000) | | callService(serviceName, params) | Invoke Finacle service | callService("InterestCalculation", "acctId":"SAV001") | | logMessage(level, text) | Log (INFO/WARN/ERROR) | logMessage("ERROR", "Balance insufficient") | | sleep(ms) | Pause execution | sleep(2000) | 6. Functions function calculateInterest(principal, rate, days) var interest = (principal * rate * days) / 36500 return interest

catch (err) logMessage("ERROR", "Failed for " + acct + " : " + err.message)


Комментарии, обсуждение