Вы находитесь на странице: 1из 2

Creating Simple Validation Filters

TODD BALTES

Simple Validation filters are a powerful way to control individual actions available in the PTC Windchill
10.2 environment. Filtering actions with custom simple validation filters allows you to specify the
conditions that determine when an action will be available to the user. For more information, see
Implementing Validation Filters in the PTC Windchill 10.2 Customizers Guide.
Creating custom filters is not difficult, but it requires some Java code as well as some PTC Windchill
configuration. This document outlines the steps needed to create, register, and apply a custom simple
validation filter.
Create a Custom Simple Validation Filter in PTC Windchill
To create the filter, you will need to extend the PTC Windchill abstract filter class
DefaultSimpleValidationFilter, and implement the preValidateAction method. This method will return
a UIValidationStatus that determines the state of the action enabled, disabled, or hidden.
Here is a simple example that enables an action for End Item WTParts:

Add an xconf entry to register the filter


The custom simple validation filter needs to be registered. To do this, an xconf property defining the
simple validation filter must be defined and propagated. This registers the custom Java class as a named
filter in the PTC Windchill environment.
The name you provide for the filter in this xconf registration is the name that is then used to apply the
filter to one or more actions.
<Property
name="wt.services/svc/default/com.ptc.core.ui.validation.SimpleValidationFilter/IsEndItem/null/0"
overridable="true" targetFile="codebase/service.properties"
value="com.example.IsEndItemFilter/duplicate"/>

Apply the filter to one or more actions


Custom simple validation filters can then be applied to one or more actions using the <includeFilter> tag
in the action definition.
In your custom actions file, decorate the desired actions with the filter as shown in the example.

Вам также может понравиться