Creating custom types
In the Project Parameter Configuration, you can define Custom Types (Enums) with Custom Type Values (Enum values) that you can select later when creating a project parameter.
Custom Types are created via Manage Custom Types.
Possible use case:
- Custom Type Values as selection options in the Condition Editor (see Creating and using conditions).
Creating Custom Types with Custom Type Values
Use case:
In this example, we create the Custom Type AnswerOption
with the Custom Type Values YES
, NO
, MAYBE
and the Display Names yes
, no
, maybe
:
How to open the window Manage Custom Types
Open an existing file *.param
(Project Parameter Configuration).
There are two ways how you can add Custom Types:
- In the pane Parameters, click Manage Custom Types.
- In the pane Parameters, in the Type column of the new project parameter to be created, open the drop-down list and select the option Add Custom Type.
The window Manage Custom Types opens:
How to create Custom Types with Custom Type Values
In the pane Custom Types, click Add to add a new Custom Type.
A new Custom Type with the predefined name CustomType has been created.Note
The name of the Custom Type must be unique.
In the pane Custom Type Values, you can now add the Custom Type Values with Display Name.
Click Add to add a new Custom Type Value with Display Name.
Click OK to save the Custom Types with the defined values.
A new Custom Type with Custom Type Values has been created.
The new Custom Type with Custom Type Values can now be selected in the Type column when creating new project parameters:
Field | Description | Name in Source (XML) |
---|---|---|
Custom Type Name | Name of the Custom Type, selectable in the column Type as additional Type | Enum name |
Custom Type Value – Value | Selection options (Values), selectable in the column Value when creating a new project parameter with Custom Type | <Value> yes<Value> |
Attribute: Custom Type Value – Display Name | Display name of the value |
|
<Parameters xmlns="http://softproject.de/parameter/1.0">
<Enums>
<Enum name="AnswerOption">
<Value displayName="yes">YES</Value>
<Value displayName="no">NO</Value>
<Value displayName="maybe">MAYBE</Value>
</Enum>
</Enums>
<VariableParameter name="Answer" type="AnswerOption">
<Value>YES</Value>
</VariableParameter>
</Parameters>
How to change the name of a Custom Type
Note
You can change the name of a Custom Type in the pane Custom Types in the field Name.
- Open the window Manage Custom Types.
- In the pane Custom Types, click on the Custom Type.
- Edit the name in the field Name:
Deleting Custom Types and Custom Type Values
Deleting a Custom Type
What happens when I delete a Custom Type that is in use?
When a Custom Type is deleted, the Type is set to String
, but the previously set Custom Type Value in the Value column is retained:
How to delete a Custom Type:
- Open an existing
*.param
file (Project Parameter Configuration). - Click Manage Custom Types.
- In the pane Custom Types, select the Custom Type you want to delete.
- In the pane Custom Types, click Remove.
- The window for confirming the deletion opens:
- Click OK to confirm the deletion of the Custom Type.
The Custom Type is deleted.
Deleting Custom Type Values
What happens if I delete a Custom Type Value that is in use?
Before deleting a Custom Type Value, a window appears asking which value should be set instead.
How to delete a Custom Type Value:
- Open an existing
*.param
file (Project Parameter Configuration). - Click Manage Custom Types.
- In the pane Custom Type Values, select the Custom Type Value you want to delete.
- In the pane Custom Type Values, click Remove.
- The window for confirming the deletion opens. If the Custom Type Value is in use, you have the possibility to replace the Custom Type Value with another one:
- Select the value to be used for replacement.
- Click OK to confirm the deletion of the Custom Type Value.
- The Custom Type Value has been deleted, and the value selected for replacement has been used.
Renaming Project Parameters with Custom Types
Renaming project parameters with Custom Types is done like renaming project parameters (see Renaming project parameters).