SysDebugger lets authorized Turnkey administrators evaluate OCL expressions, actions, and OCLPs in a running Turnkey application, inspect the returned objects, and work with dynamic result views.
Use SysDebugger safely
SysDebugger can inspect data and evaluate expressions in the running application. A user can open returned objects in AutoForms and make changes, including adding items through multilinks. Do not expose it to ordinary application users.
Set an AccessGroup on the SysDebugger view before you deploy it. Give that access group only to trusted administrators who need diagnostic or data-extraction access.
Add the supported pattern
SysDebugger is supplied as a supported mergeable Turnkey pattern in the MDriven components repository:
MDrivenComponents\MDrivenTurnkeyComponents\MDrivenMergeable\SysDynamicViewSysDebugger
To add it to a Turnkey model:
- Obtain or refresh the MDriven Turnkey components repository.
- In MDriven Designer, merge the
SysDynamicViewSysDebuggerpattern into your model. - Review the merged diagram and confirm that the merged classes have the expected superclasses.
- Save the model.
- Configure an AccessGroup on the SysDebugger view.
- Run the Turnkey application and open Admin â System Debug.
For a local Turnkey development workflow, including working with the local core application, see Documentation:Turnkey local development tips.
Evaluate expressions and inspect results
The SysDebugger view provides an input area where you can evaluate model expressions. It reports errors when an expression cannot be evaluated and shows the objects returned by a successful expression.
For example, evaluate an expression that returns a collection of objects from your model. When the result contains three objects, SysDebugger displays three result rows. From those rows, you can:
- Open an object in its AutoForm to inspect or edit its values.
- Use multilinks in the AutoForm to add related items.
- Open a seeker for a class.
- Open a result list in a separate browser window.
- Evaluate expressions against persistent storage.
- Evaluate an action expression where an action is required rather than a value-producing OCL expression.
SysDebugger is a runtime diagnostic and administration tool. It is different from the Designer-based OCL Debugger, which is used when you start and debug a system from MDriven Designer.
Understand SysDynamicView
SysDynamicView is the reusable mechanism behind the object browsers, class seekers, and AutoForm navigation used by SysDebugger. You can also use SysDynamicView directly in application logic to create a browser view at runtime instead of creating and deploying a dedicated static view.
A dynamic view has:
| Part | Purpose | Example |
|---|---|---|
| Root | Identifies the object from which the view is created. | A selected order object. |
| Collection expression | Gets the collection to display from the root object. | The selected order's details. |
| Dynamic columns | Defines each displayed column by a name and an expression evaluated in the context of an item in the collection. | A Product column and a derived Line total column for each order detail. |
| ViewModel name | Identifies the ViewModel used when navigating to the dynamic view. | The ViewModel name stored by the dynamic-view object. |
Example: browse the details of a selected object
Assume the current object has a collection named details. Your logic can create a dynamic view rooted at the current object, use self.details as the collection expression, and add columns such as:
- Name â an expression that shows the detail name.
- Derived value â an expression that calculates a value for each detail.
After adding the columns to the dynamic view, navigate to that dynamic-view object using its ViewModel name. The user receives a browser containing the detail rows and the columns you defined.
This approach is useful when an administrator needs a data extract or a browser tailored to the current object and you do not want to change and redeploy the model for every extract. You can build an administration UI that creates these dynamic views, but apply the same access control as for SysDebugger.
Inspect and reset active sessions and views
The mergeable pattern also includes these transient classes:
- SysTransientTKStatusSingleton
- SysTransientSession
- SysTransientView
Use them to obtain a list of current sessions and views. From that information, an authorized administrator can reset an individual view or an entire session. Treat reset operations as administrative actions: they affect users who are currently working in the application.
Watch the walkthrough
Watch the SysDebugger and SysDynamicView walkthrough.
