Customizing Queries, Global Sets and Filters

Customizing Queries
Customizing Global Sets
Customizing Filters
 

How to Define Custom Queries, Global Sets and Filters

All custom queries, global sets and filters are added to a single xml file, CATReconcileCustomize.xml

 <?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <criterionList>
        <!-- declaration of customized queries here -->
    </criterionList>

    <globalSetList keepOldGS="false">
        <!-- declaration of customized global sets here -->
    </globalSetList>

    <searchNodeFilterList>
        <!-- declaration of customized SearchNode filters here -->
    </searchNodeFilterList>
</configuration>

The environment variable $CATReconcilePath specifies the path where the CATReconcileCustomize.xml file is located.  The following command can be used to set your environment:
chcatenv -e $CATDefaultEnvironment -a user -var "CATReconcilePath=../ReconciliatorCustom
F
or more information on setting your environment please refer to the CATIA Installation and Deployment Guide> Customizing your Environment on Windows or Customizing your Environment on UNIX. 

Customizing Queries 

Queries are used to map objects loaded in CATIA to objects existing in the VPDM.  Three queries are provided for mapping objects to ENOVIA V5 VPM:  Easy Query, Query Document by Part Id and Mapping Objects using Query.  Two queries are provided for mapping objects to ENOVIAVPM:  Simple Query and Intermediate Query.  Custom queries can be defined based on any of the standard queries.  Custom queries can define the parameters that make up the query and/or supply default values for the query parameters.  The following steps summarize how the custom query works:


 

  • The In.xsl file converts the standard query xml to the custom query xml

  • The query panel is displayed based on the parameters specified in the custom query xml.

  • The user establishes their query criteria in the query panel and clicks the Ok button of the query panel.

  • The custom query xml stream is generated by the system based on the query panel.

  • The Out.xsl file converts the custom query xml to the standard query xml which can be read by the system to return the desired query results.

To produce a custom query you will need to:

  • Understand the xml for the standard query you want to customize.

  • Create the In xslt file

  • Create the Out xslt file

  • Define the custom query name

 

 

In the CATReconcileCustomize.xml file, each custom query will define, at a minimum, the query name, the standard query on which it is based and the xslt (Extensible Stylesheet Language Transformations) files (In/Out).

Example of a Custom Query definition

This sample CATReconcileCustomize.xml file defines three custom queries:  UserCriterion_1, UserCriterion_2, UserCriterion_3.  All are based on the Query by Object Id standard query.  All specify the same In/Out xslt files:  UserCriterionIn.xsl and UserCriterionOut.xsl.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<criterionList>
<criterion name="UserCriterion_1" environment="ENOVIA5" father="Query by_object Id"
order="1" In="UserCriterionIn.xsl" Out="UserCriterionOut.xsl"/>
<criterion name="UserCriterion_2" environment="ENOVIA5" father="Query by_object Id"
order="2" In="UserCriterionIn.xsl" Out="UserCriterionOut.xsl"/>
<criterion name="UserCriterion_3" environment="ENOVIA5" father="Query by_object Id"
order="3" In="UserCriterionIn.xsl" Out="UserCriterionOut.xsl"/>
</criterionList>
</configuration>

 

 The following table details the structure of the query definition in the  CATReconcileCustomize xml file:

XML Node Attribute Definition
configuration classpath Specifies the java $CLASSPATH for the xslt conversion
criterionList    

criterion

name Displays the name of the custom query

 

environment VPDM environment applicable for this query.  Setting this value will automatically set the correct VPDM when this query is chosen.  Values:  VPM1 (for ENOVIAVPM), ENOVIA5 (for ENOVIA V5 VPM)
  father Name of the query on which the custom query is based.  Values: Simple Query, Intermediate Query, Easy Query, Query Document by Part Id, Query by object Id

 

order Enables the criteria to be displayed in the specified order in the user interface.
  In Name of the xslt file used to transform the standard (father) query's xml file into a new xml that describes the customized query.  Only the transformed xml file can be used to display the query in the list of queries.  The absolute path must be specified if the files are not in the same directory as CATReconcileCustomize.xml.  May be specified using DLName.

 

Out

Name of the xslt file used after the user inputs their search criteria and executes the search. The Out xslt file is used to transform the customized query into one that can be used by the query.  The absolute path must be specified if the files are not in the same directory as CATReconcileCustomize.xml.  May be specified using DLName.

 

How to Use a Custom Query in the Global Query Global Set

The custom queries you develop can be incorporated in the Global Query global set by editing the xml that describes the parameters of this global set.  To do this, modify the following file located in:

  UNIX:  <unload_dir>/<os>_a/reffiles/SuppChain

  MS-Windows:  <unload_dir>\<os>_a\reffiles\SuppChain

For ENOVIA V5 VPM:  CATPDMAutoRulesValuator_GlobalQueryXSMLForm_ENOVIAV5.xml

For ENOVIA VPM V4:  CATPDMAutoRulesValuator_GlobalQueryXMLForm_VPM1.xml

Add a line for each custom query in the queryName section of the xml definition as follows (in this example, the custom query UserCriterion_1 is added to the list of standard queries):

<ParametersList>
<Parameter Name="queryName" Type="String"
Alias="%CATPDMReconcileAutoRules:queryName%" Mandatory="Yes">
<DefaultValuesList>
<DefaultValue>%EV5PDMCriterion:EV5.ByName%</DefaultValue>
<DefaultValue>%EV5PDMCriterion:EV5.PartByName%</DefaultValue>
<DefaultValue>%EV5PDMCriterion:EV5.EasyName%</DefaultValue>
<DefaultValue>UserCriterion_1</DefaultValue>
</DefaultValuesList>
<CurrentValue>%EV5PDMCriterion:EV5.ByName%</CurrentValue>
</Parameter>
...
</ParametersList>

 

Defining the In/Out XSLT Files

Each of the standard queries is defined by an xml file which describes all the available attributes for the query. When you are mapping objects in the reconciliator and you select a particular query (for example, Easy Query) the xml file defining all the attributes is used to create the query displayed.

To assist you in defining your own custom queries, the environment variable REC_Display_CustomCriterion=1 can be set to display (in standard output) the xml for any query in the reconciliator.

 The following table details the structure of the query xml file

XML Node Attribute Definition
Parameter List   Root of the xml document
Parameter Name Query parameter identifier

 

Type Attribute type (i.e. String)

 

Alias Query paramter display name
  Shown Indicates if the query parameter is to be displayed.  Values: Yes/No

 

Mandatory Indicates if the query paramter must be defined. Values:  Yes/No
  Sensitive Indicates if updating the query parameter will result in the check process.  Values:  Yes/No

 

AccessMode

Indicates if how the values can be accessed. Values: ReadWrite/ReadOnly

  Template Values:  Yes/No

 

AccessMode

Indicates if how the values can be accessed. Values: ReadWrite/Read

  Multi-valuated Indicates if the query parameter allows multiple values.  Values:  Yes/No

 

DefaultListExtensible

Indicates if the query parameter has authorized values (i.e. a drop-down list of possible values is shown). If yes then the DefaultValuesList is used to populate the the list of authorized values). Values:  Yes/No

DefaultValuesList   Used to define a list of authorized values

DefaultValue

 

Authorized value for a paramter

CurrentValue   Current value for the parameter

To create a custom query, you will need to create two xslt files

  • The In xslt file transforms the standard query xml into a new custom query xml. The new custom query xml file is used to display the custom query when it has been chosen by the user.
    Example:  The In xslt file, Custom_Query_By_Object_ID_In.xsl, can be used to modify the Query By Object ID query from

    to

    The standard query has been customized in the following ways:

    • Type is a drop-down list in the dialog box with the values: Document, CATPart, CATProduct and Model

    • Supplier is a new read only field that contains the default value: Supplier 1.

    • Prefix  replaces the Search String field.  It is used to input a prefix to the search string.  This field has a  default value:  Rec_.

    • Part ID is a new field used to input the search string

  • The Out xslt file is used (after the user inputs their criteria into the query dialog and applies the query) to transform the custom query xml into the xml file of the chosen standard query so it can be used by the system to retrieve the query results.
    Example:  The Out xslt file, Custom_Query_By_Object_ID_Out.xsl, not only transforms the custom query back into the standard one which can be used by the sytem to execute the query, it also concatenates the Prefix and Part ID fields and uses this value as the Search String.

 

Customizing Global Sets 

Global Sets are pre-defined rules that allow you to automate the process of defining reconciliation rules.  You can customize global sets by inheriting existing (base product) global sets and fixing some of their input values. 

Global Sets are customized similar to the way queries are customized, i.e. they are defined in the CATReconcileCustomize.xml
 

Example of a Custom Global Set definition

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<globalSetList>
<globalSet name="Easy Query" environment="ENOVIA5" order="1" show="Yes" globalSetImpl="CATPDMAutoRulesValuator_GlobalQuery" globalSetForm="default"/>
<gsParam name="queryName">Easy Query</gsParam>

</globalSet>
</globalSetList>
</configuration>

The following table details global set definition in the  xml file

XML Node Attribute Definition
configuration classpath Specifies the java $CLASSPATH for the xslt conversion
globalSetList    

globalSet

name the name of the custom global set

 

environment VPDM environment applicable for this query.  Setting this value will automatically set the correct VPDM when this query is chosen.  Values:  VPM1 (for ENOVIAVPM), ENOVIA5 (for ENOVIA V5 VPM), ANY (all available environments)
  show attribute means to add the global set in the user interface display.  If the global set is not shown, then it is only available from batch.

 

order Enables the global set to be displayed in the specified order in the user interface.
  globalSetImpl the name of the global set to inherit from

 

gsParam used to specify (fix) global set parameters.  The parameters listed will be displayed as read-only.  See the table below for available input parameters for each global set. 
  globalSetForm used to refer to an XMLForm file if you want to use a form panel other than the default.  Possible values are "default" (to use the same as the inherited global set) or "none" (if no panel should be displayed).

The following table details available input parameters for each global set:

Global Set Parameter Meaning Values
CATPDMAutoRulesValuator_AllAtNew
 
forceNew force even on mapped objects YES (or TRUE)
NO (or FALSE)

NO is the default.

CATPDMAutoRulesValuator_GlobalQuery
 
queryName query name Name of query (as displayed in the reconciliater panel)
  skipWhenMapped skip or not already mapped objects YES (or TRUE)
NO (or FALSE)

NO is the default.

  implicitRule the rule of all objects that are mapped is set to Overwrite and all objects that are not mapped is set to New. YES (or TRUE)
NO (or FALSE)

YES is the default.

CATPDMAutoRulesValuator_GlobalEnv vpdm environment name to set on all objects  
  structure exposition (storage) mode is structure exposed YES (or TRUE)
NO (or FALSE)

YES is the default

CATPDMAutoRulesValuator_AllAtOverWrite forceOverwrite force overwrite even on mapped objects YES (or TRUE)
NO (or FALSE)

NO is the default.

CATPDMAutoRulesValuator_AllAtNewVersion forceNewVersion all objects, even those with rules already defined on them, will be set to New Version,  if possible. YES (or TRUE)
NO (or FALSE)

NO is the default.

  onlyOnDocuments version only part version of the CATPart documents YES (or TRUE)
NO (or FALSE)

NO is the default.

CATPDMAutoRulesValuator_ResetAll reset reset all object mapping and/or rules. OnlyRules
RuleAndMapping
CATPDMAutoRulesValuator_AllAtReload forceReload force reload even on mapped objects YES (or TRUE)
NO (or FALSE)

NO is the default.

CATPDMAutoRulesValuator_AllAtNewRevision forceNewRevision force new revision even on mapped objects YES (or TRUE)
NO (or FALSE)

NO is the default.

CATPDMAutoRulesValuator_AllAtKeepExternal forceKeepExternal force keep external even on mapped objects YES (or TRUE)
NO (or FALSE)

NO is the default.

CATPDMAutoRulesValuator_VPDMMapping queryNameForPRC query name to use to map the PRC name of query (as displayed in Reconciliator interface)
  implicitRule apply implicit rule after query YES (or TRUE)
NO (or FALSE)

YES is the default

 

Customizing Filters 

SearchNode filters are used to select a subset of objects (locate objects) to run a global set on.  You can customize searchNode filters by inheriting existing (base product) filters and fixing some of their input values. 

SearchNode filters are customized similar to the way queries and global sets are customized, i.e. they are defined in the CATReconcileCustomize.xml
 

Example of a Custom SearchNode filter definition

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<searchNodeFilterList>
<searchNodeFilter name="SelectAllDocuments" show="Yes" filteringForm="none" filteringImpl="SearchNode">
<filterParam name="TYPE">ANYDOC</filterParam>

</searchNodeFilter>
</searchNodeFilterList>
</configuration>

The following table details global set definition in the  xml file

XML Node Attribute Definition
configuration classpath Specifies the java $CLASSPATH for the xslt conversion
searchNodeFilterList    

searchNodeFilter

name the name of the custom filter
  show attribute means to add the filter in the user interface display.  If the filter is not shown, then it is only available from batch.

 

order Enables the filter to be displayed in the specified order in the user interface.
  filteringImpl the type of filter to inherit from

 

filterParam used to specify (fix) filter parameters.  The parameters listed will be displayed as read-only.  See the table below for available input parameters for each filter. 
  filteringForm used to refer to an XMLForm file if you want to use a form panel other than the default.  Possible values are "default" (to use the same as the inherited global set) or "none" (if no panel should be displayed).

The following table details available input parameters:

SearchNode Filter Inputs Availability Meaning Values
ScmType   Scm object type ANY, PART, ANYDOC, DOC, PROXYDOC

default is ANY

DocExt available if Type is ANYDOC, DOC or PROXYDOC the extension of the document string
ANY can be used for all extension types to be accepted
SubTree   name of the Scm object considered as the root of the tree  
Name   name of the Scm object as displayed in the CATIA view of the reconciliator interface. string
FileName available if Type is ANYDOC, DOC or PROXYDOC name of the file corresponding to the document string
State   status ANY (criterion not set)
MAPPED
NOTMAPPED
Mode   exposition (storage) mode ANY (criterion not set)
PUBEXP
STRUCTEXP
<Attr Name>   attribute name/value pair.  Attr Name is actually the display name of the attribute (for example, owner). string