Editing the Delegate (NX)
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
promote
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
partType
For related ECN
number
orgid
resolutionDate
For promote
number
orgid
approvers
approveDates
reviewers
reviewDates
* 
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 preference Workgroup Manager Client > Custom System Attributes Delimiter For Multiple Related Objects.
For the related ECN:
When the CAD Document revision participates in the Change Notice as 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 Workgroup Manager Client > Custom System Attributes Delimiter For Multiple Related Objects..
The rejected ECNs are not listed.
For the Promotion request:
When the CAD Document version participates in the Promotion request, then the attributes about the Promotion are sent to the CAD parameter.
If the CAD Document version participates in more than one Promotion request, then the delimiter used is defined by the server-side preference Workgroup Manager Client > Custom System Attributes Delimiter For Multiple Related Objects..
The rejected Promotion request is not listed.
Custom Delegate
Windchill provides a server-side delegate that can be used to insert parameters into a authoring application part upon download. This mechanism can be used to pass information from the server down to the authoring application, where it can be used like any other authoring application 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.
* 
If you configure the system to use a custom delegate, then the attributes defined in the server-side preference, Workgroup Manger Client > Mapping Custom System Attributes and File Properties are not used. Only the PTC delegate checks that preference.
The customized parameters are provided to the client upon download and are not updated in the CAD application session after a Windchill operation such as 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 download. If the CAD document is later renumbered, the value in the authoring application session or the client cache is not 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

{

// getAvailableAttributes() returns

// HashMap<String, Object> which contains

// HashMap<Attribute name, Attribute type>

HashMap getAvailableAttributes();

// getModeledAttributes(Collection docs) returns

// HashMap<input object, HashMap<Attribute name,

Attribute value>>

HashMap getModeledAttributes(Collection docs)

throws WTException;

}

Please see a sample implementation located at:<Windchill home>/codebase/com/ptc/windchill/uwgm/proesrv/c11n/DefaultModeledAttributesDelegate.java
2. The PTC provided custom system attributes are available out-of-the-box in the DefaultModeledAttributesDelegate. 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.ModeledAttributesDelegate"

targetFile="codebase/service.properties">

<Option cardinality="singleton"

requestor="java.lang.Object"

serviceClass="com.ptc.windchill.uwgm.proesrv.c11n.DefaultModeled

AttributesDelegate"/>

</Service>
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. Then use the xconfmanager tool to apply the changes to service.properties file. (run xconfmanager -p ).
4. Restart Windchill.
¿Fue esto útil?