Additional operations
We will add a couple of operations to our application to make it more convenient to users.
Member "Edit" operation
Firstly we will introduce the “Member Edit” operation. This operation will ask the user to provide the details of the Member object she wants to edit and then displays the form of the object for editing. The only difference with the Change Member Details
operation is that if the user provided the details that uniquely identify a particular member, the form of the member will be shown immediately (with the Change Member Details
operation the user will see the screen with the query results even if the query only found one member). This can only be achieved by the PICK FROM
action of the rule language so we need to define a process called EditMember
with the following actions:
PICK FROM Member NO CONFIRMATION FOR ONE VIEW Member
The first action will run the Member
query and will immediately proceed to the next action if one member was found without waiting for the user to confirm the member (if the query found more than 1 member the query result screen will be displayed as usual and the user will have to pick a member). The second action will show the editing form of the Member
object.
We will define a new item in the system menu of the Administrator
visual perspective called Edit
under the Member
menu item.
View "Member Details" operation
The next operation we will add will show all the main details of a particular member, such as her main personal details, a list of current loans, reservations and outstanding charges. Users will not be able to change these details. The goal of this operation is to provide a quick way for the user to view, but not change, all the important details of the Member
in one place. The operation will be available for members as well. It will be invoked from the system menu.
Before we can configure this operation we need to define a special form for the Member
object that will only show the main details of a member. To do this we open the Member
object for editing and click on the icon on the
Forms
tab. We will enter the name of the new form “Member details”. We will then save the changes to the object and double click on the form section underneath the new form to open the form section designer. We will add the following attributes to the Main
form section in the form: FirstName
, LastName
, MemberNumber
, Address
, EmailAddress
, DateOfBirth
, Loans
, Reservations
and OutstandingCharges
. We will arrange these attributes in two columns (see 1.4.3.3) and we will add separators between two groups of attributes – Personal details
for the first 6 attributes and Activity
for the last 3. To add a separator click on the icon in the form section designer toolbar. Then move the separator row to the desired place in the layout by pressing up and down arrows.
The operations of the new form should be the same as operations of the “Editing” form with the addition of the “Edit” operation that should bring up the editing form (add an operation of the “Edit” type and specify the name of the form – “Editing”).
Once we have defined the new form we can configure a new process that will bring it up. We should consider the fact that the operation will be used by members as well (see 1.4.2.1) so the new process “ViewMember” will have the following actions:
IF LoggedInSystemUser.AccessLevel='Member' THEN VIEW LoggedInMember USING 'Member details' NOEDIT ELSE PICK FROM Member NO CONFIRMATION FOR ONE VIEW Member USING 'Member details' NOEDIT
Note that NOEDIT
keyword indicates that the values on the form can only be viewed, not changed. Note also that just like with the “Member Edit” operation we will display the form immediately if only one Member
has been found.
Now we only need to define the menu item invoking the operation in both the Administrator
and Member
visual perspectives. We define the View details
menu item under the Member
item in the Administrator
perspective and the “Loans and reservations” menu item in the “Member” perspective.