Skip to main content

1E SDK

How Dynamic Scripting and Querying works

When a script or query is executed dynamically, the following steps occur:

1. A randomized instruction name based on the code signing certificate licensed prefix followed by a GUID is created.

2. A temporary instruction file, _temp.xml is created. This is a valid instruction that can be loaded into the TIMS authoring tool, for example.

3. The Tachyon.InstructionSigner.exe utility is used to sign the _temp.xml file with the code signing certificate.

4. The _temp.xml file is uploaded to 1E. It is placed into an instruction set called 'DynamicScripting' which is created if necessary.

5. The instruction is executed and the results returned.

Note

A new instruction name is created each time. This ensures that executing instructions that are still within their 'time to live' are not disrupted. However, to avoid old instructions 'piling up' in the DynamicScripting instruction set, each time the invoke-dynamic command is run it will automatically attempt to delete all instructions in that set. If the instructions are still active they will be skipped.

Note

The 1E Consumer API is used to perform all interactions with 1E. Therefore, the user cannot perform any action their 1E privileges would not permit.

Dynamic scripting assumes that the schema for the result set is a 64 bit integer value for ExitCode indicating 0 for success, and a string(8000) value for the results. For scripts, the raw script returned data is passed back in the string value.

For queries or SCALE fragments, the returned data is JSON-encoded and returned back in the string value. The JSON represents an array of rows, with each JSON member representing a column and its value.

This approach allows you to run any script, executable, query or SCALE fragment and return the values without needing to change the instruction schema. However, the instruction XML management cmdlets allow you to specify your own schema if you want to build something more complex. For more information, please reefer to Instruction XML management cmdlets.