Integration with Other Applications > Integration with Creo Elements/Direct Model Manager > Configuration > Configuring Publishing
  
Configuring Publishing
GatewayConfig.xml file
The configuration for the publishing is specified in the <Manager Server installation>\windchill\GatewayConfig.xml file. The GatewayConfig.xml file allows you to control the mapping of Creo Elements/Direct Model Manager objects to Windchill objects in a very flexible manner. For special requirements, it even allows you to plug in customized implementations at different levels.
To modify the GatewayConfig.xml file, edit the file and restart the Creo Elements/Direct Model Manager Services in the Windows Services Panel. Customized configurations can also be saved in the CustomGatewayConfig.xml file — if this file exists, it will take precedence over the default GatewayConfig.xml file.
General Control Parameters
Parameter
Description
Default
ScanStructure
Controls whether the export will follow the structure to collect all parts
true
WriteDocuments
Controls whether Windchill documents are written
true
WritePartUsageLinks
Controls whether part usage links (such as BOM structure) are written
true
WritePartDescribeLinks
Controls whether the documents are linked to the parts
true
WriteContentItems
Controls whether content items (thumbnails, file attachments) are written
true
Incremental
When set to true, a previously published part or model that has not changed will not be written to the IXB when the Windchill data is updated
true
WriteRepresentationForRoot
When set to ‘if_exists’, viewable available for the top-level masterdata objects are attached as representations to the Windchill part.
if_exists
WriteRepresentationForChildren
When set to ‘if_exists’, viewable available for the child masterdata objects are attached as representations to the Windchill part
if_exists
Specifying Windchill Target Product – Section <Windchill Configuration>
Data is imported into Windchill on behalf of the user who triggered the job on the Model Manager side.
Parameter
Description
Organization
Windchill organization name
Product
Windchill product name — mutually exclusive with library
Library
Windchill library name — mutually exclusive with product
Controlling Versioning
When data changes in Creo Elements/Direct Model Manager and must be updated in Windchill, the following versioning rules apply:
1. If the structure underneath a masterdata object changes, a new iteration of the Windchill part is created in Windchill.
2. If the geometry of a model or drawing changes, a new iteration of the corresponding Windchill document is created.
3. If a new minor or major version of a model or drawing was created in Creo Elements/Direct Model Manager, a new iteration of the corresponding Windchill document is created.
4. If only attributes values for a masterdata, model or drawing changes, the corresponding object in Windchill is iterated and overwritten, based on the configuration parameter ‘IterateOnAttributeChanges.’
5. If a new or modified file attachment is available in Creo Elements/Direct Model Manager, this file is attached or updated in Windchill without creating a new iteration.
6. If a new masterdata revision was created in Creo Elements/Direct Model Manager, then a new version of the Windchill part will be created in Windchill
* 
This is applicable only if ‘Masterdata Revisioning’ is enabled in Creo Elements/Direct Model Manager— see Creo Elements/Direct Model Manager Help for more details.
The GatewayConfig.xml file allows you to define how new iterations propagate to the associated items if the overwrite option is used while saving the document to Creo Elements/Direct Model Manager. For instance, when model geometry changes, rule 2 applies, and a new iteration of the Windchill document is created. The ‘IteratePartOnNewDocumentIteration’ versioning switch allows you to control whether this automatically should trigger a new iteration on the Windchill part that is linked to this document.
Configuration Parameters for Versioning
Parameter
Description
Default
IterateDocumentOnNewPartIteration
When set to true, new iterations of all Windchill document children are created and linked to a new iteration of a Windchill part
false
IterateOnAttributeChange
When set to true, a new iteration of the Windchill object is created whenever any attribute on the Model Manager object changes. If set to false, the existing Windchill object is updated and overwritten.
(available with Creo Elements/Direct Model Manager 18.1 M060 and later)
true
IteratePartOnNewDocumentIteration
When set to true, a new iteration of theWindchill part is created whenever a new iteration of the linked Windchill document is created (for example, because of rule 2, 3 or 4)
true
ReviseChildrenOnNewPartRevision
When set to true, new revisions of all Windchill part children are created and linked to a new revision of a Windchill part
* 
This applies only if ‘Masterdata Revisioning’ is enabled in Model Manager.
false
Controlling Document Creation
The CadDocSelector allows you to select which Model Manager documents linked to a masterdata object are published to Windchill and linked to the corresponding Windchill part. The DefaultCadDocSelector selects the documents based on their type
Parameter
Description
Default
Class
Specifies the Model Manager business class of the documents to be transferred.
Controlling Number Generation
The Windchill Gateway for Creo Elements/Direct Model Manager uses the Windchill Number Generator to assign part or document numbers to new Windchill parts or documents. The numbers are generated by sending an HTTP request to Windchill. By default, a protocol-based authentication scheme (basic HTTP authentication) is used independently of the server’s authentication configuration. For Windchill 10.1 and beyond, you can use unauthenticated requests as an alternative. To accomplish this, the Model Manager server must be registered as trusted host in Windchill and the com.osm.windchill.rng.AnonymousHttpNumberReader must be configured in GatewayConfig.xml.
Numbers are retrieved and managed in blocks for better performance. When the gateway requests a number block but has not used all these numbers in a publishing operation, the numbers are saved and used for the next publishing operation. By default, the Windchill Gateway stores unused numbers in a file. Different persistence methods can also be implemented.
Parameter
Description
Default
NumberBlockSize
Number of IDs requested from Windchill in one request. These numbers are blocked on the Windchill side and used for the gateway.
100
NumberReader
Retrieves the numbers for new parts or documents from Windchill. Use the com.osm.windchill.rng. AnonymousHttpNumberReader for unauthenticated requests.
com.osm.windchill.rng.ProtocolBasedHttpNumberReader
NumberStore
The <File> tag allows you to specify the name of the file where unused numbers are stored. The path can be absolute or relative to the <server>\windchill directory.
NumberStore.xml in the windchill directory
Controlling User Mapping
Data is imported into Windchill on behalf of the user who triggered the job on the Model Manager side. This requires mapping the Creo Elements/Direct Model Manager users to the Windchill users. When no mapping is specified, the data is imported using a default user. The Windchill Gateway for Creo Elements/Direct Model Manager provides a simple implementation to specify such a mapping in an XML file. Different mapping methods (for example, user mapping information retrieved from a database) can also be implemented.
Parameter
Description
Default
UserMapStore
The <File> tag allows you to specify the name of the file where mapping is stored. The path can be absolute or relative to the <server>\windchill directory.
UserMap.xml in the windchill directory
Specify the mapping in the following XML format:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<UserMap>
<User ModelManagerUser="medmgr">wcadmin</User>
<User ModelManagerUser="user1">demo</User>
</UserMap>
Specifying Windchill Configuration — Section <Windchill Configuration>
Set the Windchill-specific parameters for mapping as follows:
Parameter
Description
Default
FolderPath
Path to Windchill folder where objects are created
/Default
DomainName
Domain name for Windchill objects
/Default
Department
Department for Windchill objects
ENG
VersionLevel
Version level to be used for Windchill objects
1
UfidRepositoryID/UfidDomain
Elements of theWindchill object UFIDs that are generated by Creo Elements/Direct Model Manager
ModelManagerGateway
Configuring Windchill Parts — Section <WTPartFactory>
This section includes entries that control the values and attachments for Windchill parts
Parameter
Description
Default
UfidGenerator
See the Customization section
None
NumberGenerator
See the Customization section
None
StateMap
Defines the mapping of Creo Elements/Direct Model Manager lifecycle states to Windchill states
As shown in the <Map> tags. All Creo Elements/Direct Model Manager states not explicitly listed are mapped to the <DefaultState>
Attributes
See the Attribute Mapping section
None
IBAs
See the Attribute Mapping section
None
ContentItems
See the Configuring Content Items – Section <ContentItems> section
JPEG thumbnail
Representations
See the Configuring Representations – Section <Representations> section
For 3D: PVZ
For 2D: DXF
Configuring Windchill Documents – Section <WTDocumentFactory>
This section includes entries that control the values and attachments forWindchill documents
Parameter
Description
Default
UfidGenerator
See the Customization section
None
NumberGenerator
See the Customization section
None
StateMap
Defines the mapping of Creo Elements/Direct Model Manager lifecycle states to Windchill states
As shown in the <Map> tags. All Creo Elements/Direct Model Manager states not explicitly listed are mapped to the <DefaultState>
Attributes
See the Attribute Mapping section
None
IBAs
See the Attribute Mapping section
None
ContentItems
See the Configuring Content Items – Section <ContentItems> section
JPEG thumbnail
Model Manager Link File (MMLF)
Representations
See the section Configuring Representations – Section <Representations>
None
Configuring Windchill Part Usage Links – Section <WTPartUsageLinkFactory>
This section includes entries that control the values for Windchill part usage links:
Parameter
Description
Attributes
See the section Attribute Mapping
IBAs
See the section Attribute Mapping
Configuring Content Items – Section <ContentItems>
This section describes a list of files that are attached to the Windchill part or Windchill document. The specific format must already exist in Creo Elements/Direct Model Manager.
Parameter
Description
FileType
File type as specified in the <FileType> elements of wmconf.xml
Attributes
Attributes that apply to content items for evaluation. See the section Attribute Mapping
Configuring Representations – Section <Representations>
This section describes a list of representations that are attached to the Windchill part or Windchill document. The specific format must already exist in Creo Elements/Direct Model Manager.
Parameter
Description
FileType
File type as specified in the <FileType> elements of wmconf.xml
Attributes
Attributes that apply to representations for evaluation. See the section Attribute Mapping
Configuring Adapter – Section <Adapter>
This section contains settings for communication between the Gateway Service and the MOM server and Windchill, respectively. These values should only be modified by running the Creo Elements/Direct Model Manager.server configuration tool.
Customization
You can replace the default implementations for the export operations with customized implementations. See the Model Manager Customization Guide for details on writing custom code for Creo Elements/Direct Model Manager.
Replacing a particular operation by a customized implementation involves two steps:
1. Implement an interface defined for this operation. Often the new implementation derives from the original Java class and adds or modifies certain steps by overwriting the appropriate methods.
2. Register the new implementation in the ‘java_class’ attribute of the component in GatewayConfig.xml.
For example, if you want to change the algorithm for selecting documents to be exported
1. Implement the IDocumentSelector interface
public class MyDocumentSelector extends XmlConfigurable implements IDocumentSelector
{
….
}
2. Register the new implementation in the <DocumentSelector> element in GatewayConfig.xml
<DocumentSelector java_class="com.osm.windchill.export.MyDocumentSelector ">
...
</DocumentSelector>
The following table shows a list of components that can be replaced.
XML Element
Description
Interface To Be Implemented
Default Implementation
<Exporter>
Defines the main export steps
com.osm.integration.export.IExporter
com.osm.windchill.export.DefaultWindchillExporter
<VersioningRule>
Defines the rules used to decide when to create new Windchill revisions or iterations
com.osm.windchill.export.IVersioningRule
com.osm.windchill.export.DefaultVersioningRule
<DocumentSelector>
Selects documents to be mapped to Windchill documents
com.osm.windchill.export.IDocumentSelector
com.osm.windchill.export.DefaultDocumentSelector
<NumberReader>
Collects the numbers for new Windchill parts or documents; the default implementation
com.osm.windchill.rng.INumberReader
com.osm.windchill.rng.WindchillNumberReader (queries the numbers from Windchill through an HTTP request)
<NumberStore>
The persistence method for numbers that were blocked in Windchill but not used yet
com.osm.windchill.rng.INumberStore
com.osm.windchill.rng.XMLNumberStore (stores the user mapping in an XML file on the server file system)
<UfidGenerator>
Generates a UFID for a new Windchill part or Windchill document
com.osm.windchill.export.IUfidGenerator
com.osm.windchill.export.DefaultUfidGenerator
<UserMapStore>
The persistence method for user mapping information
com.osm.windchill.mapping.IUserMapStore
com.osm.windchill.mapping.XMLUserMapStore (stores the user mapping in an XML file on the server file system)
<NumberGenerator>
Generates the number of a new Windchill part or Windchill document
com.osm.windchill.rng.INumberGenerator
com.osm.windchill.rng.WindchillNumberGenerator (assigns numbers that are retrieved from Windchill— see also <WindchillNumberManager>
When autonumbering is turned off in Windchill, the number generation (and, by extension, the export operation) fails. In this case, you can specify an alternative number generator in the <AutonumberingOffHandler> element.
<StateMap>
Defines the mapping ofCreo Elements/Direct Model Manager lifecycle states to Windchill states
com.osm.windchill.mapping.ILifecycleStateMap
com.osm.windchill.mapping.DefaultLifecycleStateMap (applies the mapping specified in GatewayConfig.xml)
The following components are responsible for creating the actual XML files in the IXB format. You can find all the interfaces and implementations in the com.osm.windchill.wt package.
XML Element
Description
Interface To Be Implemented
Default Implementation
<WTPartFactory>
Creates Windchill part XML files
IWTPartFactory
DefaultWTPartFactory
<WTDocumentFactory>
Creates Windchill document XML files
IWTDocumentFactory
DefaultWTDocumentFactory
<WTPartUsageLinkFactory>
Creates Windchill part UsageLink XML files
IWTPartUsageLinkFactory
DefaultWTPartUsageLinkFactory
<WTPartDescribeLinkFactory>
Creates Windchill part DescribeLink XML files
IWTPartDescribeLinkFactory
DefaultWTPartDescribeLinkFactory
<WTContentItemFactory>
Creates content item references that are included in Windchill part or Windchill document XML files
IWTContentItemFactory
DefaultWTContentItemFactory
<WTContentItemFileFactory>
Creates the actual content item files that are attached to the Windchill part or Windchill document
IWTContentItemFileFactory
DefaultWTContentItemFileFactory
<RepresentationFactory>
Creates representation XML files
IRepresentationFactory
DefaultRepresentationFactory
<RepresentationJarFactory>
Creates the actual representations that are attached to the Windchill part or Windchill document
IRepresentationJarFactory
DefaultRepresentationJarFactory
Attribute Mapping
Attributes for Windchill objects are specified with a mapping in GatewayConfig.xml in the following format:
<Windchill attribute name>%Model Manager attribute name%</Windchill attribute name>
The Creo Elements/Direct Model Manager attribute can be either a database attribute or an attribute on the corresponding Java business object. You can also specify multiple Creo Elements/Direct Model Manager source attributes.
The following examples are mappings from Creo Elements/Direct Model Manager ‘Part’ attributes to Windchill ‘WTPart’ attributes:
1. <DefaultUnit>ea</DefaultUnit>
The DefaultUnit attribute on the Windchill part is set to the constant value ‘ea’.
2. <Name>%Name%</Name>
The Name attribute of Windchill part is determined by evaluating the getName method on a Creo Elements/Direct Model Manager Part object.
3. <Name>%DESCRIPTION%</Name>
The Name attribute of Windchill part are determined by evaluating the DESCRIPTION attribute of the MASTERDATA object.
4. <Name>%Name% - %ClassName%</Name>
The Name attribute of Windchill part will be composition of the getName and getClassName values of the Creo Elements/Direct Model Manager object.
You can further refine the mapping by additional XML attributes on the target element.
XML Attribute
Description
Allowed Values
Default
type
Type of the attribute on the source object
boolean, integer, float, date, string
string
source_class
The mapping is only applied if theCreo Elements/Direct Model Manager source object has this Java type
Java class name
java.lang.Object
format
Format string for the value
Java formatting (only for date values)
null
max_length
Maximum length for the attribute value
no limit
If special mappings are required, a customized implementation for each attribute can be specified (for example, the PartType attribute specification).
XML Element
Description
Interface To Be Implemented
Default Implementation
<attribute name>
Defines a mapping for a single attribute
com.osm.windchill.mapping.IAttributeMap
com.osm.windchill.mapping.WTAttributeMap
On a high level, the mapping algorithm for all the attributes can also be customized.
XML Element
Description
Interface To Be Implemented
Default Implementation
<Attributes>
Defines how attribute values are set for the Windchill objects
com.osm.windchill.mapping.IAttributeMapper
com.osm.windchill.mapping.WTAttributeMapper
<Ibas>
Defines how IBA values are set for Windchill objects
com.osm.windchill.wt.IIbaFactory
com.osm.windchill.wt.IbaFactory
Selection Rules
The gateway allows setting up scheduled tasks that regularly check for changes of Creo Elements/Direct Model Manager elements and send changes to Windchill. A task is equipped with a rule to select all elements to be checked. When a schedule is due, the rule is evaluated and the resulting elements are checked and possibly updated. By default, the gateway provides several task types with common selection rules. The available rules can easily be customized. In addition, new tasks with additional selection rules can be added.
Selection Rule
Description
By Name
Specifies selection of objects by a name pattern, supports wildcard *
By Saved Search
Specifies selection of objects by a saved search previously defined by the user
In Packet
Specifies selection of all objects in a packet
In Project
Specifies selection of all objects in a project
Modified Since
Specifies selection of objects that have been modified in the last <specified by user> number of days.
Released Since
Specifies selection of objects that have been released in the last <specified by user> number of hours.
Adding a Task Type with a New Selection Rule
Task types are added or deleted by adding or deleting an XML configuration file in the taskagent\jobconfig directory (see the Task Agent Customization section in the Model Manager Customization Guide). An example of an additional rule that has access to full SQL query syntax can be found in taskagent\jobconfig\samples.
Follow these steps to add a new task:
1. Create a new job configuration XML file. Use a job type that starts with windchill.
2. Add the XML file to the server taskagent\jobconfig directory.
3. Create a new client deployment package by running the clntwin\gatewaybuild.bat script.