<style> .text-span-6 { background-image: linear-gradient(99deg, rgba(170, 163, 239, .5), rgba(125, 203, 207, .5)); border-radius: 50px; padding-left: 15px; padding-right: 15px; } #title-text { display: none; } .panelgradient { background-image: linear-gradient(180deg, #d5def0, whitesmoke); border-radius: 8px; flex-direction: column; justify-content: center; align-items: center; padding: 4rem; display: flex; position: relative; } </style> <div class ="panelgradient"> <h1 style="text-align: center;">Scripts <br> (Tasks and Classes)</h1> </div> |
The Scripts Module supports multiple programming languages, including C#, VB.NET, Python, and JavaScript, enabling the creation of high-performance server-side and client-side scripts on Display Code-Behind. Its built-in code editor streamlines development with automated translation between C# and VB.NET and provides access to all .NET Framework classes available in Visual Studio. The module simplifies distributed application development using server or client domains and ensures high performance through custom code compilation. Additionally, it enhances graphical displays with Display Code Behind functions and offers debugging tools for quick identification and resolution of coding issues.
The Scripts Module Allows:
On this page:
The Scripts Module manages and executes user-defined scripts for automation and process control.
ScriptTaskDefines code that executes in reaction to an event (trigger) or periodically at specified intervals. |
ScriptClassA library of functions and methods that can be used in Script Tasks, Expressions, or from the Code Behind on graphical Displays. |
ScriptExpressionOne line of code in response to an event, where the entire script isn't necessary. |
Script ReferencesExternal DLLs included for a script or display code compilation. |
Module Highlights
Scripts Module configuration workflow | ||
---|---|---|
Action | Where | Comments |
Manage ScriptClasses | Scripts→Classes | Create or Import you function Library. Learn more at Scripts Classes. |
Manage ScriptTasks | Scripts→Tasks | Create or Import Tasks. Learn more at Scripts Tasks. |
Manage ScriptExpressions | Scripts→Expressions | For simple event or time driven actions, use Expressions. Learn more at Scripts Expressions. |
Manage Script References | Scripts→References. | If you code required their party libraries, include the references. Learn more at Scripts References. |
The key concept to be aware on the execution of the Tasks and Expressions define on the Script Module is that they execute on the Server computer.
Only the CodeBehind of the displays is executed on each Client Computer. The Script Classes can be consumed by both Server and Client stations.
Current solution are prorating User Interfaces that are Portable, meaning the exact same drawing and display configuration can run both as a WPF Windows RichClient, or as Web HTML5 page inside a browser. If you intend to run the graphical interface only on WPF Windows, not web pages, it is possible to enable in Solution → Settings to allow Tasks and Expressions running on the Client side.
For complex solutions or very large solutions, it's useful to get a deeper understanding of the Module execution process, see Scripts Module Execution if that is your case.
The Namespace Script is the entry point for all objects related to the Scripts module.
The Script.Class object lists all configured tables and its runtime properties. The Script.Task object lists all configured database connections and their runtime properties.
Examples:
Script Task properties | ||
---|---|---|
Property | Type | Description |
| Integer | Number of times the Script Task <Task1> was executed. |
| TimeSpan | The Amount of CPU used the last time the Script Task Task1 was executed. |
→ Read more about Objects and Namespaces.
Best Practices and Recommendations
The Scripts module may encounter some issues in its operation. Here are some common issues and their troubleshooting:
In this section: