Main Content

Customization of Signoff Forms in Review Editor

This example shows how to customize review signoff forms for Review Editor app in the Modelscape™ Review Environment (MRE).

MRE comes equipped with a selection of forms that you can customize to sign off on a given review to match your validation processes. You can also create your own signoff forms using MRE. The customization consists of two parts: formatting the signoff forms and configuring the list of forms available to the validators.

Format Signoff Forms

Implement customized signoff forms as subclasses of an abstract interface class modelscape.review.app.signoff.SignoffForm. Begin by opening an example form in the MRE.

edit modelscape.review.app.signoff.forms.FullReview

In most cases, you can simply copy and rename this class, and then edit it according to your needs. The class definition must be on your MATLAB path.

You must give the validator a list of labels corresponding to the steps of the validation work, and a list of controls that allow users to input their comments. Labels are strings such as Approved?, Materiality or Known weaknesses. Controls include drop-down menus, checkboxes, and containers for free-form text. Define one control for each label. The form also requires submit and cancel buttons. The layout of these labels, values, and buttons is part of the configuration. To select the form from the submit review toolstrip dropdown, you also need a method called fullName.

Configure Form Components

Layout

Control the layout of labels, controls, and buttons by using a matlab.ui.container.GridLayout object that uses the Parent object of the form as its parent container. Define a grid with one row per label-control pair and one row for the submit and cancel buttons. Row heights vary depending on the type of control to use.

this.UIGrid = uigridlayout(this.Parent,[8 4],...
    ColumnWidth={"1x","1x","1x","1x"}, ...
    RowHeight={25, 50, 50, 50, 50, 25, 25, 25});

Labels and Controls

Insert the labels and controls into the layout grid using functions in the MRE package.

import modelscape.review.app.signoff.helpers.formatLabel;
import modelscape.review.app.signoff.helpers.formatDropDown;
import modelscape.review.app.signoff.helpers.formatTextArea;
import mmodelscape.review.app.signoff.helpers.formatCheckBox;

Use these functions to create the labels and controls, then place them in the layout grid in arrays called this.Labels and this.Controls. For example, place the Risk rating label in the first column of the sixth row and a drop-down menu with selection High, Medium, Low, and Select values in the second column of that row.

this.Labels{6} = formatLabel(this.UIGrid, 'Risk rating', 6, 1);
this.Controls{6}= formatDropDown(this.UIGrid, 6, 2, ...
                {'Select', 'High', 'Medium', 'Low'}, 'Select');

Submit and Cancel Buttons

Define the remaining two components using helper functions of the SignoffForm base class. Place the required buttons in the third and fourth column of the eighth row of the layout grid. The helper functions also configure the buttons to trigger the appropriate events in the Review Editor app.

createSubmitReviewButton(this,8,3);
createDiscardReviewButton(this,8,4);

Register Signoff Forms

The signoff forms for review submission are accessed through the drop-down list under the Submit Review button in the Review Editor app. By default, the list contains the examples of the MRE package. To replace these by your custom forms, create a resources/extensions.json file with the following contents anywhere on your MATLAB path:

{
    "mw.modelscape.review.signoff.forms": [
        {
            "type":"DropDownItem",
            "name":"CustomSignoffForm1",
            "title":"Custom signoff form 1",
            "content":"some.namespace.CustomSignoffForm",
            "contentType":"matlab"
        },
        ( ... other forms...)
    ]
}

Here name is a tag, title defines the name of the form as it appears in the Submit Review drop-down list, and content is the full name of your signoff class definition. Fill type and contentType as shown above. You can list any number of forms.

To distribute your file repository to MRE users, package your class implementations and the extensions.json file into a toolbox. Deploy the toolbox with Modelscape as you set up Review Environment.