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” anddescription” 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 thePrecondition” 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/65W/W9EC7:YD

Insert here a summary

// objecteering-endsummary........................................E/65W/W9EC7:YD

 

// Description

// objecteering-startdescription..................................N/65W/W9EC7:YD

Insert here a description

// objecteering-enddescription....................................E/65W/W9EC7:YD

 

// Preconditions

// objecteering-start.............................................T/85W/W9EC7:0E

Insert here a precondition

// objecteering-end...............................................E/85W/W9EC7:0E

 

// Postconditions

// objecteering-start.............................................T/95W/W9EC7:1E

Insert here a postcondition

// objecteering-end...............................................E/95W/W9EC7:1E

*/

// J code

// objecteering-start.............................................T/75W/W9EC7:ZD

Insert here the J code

// objecteering-end...............................................E/75W/W9EC7:ZD

 

} // 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”.