Editing J code
To edit J code in an external editor,
simply click on the
button. As
soon as the editor is closed, the modifications are retrieved in the modified
operations.
This icon is available for the following elements:
· J profile implementations. All the operations of all the references of the profile implementation are edited in the same file.
· Metaclass references or workproducts. All the reference's operations are edited in the same file.
· The “Services” folder of a J MDA component. All the service's operations are edited in the same file.
· Operations from J profile implementations or from the “Services” folder of a J MDA component. Only the selected operation is edited.
In this editor, you can modify the following for each operation:
· the J code
· the “summary” note content
· the “description” note content
· the precondition and postcondition
By editing J code, the operation code and the “summary” and “description” notes can be modified. It is not necessary to create these notes before beginning J code edition, since these notes will be automatically created when the editor is closed.
These modifications are allowed only between the Objecteering tags:
// objecteering-start
// objecteering-end
If the operation has pre or post-conditions, it is also possible to modify them in this editor. Unlike operation code and “summary” and “description” notes, constraints stereotyped “JPrecondition” and “JPostcondition” must be created before starting J code edition. The “MDA” tab of the properties editor is used to rapidly create these constraints by defining the “Precondition” and “Postcondition” fields (as shown in Figure 101).

Figure 101. The “MDA” tab of the properties editor on an operation
Example of an external edition:
// -----------------------------------------------------------------------------
// Operation "Behavior
profiles.MyProfileImplementation.Class.myOperation"
//
-----------------------------------------------------------------------------
void
Class::myOperation () {
/*
// Summary
// objecteering-startsummary......................................N/
Insert here a summary
//
objecteering-endsummary........................................E/
// Description
//
objecteering-startdescription..................................N/
Insert here a description
//
objecteering-enddescription....................................E/
// Preconditions
//
objecteering-start.............................................T/
Insert here a precondition
// objecteering-end...............................................E/
// Postconditions
//
objecteering-start.............................................T/
Insert here a postcondition
// objecteering-end...............................................E/
*/
// J code
//
objecteering-start.............................................T/
Insert here the J code
//
objecteering-end...............................................E/
} // operation myOperation
Note: It is important not to edit several different elements at the same time, even if this is permitted by MDA Modeler. Only one editor should be opened at any time.
The “Command for invoking external editor” parameter must have been
defined. For further information on this parameter, please see “MDA Modeler parameter sets”.