Related Save/Close Action

A variety of edit scenarios can be modeled. Editing can take place locally or remotely. With local editing, all changes are stored locally and are only written back to the remote system when the user explicitly requests this. When editing on the remote system, all changes are written back to the remote system immediately when saving or closing the editor.

An edit action can be extended by a Related_Save_Action and/or Related_Close_Action. The Save action is carried out every time there is a request to save the file. The Close action is carried out when the editor is closed. This also happens when closing Eclipse.

Note: Save actions which imply changes to the workspace should be modelled with an execution mode of modeless.

Example

A usual use case for the definition of an edit close action is that certain SCM activities have to be performed when the element is closed in the editor, for example, the element has to be unlocked in the SCM system. The unlock of the SCM system might require a comment specified by the user. In the example described here the comment should not be asked for when the element is not saved since it is opened in the editor. This is the reason why a save action is needed. The save action sets a save flag which is reset when the editor is opened for this element.

This scenario is modelled in the standard AWM ChangeMan model supplied by Micro Focus. Three properties are needed:



The Property CMG_PROP_PARM_SourceChangedN is defined with default value N. The Property CMG_PROP_PARM_SourceChangedY is defined with default value Y. The AWM tool "Return Property Value" can be used to set or reset the CMG_PROP_PARM_SourceChanged by the value of the property CMG_PROP_PARM_SourceChangedN or CMG_PROP_PARM_SourceChangedY, respectively:


CMG Edit Changed

The tool CMG_TOOL_AWM_ResetEditChanged is modeled as the first tool of the edit action. The tool CMG_TOOL_AWM_SetEditChanged is modeled as a tool of the related save action. The tool to ask for the unlock description in the edit close action CMG_TOOL_AWM_UI_ChangeDescription is only executed when the property CMG_PROP_PARM_SourceChanged contains the value Y:


CMG Edit Action