You can use the updated AutoForms and debugger in MDriven Designer to create related objects with clearer navigation and investigate the same runtime context that you are prototyping.
What changed
Feedback on AutoForms and the debugger resulted in two related improvements:
- AutoForm actions that create objects use New names and take you directly to the new object's form.
- The debugger can open from the Prototyper with the current prototype context, so you can inspect and evaluate OCL against the objects you are already working with.
Create objects from an AutoForm
In an AutoForm, creation actions are named for the object you will create. For example, use New customer rather than an action named Create customer, or New address to create an address.
When you select a New action:
- MDriven creates the new row or object.
- The Prototyper navigates to the form for that object.
- The form is ready for you to enter values and save the object.
For example, select New customer, enter a company name and email address, and save. If the model has a uniqueness constraint, the value must satisfy that constraint before the save can succeed. A duplicate value can therefore produce a unique-constraint error.
Open the new form in another tab
Hold Ctrl while selecting a New action to open the target form in a new tab. This is useful when you want to keep the current form visible while entering a related object.
For example, while editing a customer, hold Ctrl and select New address. Enter the address in the new tab, then return to the customer tab.
Debug the context you are prototyping
The Prototyper debugger opens with the same context as the prototype. This lets you move from a screen where you see an issue to an OCL expression that examines the relevant objects.
- Start your model and open the Prototyper.
- Navigate to the AutoForm and objects that reproduce the situation you want to investigate.
- Select the Debugger button.
- In the debugger, enter an OCL expression and execute it.
For example, if the current context contains customers, enter an expression such as customers to inspect that collection. The debugger does not choose a specific item for you: an expression such as customers->select(...) defines the selection, and you execute the expression to see its result.
Keep intermediate results in debugger memory
The debugger provides memory variables such as m1, m2, and m3 for temporary results. Store a selected result in one of these variables when you want to reuse it in later expressions.
For example, if you select four Customer objects and place them in m1, m1 represents a collection containing those four customers. You can then execute m1 to inspect the collection, or build another expression from it:
m1->first
Because a memory variable is an expression, you can extend it with normal OCL navigation. For example, start with m1, then navigate from the selected customers to related order headers when your model contains that association.
Inspect ViewModel variables and server-side expressions
The debugger exposes the current ViewModel variables, including the root context. In a ViewModel rooted in a SalesOrder, for example, the root variable represents the SalesOrder currently shown by the form.
The debugger also makes the ViewModel itself available as selfVM. When you switch to EAL, selfVM gives access to ViewModel operations, including REST-related operations such as RestGet and RestPost where they are available in the ViewModel.
For server-side ViewModels, use the available debugger controls to bring the server-side criteria and OCL expressions into the debugger. This avoids retyping the expressions and helps you inspect the data on which those expressions execute.
AutoForm regeneration and customization
AutoForms are generated ViewModels. If you change a generated AutoForm and regenerate AutoForms, your manual changes are discarded. Adopt the AutoForm before making changes you need to keep; an adopted AutoForm is no longer replaced by regeneration. See Training:Bootcamp:Chapter 3 for the adoption workflow and its effect on generated actions.
If an AutoForm for a single-valued link does not show its open link button or Set button, check the link's AutoForm settings. In particular, SearchAndPick is not compatible with a class using ValuestorePattern; use Combobox for that case. See Documentation:Missing Set button in Autoform single link.
