ZuloOne
English
Sign in
Menu

Scripts

Updated

A script is C# the platform compiles in process. Metadata describes the object. The script is the behaviour metadata cannot express: fill a field, refuse a value, change a state, write a movement, share a calculation.

Note

Compiled code never leaves memory. RuntimeCompiler loads every assembly into one AssemblyLoadContext that is never unloaded. A check compiles with checkOnly: true and does not load. Only code that will run is loaded.

Hosts#

Host When it runs Kind / cookbook
Event handler Save, a field on the card, a subtype transition Write an event handler
Command The user presses a button Command
Posting script The target subtype is posted Posting script
Service Another script calls GetService<IName>() Service
Form module A standalone screen Form
Data entity Map to / from the OData projection Data entity
Integration test POST /api/metadata/tests/run-all Write an integration test

Several handlers of one object, and several implementations of one IFoo, are Chain of Command: the top layer starts, next goes down.

A user partial is compiled with a generated framework half (helpers, GetResource). The pair *.script.json + *.cs is inseparable. Class names are unique across the workspace.

A script cannot open files, sockets, processes, or reflect around the platform. It does not author SQL: reads and writes go through IDataService / ISqlService inside the sandbox; going around them is refused. Outbound I/O is a channel by name. See what a script can do and outbound integrations.

Text a person will read is a resource, not a C# literal.

  • Runtime — the compiler, GetService, ClientActions
  • Metadata — the object the script is bound to
  • Deep note: partial scripts and resources live in the kernel notes of this same Reference tree

Where next#

Was this page helpful?