A: Introduction

Scott Waldron Updated by Scott Waldron

Dino is not intended as a standalone language; rather it is a "script-integrated" system. This appendix will consider how Dino integrates into the Trestle framework.

Trestle is an ORM (object-relational mapping) and repository framework used to build the DTO (data-transfer objects) and middleware for communication with a relational database. For our purposes though, the ORM parts of Trestle are not as important. The most important thing to get up to speed is to see how Dino integrates as "data as code".

Data as Code

Dino scripts are stored in a data store along with any other record. Depending on the system, these records may fall under various names, usually Business Rule or Rule Script. Also depending on the system (whether it is multi-tenant) there may be records that apply to only a single tenant, and/or there may be global scripts that can apply to any or all tenants. To avoid getting into the weeds on tenancy, we will focus only on the definitions of the fields and scripts of these objects, rather than whether they are single- or multi-tenant. The same rules apply whether the scripts are applicable to one or any number of tenants.

Anatomy of a Rule Script

Now that we know what to look for, we can cover the anatomy of a rule script record.

Note: the examples presented here will use function local imports, so we can see outside dependencies directly in the function that needs them. This is not the recommended approach: it is more efficient to import outside dependencies at the top of the script, at the script root level.

// standard import
from System import DateTime;
// use DateTime anywhere in this script...

// function local import
def myFunction() {
from System import DateTime;
// use DateTime...
}

How did we do?

A: Advanced Command Arguments

A: Files

Contact