Watch, Follow, &
Connect with Us
Public Report
Report From: C#Builder/MDA    [ Add a report in this area ]  
Report #:  6040   Status: Closed
Object constraints are always null
Project:  C#Builder Build #:  7.1.7.3
Version:    1.0 Submitted By:   Peter Morris
Report Type:  Basic functionality failure Date Reported:  9/21/2003 12:52:22 PM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   182379
Resolution: Fixed (Resolution Comments) Resolved in Build: : 9.0.1761.24408
Duplicate of:  None
Voting and Rating
Overall Rating: (1 Total Rating)
5.00 out of 5
Total Votes: 1
Description
Whenever constraints are entered in an MDA model, the compiled project always has "null" for constraints.
Steps to Reproduce:
1) Create a new Eco app
2) Add a class Person
3) Add an attribute Name: String
4) Click the Person class
5) In the object inspector add the following constraint
name.length > 0
6) In the main form add
using Borland.Eco.UmlRt;
7) Add a button to the main form and set the Click event code like so

private void button1_Click(object sender, System.EventArgs e)
{
  IEcoTypeSystem typeSystem = EcoSpace.TypeSystemService.GetTypeSystem();
  IClassifier personClassifier = typeSystem.GetClassifierByName("Person");
  if (personClassifier.Constraints == null)
    MessageBox.Show("Constraints are null, expect an error!", "Error");
  Person p = new Person(EcoSpace);
  EcoSpace.OclService.EvaluateAndSubscribe(p.AsIObject(),
    "constraints->count", null, null);
}

Run the app and click the button.

The first example shows that the constraints property of the model-class is null, and the Ocl evaluation shows that this results in an error.
Workarounds
None
Attachment
Eco.zip
Comments

None

Server Response from: ETNACODE01