Software updates — May 2020

Major new functions

Conditions attached to table-based Q&A answers

In conditions attached to cards/questions/changes/predefines, you can now refer to the individual answers of a table-based question.

Embedded programming language

ClauseBase has always offered one of the most powerful document drafting engines around, that allows you to express almost any contractual text through a balanced mix of regular text and special codes. However, every now and then situations were encountered that could not be completely expressed through the regular codes.

To cover those — admittedly, exceptional situations — ClauseBase now hosts an embedded full programming language. This embedded programming language allows you to, for example, perform the following:

  • advanced mathematical calculations from within paragraphs
  • insert fully calculated amortization tables or multi-week time tables
  • interactively communicate with external servers to insert data into questionnaire answers, e.g. to show lists of countries/cities/courts, or convert currencies
  • calculate any complex notice period you can think of, with terms and termination fees that depend on multiple other factors
  • calculate predefined values on-the-fly for use in questionnaires (e.g., a list of possible dates that depends on the answer to some other question)
  • show warnings and interact with users in questionnaires through custom-made components
  • interactively define graphics (technically SVG drawings) that depend on datafields

This feature is still in beta testing and currently limited in documentation (contact us if you are interested in using it), and is obviously intended for advanced ClauseBase users with strong technical knowledge.

To give you an idea: the embedded programming language is Clojure (at the server side) and ClojureScript (at the browser side), widely considered advanced programming languages for serious programmers. The sky is now really the limit, as evidenced by the three playful videos below.

This video illustrates how the combination of datafields and the embedded Clojure programming language can be used to interactively create graphics.

Note that these graphics are calculated on-the-fly, and are actually quite complex. As you can see in the video, the logos are slightly rotated and shifted around depending on their position. Also, they can be “whitened” through an advanced filter that removes their color.

A similar examples could be a real estate or conference organising contract, where a graphical plan of the building or conference floor (and associated contractual clauses) would be interactively calculated on-the-fly, depending on various parameters.
This video illustrates how so-called ASCII-art can be generated in ClauseBase, i.e. images that are completely composed of regular letters, numbers and symbols found on your keyboard.

The letters you type in at the left side, will be interactively converted into large letters at the right side, and then composed together.
This example shows how a Sudoku can be solved, by entering the unresolved puzzle at the left side (unknowns are represented by underscores), and getting the results (in green & bold) back at the right side.

Sub-second sudoku resolving algorithms are actually not so straightforward. The algorithm that was used here, was taken from Alex Spurling’s Github page.

Small enhancements

  • In the Q&A editor, you can now add all predefined values from a selected datafield.

New @functions

  • Addition of the @ord and @short-ord functions to convert a number into a long or short ordinal.
  • New @get function that is similar to @nth, but does not result in an error when an invalid index is specified.
  • New @silence function that results in nothing when its sole parameter contains (or results in) an error. Otherwise, it just passes on its parameter.