A couple of weeks ago I outlined my view on the usefulness of lists when editing EA elements. In that post I illustrated the ability to add buttons to an eaForm which could be used to initiate some action such as adding a property. By providing buttons that initiate action we provide a means to perform the task with minimal context switch and hence minimal effort.
If we look at this example form we see standard buttons to Save or Cancel our element editing. We also see buttons which allow us to Add… properties to our element. For example,
our Add Attribute button will present an attribute form within the context of our already open form – no switching just a single button push.
We have a range of other buttons which cwe can use to add element properties (often they are are specific to the relevant element type) – for example:
- Add a tagged value
- For Use Cases we have add Actor, Pre-/Post-condition
- For Classes we have add Attributes/Operations
We also have a Detail button that can be added to the form and will save updates to the current element then open the element using the standard EA properties editor; a button we feel is useful for the experienced EA user who may at some time wish to switch for an instant.
Create related note or element
In my experience in addition to editing element properties the other may task is to add stuff – notes or new elements related to my current element, so we have added buttons that assist with this task. The example below illustrates a add a linked element button – which when pressed presents the user with a dialogue to enter basic information about the element and its relationship to the current element.
Button options include both linking and / or owning the element.
Also, although not a button, within eaForms we offer the related element control which allows the designer to specify a desired connection between the element that the user is editing and another element (optionally with a specific stereotype) and with a specified connector type.
During recent work we have seen the benefit of scripting and have been working with some “experimental” buttons within eaForms that will not only save or potentially save an element but also run a script. At present we have included 2 script buttons:
1. Save and run script after save – which will save updates to the element and then execute a predefined script, performing some post saving action. For example, we could add an entry to a file to indicate that an element has been approved or some other project relevant event.
2. Run script and conditionally save the element or remain in edit – this button runs a script and depending on the outcome will either save any element updates or stay in editing mode, without saving any updates, and so presents the user with making any relevant modifications or preventing them saving updates that do not confirm to some project specific standards. By proving the option to perform pre-saving checks we can help ensure the integrity of the project.
In providing these button options we recognised the potential for issues with scripts. The first is which script to use and where it is located, so we decided to include the script within the eaForms definition. So if we look at a very simple form with a script button and its control definition we see the script code can be edited – this script adds an entry to a file
The second issue is the operation of the script – in our early release we have limited the scripts to VBScript and further do not support INC’s – and hope that is not too restrictive. We have found that most of what we would see as needed is readily available within the existing windows environment e.g. the use of the File System Objects. We will review this in due course.
Finally, are there other script buttons that would help. Do we want to include a “Run Script” button that performs a task without doing any pre-defined action?
At present these script buttons are at an early stage and the use cases may be a bit vague but part of the reason for including them was to see if they help the user or other aspects of model quality – which is part of the aim with eaForms
In this post I have outlined the use of buttons within eaForms – from the simple add properties to the more powerful buttons with scripts that provide the user with the flexibility to do their own thing.
As always hope this is of interested and welcome your questions and feedback.