MetaCase Homepage
Forum Home Forum Home > > MetaEdit+
  New Posts New Posts RSS Feed - Role info question
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Role info question

 Post Reply Post Reply
Author
Message
ReeceRobinson View Drop Down
Member
Member


Joined: 25.Mar.2014
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote ReeceRobinson Quote  Post ReplyReply Direct Link To This Post Topic: Role info question
    Posted: 09.Apr.2014 at 23:36
Hi,

I hope this isn't a dumb question Embarrassed

In my language I have a relationship between two objects. I.e. an association between two classes. I am writing a generator that iterates all the associations and outputs the role info at each end. My problem is that I also need to output the connected class ObjectId when I format the role information. I only have the association and the roles i.e. >Association~Role. How do I get the ObjectId for the class the role is attached to?

Cheers,
Reece
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 643
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post Posted: 10.Apr.2014 at 01:06
If I understand correctly, you want something like this:
 
foreach >Association
{  'Association ' id newline
   do ~Role
   {  'Role: ' id
      ' for object: ' do .Class { id } newline
   }
   newline
}
 
That will give you the name (human-readable identifier) of the Class (adjust the green type names if they don't match what you have, or use () to match any type name). You mentioned objectID, which is actually a separate MERL command, and answers just the object number part of the internal id of this element, unique in this project; if you want that number instead of the Class name, replace id with objectID in the innermost loop.
Back to Top
ReeceRobinson View Drop Down
Member
Member


Joined: 25.Mar.2014
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote ReeceRobinson Quote  Post ReplyReply Direct Link To This Post Posted: 10.Apr.2014 at 11:09
Thanks for your help. That is exactly what I wanted to know.

Cheers,
Reece
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.05
Copyright ©2001-2022 Web Wiz Ltd.

This page was generated in 0.055 seconds.