To show the usage of the transacted variable part further, we will build a view that shows the attributes for a department in both the shared transaction and the top-level transaction. To do this, another transacted variable must be added that contains the selected department object. This variable must be given the shared transaction as its transaction.
To show the shared and top-level transactions, we will use multiple views. To show the multiple views, we will create a form with the edit controls and connections that we used formerly to show the details of the department. In addition, we will add a transacted variable to the form.
Furthermore, we will promote the following attributes of TstDepartment1: self, transaction, and remove. This will allow views that use this part to specify the department that it should work with as well as the transaction in which it should operate.
Create a new view, TstDeparmentTwoTransactionsView. Do the following:
The top TstDepartmentEditForm will be used to show the selected department in the shared transaction. When the form was built the attributes self of the TstDepartment1 variable (representing the department which will be displayed) and the attribute transaction were promoted.