This Client Server article is republished in its entirety from 2003 for reference purposes.
By Bentley Technical Support Group24 March 2003
Bentley ProjectWise is a document management system that uses a back-end database to handle documents within the system. An environment enables the ProjectWise Administrator to define project-specific attributes for a document. Essentially, environments are metadata, or data about the documents stored within the ProjectWise datasource. The environment module inside of the ProjectWise Administrator is the tool that the administrator uses in order to create the user-defined attributes inside the database.
Figure 1: General properties of a document Figure 2: Attributes of a document Since the ProjectWise Administrator defines environments, the end result is dependent on the needs of the individual project. Document Name, Application, and Workflow are examples of system attributes, while Scale, Contractor, and Approved By are examples of user-defined environment attributes. As Figure 1 shows, the system attributes of a document can be found in the General tab in the document's properties. The user-defined attributes, if defined, can be found in the Attributes tab of the document's properties (see Figure 2).
Attribute values can be populated from the results of a select statement, a fixed value list, a function, or a system variable. This article will demonstrate how a select statement can be used to generate a list of values. It will further show how a system variable can be used within a select statement so that the value of one attribute affects the value from another attribute. A simple example will be provided, but the principles are applicable to a complex, pragmatic setting.
Consider a situation where a list of attributes is so long that the user must scroll through the list of values in order to find the desired value. It would be nice to organize the data so the value results of the attributes would be a smaller and more manageable list. This can be accomplished by using this system variable: $EDIT#$.
We are going to set up a simple environment in Bentley ProjectWise that will use only two attributes. The first attribute will store region names, which are four major regions of the United States: North East, South East, North West, and South West. The second attribute will store city names. Since there are more city names than defined regions, the list could be rather long. Instead of the user scrolling through a list of cities for the entire United States, a region will first be selected, thereby limiting the results to the cities located exclusively in the selected region.
Figure 3: CS_Region table in the database Figure 4: CS_City table in the database To begin this example, create two attributes in a new environment called CS_Attrib1 and CS_Attrib2. CS_Attrib1 will be used to store region names and CS_Attrib2 will be used to store city names. The values will be generated from the results of a select statement. After a region is selected from the region table, the available values in the CS_Attrib2 attribute will be limited to a list of cities located exclusively in the region selected from CS_Attrib1. To achieve this, first create two tables within the database containing the ProjectWise tables. The first table will hold the region information (See Figure 3). The second table will hold the city information (See Figure 4).
To utilize the information contained in the tables, we now need to configure the attributes. Select statements are entered in the properties of the attribute in the Value tab. Figures 5 and 6 illustrate the properties of the attributes CS_Attrib1 and CS_Attrib2. We'll start with CS_Attrib1, since this will be used to access the CS_Region Table. Here is the syntax used in the ProjectWise environment:
Select regionID, regionNAME from CS_region order by regionID.
This will return the four regions entered in the CS_Region table. The user will choose a selected region, such as South West.
Next, let's build the select statement for the CS_Attrib2 attribute:
Select CityName from CS_City where RegionID = '$EDIT#CS_Attrib1$'
The $EDIT#$' is a system variable unique to ProjectWise. is the column name of the attribute, which in this case is CS_Attrib1. The user will now be presented a smaller list of values based on the region selected in the first attribute. Using this example, if the user selects Region 4, South West, Phoenix and Santa Fe will be the only available values.
RegionID is a column used in both tables and it establishes the relationship between the two tables. Notice in the select statement in CS_Attrib1, regionID is returned first (Select regionID, regionNAME from CS_region order by regionID). This is necessary in order to make the select statement in CS_Attrib2 work. If the select statement didn't select regionID first or at all, the results in CS_Attrib2 would be blank.
With the simple example provided here, you are now ready to apply these principles into a real-world scenario.
Editor's note: the use of environments is covered extensively in the Bentley Institute course guide, ProjectWise Administrator, Volume 2, available when you take the course.
Client Server Archive
ProjectWise TechNotes And FAQs
Bentley's Technical Support Group requests that you please confine any comments you have on this Wiki entry to this "Comments or Corrections?" section. THANK YOU!