|
|
JSON Classifiers |
Classifiers such as classes, blocks and use cases are of type ModelElement along with the correct metaclass and (optionally) user defined metaclass, for example:

Classifiers have:
· Attributes (type = ‘Attribute’)
· Interface items: event receptions / operations (type=’InterfaceItem’)
These are held in the nestedElements array.
For example:

Attributes are custom JSON objects (type=”Attribute”) and do not require a metaclass.
Attributes have a type which is indicated in various ways, see JSON Types
Attributes in port contracts may have directions (see JSON Ports)
Interface items are custom JSON objects (type=”InterfaceItem”). Since they can be either event receptions or operations, they do require the metaclass attribute which should be either “EventReception” or “Operation”.
Operations have (optionally) arguments, a body and a return type:
· Arguments (type & metaclass = ‘Argument’) appear in nested elements and have a type (see Json Types) and (optionally) a direction (the default direction is In)
· Bodies are specified using the body attribute (as a string you may need to escape some characters to avoid clashing with the JSON)
· Return types are specified using a returnType attribute (see JSON Types).


Event receptions are (optionally) typed by events. This is indicated with an event attribute that contains the full path to the desired event. If no event is specified, then the importer will simply ask Rhapsody to add an event reception by name. Rhapsody will then use the first event it finds with that name or create one in the same package if none exists.
