進階自訂 > Business Logic Customization > Customizing Configuration Specifications and Filters > Creating a Custom Configuration Specification Type in Edit Filter UI
Creating a Custom Configuration Specification Type in Edit Filter UI
You can create custom configuration specification type (custom configuration statement) in the Edit Filter UI, which can be used to resolve the structure. To create a new custom configuration statement, perform the following procedure:
* 
To apply this procedure, you must have an understanding of the basic web development using JAVA.
1. Create a subtype of custom configuration statement in the Type Manager.
2. Create the required global or local attributes.
3. Add the attributes in the Edit Filter layout of the subtype that you created.
4. Create implementation of the custom configuration statement. For more information, see the “Implementing Custom Configuration Statement” section below.
5. Bind the implementation of the subtype that you created by adding the record in the xconf file. See the “Binding Subtype for Custom Configuration Statement from Type Manager with Logic Implementation” section below.
Now the custom configuration statement is visible in the Edit Filter window. The logic implemented is used to resolve the structure.
Implementing Custom Configuration Statement
Create TestCustomConfigSpec.java file. Your class must extend the CustomConfigSpec class and override appendSearchCriteria and process methods. You can use the getAttributesMap method to get the values of all attributes that are set in the EditFilter widget when creating custom configuration statement.
The appendSearchCriteria method can be used for building the query to resolve the structure to the correct version.
The process method processes the QueryResult of iterations, returning only those that match according to the algorithm.
The getAttributesMap method returns a map of attributes that are set in the EditFilter widget when creating the custom configuration statement. The key in the map is the internalName of the attribute, value is the value sent from the client and processed by the dataUtility of that attribute.
Binding Subtype for Custom Configuration Statement from Type Manager with Logic Implementation
Add record in the xconf file and specify the class implementation and the subtype externalName:
<Service context="default" name="wt.configspec.custom.CustomConfigSpec">
<Option cardinality="singleton" requestor="null" serviceClass="wt.configspec.custom.TestCustomConfigSpec"
selector="WCTYPE|wt.configspec.custom.CustomConfigSpec|org.rnd.TestConfigSpec"/>
</Service>
In this example, wt.configspec.custom.TestCustomConfigSpec is the implementation of the configuration specification and WCTYPE|wt.configspec.custom.CustomConfigSpec|org.rnd.TestConfigSpec is the external path of your subtype.
For more information, see Windchill Client Architecture Overview.
這是否有幫助?