Groovy web console

subscribe to the feed Subscribe
to this
site

dynamically call method

Published 1 month ago by Rutger
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
ref2300Value = '56414403LA3E0827001'
inputMethodName = 'getGroupAccountCode'

// dynamically call method. In this case getGroupAccountCode but it could also be another method name 
'inputMethodName'(ref2300Value )

def getGroupAccountCode(inputValue){
    //return <first 6 digits>_<last 3 digits> 
}