What are Functions - Gnorion/BizVR GitHub Wiki

What are Functions

A function is a predefined operation that takes zero of more inputs and produces one of more outputs. Conceptually its the same idea as a decision table but you don't have to define how they work. BizVR comes with a comprehensive set of function that can be used anywhere inside a decision table - in conditions and in actions. But BizVR does not have every possible function that could exist. However BizVR provides a mechanism for you to import predefined function libraries (written in javascript) that uyou can then use in your decision tables. There are three formats that you can use: INFIX x+=y Adds y to x (or concatenates them if they are strings) x < y Compares x and y returns true if x is smaller than y METHODS - These are convenient if you want to build sequences of operations customerName.contains('SMITH') returns true if the variable customerName has 'SMITH' anywhere within it customerName.toUpper.contains('SMITH') returns true if the uppercase for of customername contains 'SMITH' TRUE FUNCTIONS You can also use the operations in the formal function syntax but this form can be harder to follow if you are nesting fucntion calls contains(customerName,'SMITH') returns true if the variable customerName has 'SMITH' anywhere within it contains(toUpper(customerName),'SMITH') returns true if the uppercase for of customername contains 'SMITH' Its clearer if you says customerNameUP=toUpper(customerName) contains(customerNameUP,'SMITH)