IBM ODM Import dynamic domain class when creating BOM to XOM mapping

506 views Asked by At

I have a dynamic domain class which was created using na Excel file, each of the following values returns a string. A value "MANUAL" has a label "Manual". The class SegmentationResult is in odm.dynamic package and is shown here:

Dynamic domain class

Now I defined a virtual method isValuedRight in a class odm.Response and I need to use these values in BOM to XOM mapping like this:

BOM To XOM mapping

The problem is that I am unable to import/use these values. I also tried to use those values like this:

return vysledekSegmentace != odm.dynamic.SegmentationResult.MANUAL
2

There are 2 answers

0
budikpet On BEST ANSWER

The problem is that BOM to XOM mapping is a layer on top of XOM that means it can“t use virtual classes and methods.

0
Greg Hadaller On

Virtual BOM members, such as dynamic domain classes and values, are not visible in B2X code for other virtual BOM members. This is probably the biggest downside to using dynamic domains, which are otherwise very useful.

Virtual BOM members are, however, available in BOM functions. And BOM functions can be called from B2X. So you might be able to get your desired behavior indirectly. BOM functions are not object oriented, they are not very widely used, and I generally avoid them, however they can be useful in some situations.

Another option is to define a Java enum in a XOM and use an 'extender' class to augment the BOM class and provide translation between the underlying String attribute and the strongly typed enum attribute. Not as easy as using a dynamic domain, but the defined values are available throughout the BOM and XOM.