This is my OOM example.
My first OOM has a class Human which has two attributes:
Owner
Age
The second OOM has a class Animal which has two attributes:
dog
cat
The goal is to map dog to Age.
set m1=OpenModel("D:\cases\myOOMSource.oom")
Set ds1 = m1.DataSources.CreateNew()
ds1.setNameandCode "myOOMSource", "myOOMSource"
set m2=OpenModel("D:\cases\myOOMTarget.oom")
ds1.AddSource m2
set SourceTab=m1.findchildbyname("Human", PDOOM.cls_Class)
set TargetTab=m2.findchildbyname("Animal",PDOOM.cls_Class)
set SourceCol=SourceTab.findchildbyname("Age", PDOOM.cls_Attribute)
set TargetCol=TargetTab.findchildbyname("dog", PDOOM.cls_Attribute)
set map=ds1.CreateMapping(SourceCol)
map.addSource(TargetCol)