Evolution of APIs
A consequence of the abstract metamodel is that conventional MetaAssociations, MetaAssociationEnds and MetaAttributes are no longer systematically accessible from a concrete MetaClass.
New APIs, using the compiled metamodel are proposed, to enable optimized and precise access to abstract metamodel concepts. These are generally based on "MegaObject" and "MegaCollection" concepts.
Accessing abstract MetaClasses
Objects handled in Hopex are attached to a concrete MetaClass inherited from one or several abstract MetaClasses.
The GetType function allows an object or collection to be considered as an instance of a given MetaClass.
Used from a MegaObject, the GetType function enables consideration of the object as a function of the MetaClass given as parameter.
Example: MyOrgProc.GetType("BPMN Owner Element").explore runs the explorer from an object of the Organizational Process concrete MetaClass, considering it as an object of the "BPMN Owner Element" MetaClass.
*Used without a parameter, operator GetType enables consideration of the current object as an element of the concrete MetaClass to which it belongs.
Used from a MegaCollection of objects of different concrete MetaClasses, operator GetType allows you to obtain a collection restricted to instances of the MetaClass specified as parameter.
Example: oCollection.GetType("Sequence flow").explore runs the explorer on objects of the collection belonging to the "Sequence flow" MetaClass.
If no object of the collection inherits the MetaClass given as parameter, operator GetType returns nothing. No error is generated.