![]() |
Role info question |
Post Reply
|
| Author | |
ReeceRobinson
Member
Joined: 25.Mar.2014 Points: 4 |
Post Options
Thanks(0)
Quote Reply
Topic: Role info questionPosted: 09.Apr.2014 at 23:36 |
|
Hi,
I hope this isn't a dumb question ![]() 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
|
|
![]() |
|
stevek
MetaCase
Joined: 11.Mar.2008 Points: 643 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
ReeceRobinson
Member
Joined: 25.Mar.2014 Points: 4 |
Post Options
Thanks(0)
Quote Reply
Posted: 10.Apr.2014 at 11:09 |
|
Thanks for your help. That is exactly what I wanted to know.
Cheers, Reece
|
|
![]() |
|
Post Reply
|
|
| Tweet |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |