Advanced Customization > Business Logic Customization > Customizations for PDM > Customizing the Parameters in the Download Service
Customizing the Parameters in the Download Service
Out-of-the-box delegate
Windchill provides an out-of-the-box mechanism to pass additional information related to the CAD Document as custom system parameters.
To customize the parameters, set the server-side preference,Workgroup Manager Client > Mapping Custom System Attributes and File Properties at the site level.
The value is a list of additional attributes from objects related to the CAD Document that are shown in the CAD tool as parameters or properties.
The value is a comma separated list of CAD property and Windchill attribute pairs in the following format:
<name_of_CAD_property>:<relatedObjectCode>.<WindchillAttributeName>
Where:
Value
Description
Possible values
name_of_CAD_property
This is the name of the parameter or property in the CAD tool
PART_REVISION
relatedObjectCode
This is the string used to identify the related object
docMaster
associatedPart
relatedECN
WindchillAttributeName
This is the logical name or internal name of the attribute in Windchill for the related object
soft type attributes on CAD Document Master
Part Attributes
soft type attribute on the related Part of type Boolean, Date, Integer, Real, Real with Units or String
lifeCycleState
lifecycleTemplate.name
name,
number
orgid
view.identity
For related ECN
number
orgid
resolutionDate
* 
For soft-type attributes, values sent to the CAD tool are the display values as seen on the object’s Information page. Display values use Attribute Handling preferences and Type and Attribute Management settings but do not support complex display customizations using data utilities for rendering.
This functionality can only be used if you do not have a customized server-side delegate CustomModeledAttributesDelegate that can be used to insert parameters (see the next section below for Custom Delegate).
For the associated part:
This functionality supports parts related to the CAD Document with Owner, Contributing Image, Image and Contributing Content.
The selected part version is similar to the CAD Document’s information page related parts table.
If more than one revision of the same part is related to the CAD Document, then the latest revision of each part is returned.
More than one part can be returned if the system is configured to allow multiple build associations, with the server-side preference Operations > Auto Associate > Allow CAD Document To Build Multiple Parts set to Yes. In this case, the information for each related part is returned in a delimited format. The delimiter used is defined by the server-side preferenceAttribute Handling > Delimiter for multivalued attributes.
For the related ECN:
When the CAD Document revision participates in the Change Notice as either Affected or Resulting Object, then the attributes about the ECN are sent to the CAD parameter:
If the CAD Document revision participates in more than one Change Notice , then the delimiter used is defined by the server-side preference Attribute Handling > Delimiter for multivalued attributes.
Custom Delegate
If your business process requires that other attributes are communicated to the CAD tool, then Windchill provides a server-side delegate that can be used to insert parameters into a Creo Parametric model upon download. This mechanism can be used to pass information from the server down to Creo Parametric, where it can be used like any other Creo Parametric parameter (for example, to place information on drawing forms). Parameters beginning with “PTC” or “PROI” are regarded as reserved system parameters and cannot be propagated by the customization. If they are added in the customization, they are ignored by the download service.
* 
This functionality is applicable to all Windchill Workgroup Managers integrating with 3rd party CAD tools
* 
The customized parameters are provided to the client upon download and, unlike system parameters such as PTC_WM_ITERATION, are not updated in the Creo Parametric session or the local cache after a Windchill operation (for example, check in).
For example, if a customized parameter is assigned the value of the CAD document number, its value is provided to the client upon model download. If the CAD document is later renumbered, the value in the Creo Parametric session or the client cache will not be automatically updated.
The Windchill service delegate mechanism is used to allow the customization. The following steps explain the customization process:
1. Create a Java class that implements the interface ModeledAttributesDelegate. The interface definition is as follows:
package com.ptc.windchill.uwgm.proesrv.c11n;
import java.util.Collection;
import java.util.HashMap;
import wt.util.WTException;
public interface ModeledAttributesDelegate
{
/*
Implement this API to return list of parameters added by
customization along with it's type (customization profile of the
server). For example "WT_CADDOC_NUMBER" custom parameter will
be of type "String.class" (the java class)
*/
// getAvailableAttributes() returns
// HashMap<String, Object> which contains
// HashMap<Attribute name, Attribute type>
HashMap getAvailableAttributes();
/*
This is the API, invoked by the download service on download, to
be implemented for the customization. Create and return a
HashMap where key is input object and value is HashMap of
parameter name - value pairs that must be propagated to Pro/E
part represented by the EPMDocument (input object). Use the
getCADName() API on the EPMDocument to identify the Pro/E part
*/
// getModeledAttributes(Collection docs) returns
// HashMap<input object, HashMap<Attribute name, Attribute
value> HashMap getModeledAttributes(Collection docs) throws
WTException;
}
2. The PTC provided custom system attributes are available out-of-the-box in theDefaultModeledAttributesDelegate. However, the site.xconf file (found in <Windchill>) can be changed to point to your customization service on the server:
<Service context="default"
name="com.ptc.windchill.uwgm.proesrv.c11n.ModeledAttributesDele
gate" targetFile=codebase/service.properties">

<Option cardinality="singleton"
requestor="java.lang.Object"
serviceClass="com.ptc.windchill.uwgm.proesrv.c11n.CustomerXYZModeledAttributesDelegate"/>

</Service>
Then use the xconfmanager tool to apply the changes to service.properties file (run xconfmanager -p)
Use the path of your class in place of value of serviceClass (that is, replace com.ptc.windchill.uwgm.proesrv.c11n.DefaultModeledAttributesDelegate with the path to your class).
3. Restart the method server.
Isto foi útil?