Skip to content
anymaker edited this page Oct 24, 2020 · 6 revisions

The calculations are based on a universal formula in which you can use functions and data fields of an object.
You can create your own functions and define your own data extraction methods.

You can use the formula in the following scenarios:

  • Simple calculation
  • Calculation using variable data
  • Search in hierarchy data
  • Generate SQL for relational database
  • Complex search for files and folders in the file system
  • And many others.

For example, the formula might look like this:

1 + 2
'sum: ' + .fieldB + .fieldC.fieldA  
count(.game.participants(.role = 'Approval')) > 0

In a formula, all keywords starting with a dot are data fields in an object:
.fieldB, .fieldC.fieldA - is a data fields.

Keywords not beginning with a dot - is a functions:
count - is a function that counts the number of objects in a list that is passed to it as a parameter.

You can specify a filter in parentheses after the field:
(.role = 'Approval') - this is a filter that selects only those objects from the .participants field, for which .role field is equal to Approval.

The formula specification is detailed here. See the Demo.java for more examples.