🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
ChatDesignerPrompt
This page was created by Hans.karlsen on 2023-05-08. Last edited by Wikiadmin on 2026-07-29.

You can use this prompt to configure a chat assistant in MDriven Designer that helps developers understand a model and propose MDriven-oriented solutions to business problems.

Purpose

This page provides the base instruction for the chat behavior shown in the MDriven Designer chat walkthrough. The chat can receive structured information about a selected model item, such as a class or a ViewModel, without displaying that full structured payload in the chat conversation. It can then explain that information in readable language.

Use the prompt to keep the assistant focused on MDriven concepts, model structure, and expressions rather than general-purpose application code.

Base prompt

You will help users understand how to solve real business problems with MDriven.
You will answer in OCL syntax when appropriate.
Note: the EAL-Action Language differs from OCL by being able to change data with the Assign operator :=, create and delete objects with the Create and Delete operators, and change collections with the Add, Remove, and Clear operators.

What the assistant can help with

Use the chat assistant for a focused question about a specific part of the model. Examples include:

  • Explain a selected class, its attributes, and its associations.
  • Explain what a ViewModel contains, including its fields and expressions.
  • Suggest an action approach for a business task.
  • Provide an OCL expression when the task is read-only.
  • Explain when an EAL action is required because the task changes data.
  • Help a user locate an available action or understand how a model-driven application behaves in a given context.

For example, ask: Explain the Car class from my model. When the class metadata is supplied, the assistant can describe attributes and associations in prose rather than requiring you to inspect the model serialization yourself.

Ask focused questions

Give the assistant a clear target and intent. Supplying all model information at once is not the intended workflow; the demonstrated chat has a limited context window, and broad requests can produce answers that are not based on the relevant selected item.

Less effective request Focused request Why the focused request is better
Explain my model. Explain the Car class from my model. Identifies the exact model item to retrieve and explain.
How do I make a form? Explain the ViewModel for Car and identify the information shown on the form. Names both the target and the expected result.
Change the status. Show an EAL action that assigns Closed to the current Order status. States that data must change and identifies the target.

If the question does not identify a class, ViewModel, action, or other model item, clarify the target before relying on the response.

Choose OCL or EAL

OCL is an expression language for querying and calculating from model data. Use it when you need to describe, select, filter, validate, or calculate without changing the model data.

Example question: Give an OCL expression that checks whether an order has any order lines.

An EAL (EAL-Action Language) action changes data. Use EAL when the requested result must assign a value, create or delete an object, or alter a collection.

Need Use Example intent
Read existing data or calculate a result OCL Determine whether an order has order lines.
Set an attribute value EAL with := Assign a new status to an order.
Make or remove an object EAL with Create or Delete Create an order line or delete an obsolete item.
Alter a collection EAL with Add, Remove, or Clear Add a selected product to an order's lines.

Do not ask for OCL when the requirement changes data. State the desired state change so that the assistant can propose EAL instead.

Use model context deliberately

The demonstrated integration can retrieve structured information for a specific model item and provide it to the chat engine off-screen. This keeps the chat readable while allowing the response to be grounded in the selected class or ViewModel.

For example:

  1. Select or identify the Car class.
  2. Ask Explain the Car class from my model.
  3. Check the response against the class's attributes and associations in MDriven Designer.
  4. If an association name seems unexpected, verify whether it is explicitly named. In the demonstrated model, an association without an explicit name used the target class name as its association name.

Treat generated explanations and expressions as draft assistance. Verify names, multiplicities, navigation, and business rules in the model before using them.

Current limitations

The chat behavior shown in the walkthrough is an early implementation. The following limitations matter when you use or adapt the prompt:

  • A request about a large model can exceed the chat model's available context. Work with one class, ViewModel, or other specific item at a time.
  • The assistant can answer generally even when it has not received the intended model context. Phrase the request explicitly and validate the result against MDriven Designer.
  • Creating an item that already exists can result in a duplicate. Review changes immediately and use Undo when needed.
  • The quality and precision of answers depend on both the supplied structured metadata and the language model used by the integration.

Applying the pattern in an application

The same pattern can support a chat helper in a model-driven application when the application has structured actions and ViewModels. A user can ask what commands are available in the current context, where to find a function, or why a field cannot be edited. The chat helper can use available action and ViewModel metadata to explain the application and, where applicable, guide the user to the relevant form or action.

Keep the assistant within the actions and information that the current user is allowed to access. For an action-oriented implementation, model the available behavior through actions and use ViewModels to describe what is presented in the user interface.

See also