Example of a Decision Using Functions and Methods - Gnorion/BizVR GitHub Wiki

Example of Decisions using Functions and Methods

image

Main Decision Table - Determines Tax

The use of {toy in TOYS where type='game'} will cause the rules to be applied to every instance of toy that is a game.

The price of each toy is determined by invoking the function determinePrice passing it a single instance of TOY.

image

Function to Determine Price

This function invokes the instance method determineSize() on the instance of TOY. No arguments are passed to the method. The parentheses are required to distinguish the method from a property.

image

Method to Determine Size

This instance method determines the size of a TOY based on its length, height and weight. image