As a SystemWeaver Architect, you can set constraints on the options for adding, creating and removing parts in, e.g., the Structure tree and Parts view. For example, you may want to allow users to add existing signal ports, but not create new ones.
This article describes how to configure restrictions.
Note: This only restricts the behavior in the swExplorer client. It does not restrict API users. |
Prerequisites
- Assignment of the SW Architect role in the database
- An installation of the SystemWeaver Architect (swArchitect).
- In the Type structure tree in the swArchitect, select the Part type for which you want to define a constraint.
- Click Edit Config.
- Define the desired constraint using the <PartTypeConfig> XML element:
<PartTypeConfig>
(constraint)
</PartTypeConfig> - Click OK to save your changes.
The following constraints are supported:
- <AllowAddPart value=""/>
- <AllowNewPart value=""/>
- <AllowRemovePart value=""/>
- <AllowMultiInstance value=""/>
The attribute value for all of these tags can be 'true' (default) or 'false' and is required.
<AllowAddPart>
Defines if it should be possible to perform an Add action in the GUI, i.e., create a new part using an existing item. (This includes actions with corresponding effect, like Paste.)
<AllowNewPart>
Defines if it should be possible to perform a New action in the GUI, i.e., create a new part using a likewise new item. (This includes actions with corresponding effect, like Another.)
<AllowRemovePart>
Defines if it is possible to perform a Delete or Remove part(s) action in the GUI, i.e., delete a part. Supported value is a pathQuery that evaluates to either true or false. The optional disabledTooltip attribute defines the message displayed as a tooltip to inform the user why the removal of the affected part is not allowed. Supported value is a String. If the disabledTooltip attribute is not defined, a default informational message will be provided.
<AllowMultiInstance>
Defines if it is possible to Add a part that already exists under the selected owner item, i.e., allow multiple instances of the same exact part. Below is an example of <AllowMultiInstance value="false"/>:
This tag has an additional, optional attribute called allowDifferentVersions. It determines whether or not users can add other versions of an existing part. This option can only be used when AllowMultiInstance is set to 'false'. In other words, you would use the following if you would like to allow users to add different versions of a part under a selected owner item, but not the same versions of a part:
<AllowMultiInstance value="false" allowDifferentVersions="true">
PartType Configuration Example
<PartTypeConfig>
<AllowAddPart value="false"/>
</PartTypeConfig>
Example Result
The options for adding the part will not be available. That is the only constraint. Users can still create new parts, remove parts, and add multiple instances of the part type.