Configuring the Mapping Definitions
You need to configure the mappings by identifying what IXB DTD tags would contribute to the condition and what to the value mapping. All these configurations need to go in <WindchillE>\codebase\registry\ixb\mapping\IXMappingConfiguration.xml.
<Mapping preferenceDefinition="R_objectContainerPath"
mappingProcessor="wt.ixb.publicforapps.extendedmapping.processor.
SingleTagMappingProcessor">

<!-This configuration relates to preference definition
‘R_objectContainerPath’ and uses a mapping processor for single tag -!>

<Tag value="objectContainerPath" regex="true" replaceFull="true" />

<!-objectContainerPath is the tag in IX DTD that would be used to apply
the mappings defined by the preference definition. And, regular expressions
would be utilized for this mapping with full replacement of the
value by the value in the preference instance -!>

</Mapping>
This is an example configuration for handling the lifecycle attribute mapping.
<Mapping preferenceDefinition="R_lifecycle" separator=";"
mappingProcessor="wt.ixb.publicforapps.extendedmapping.
processor.MultiTagMappingProcessor">

<!-R_lifecycle is the preference definition that provides
the mapping value and the mapping processor suggests the use
of multiple tags for the mapping values-!>


<Tag value="externalTypeId" condition="true" regex="true"/>
<!-externalTypeId is the tag that sets the condition, unless the
condition is fulfilled the mapping would not be applicable.
RegEx match is applicable here -!>

<!-You can have multiple elements mapped simultaneously-!>

<Tag value="lifecycleInfo/lifecycleTemplateName"/>
<!-this is the element that is mapped -!>

<Tag value="lifecycleInfo/lifecycleState"/>
<!-This is another element that is mapped -!>

</Mapping>
* 
A sample file resides in the system at the following location: ..\IX_LOAD\prog_examples\Mappings\src\IXMappingConfiguration.xml
You are required to populate all the Mapping elements from this file into IXMappingConfiguration.xml to be able to use the Mapping Converter utility.
As seen in the Mapping structure, multiple Mappings can be defined. Each Mapping element is associated with one preferenceDefinition and one mappingProcessor. An optional applicableXApplications attribute can be provided to limit the Mapping configuration only to those IX applications.
applicableXApplications is a comma separated list of applicable applications. If not specified, the Mapping is applicable to all applications.
Each Mapping element can have one or multiple tags defined under it. Tags can be of type condition (defined by condition=”true” attribute) or Mappable type (non-condition). These mappable tags would be implicitly have "condition=false". The tags of type condition can specify an attribute “multi=true” to define that the specific element referred to by the value attribute can have multiple instances and each instance would be picked up to evaluate the condition.
Only mappable Tags are considered for returning the mapped value. One tag of Mappable type can have only one applicable mappingProcessor and one preferenceDefinition associated with it. In case there are multiple Mapping definition for the same Tag, the first applicable Mapping definition in this config file would be picked up for a mappable tag. Multiple tags of type condition for a mapping will be AND condition.
Multiple Tags mean the mapping data would have parse-able (through attribute separator) mapping in source mapping data and target data. Source values in mapping data should follow the same sequence, separated by the separator, as define for this Mapping element. Similarly, target values should follow the same sequence of mappable tags defined for the Mapping. Tags can also be defined to support regex through attribute regex="true”. Default is non-regex tag (“false”). Regex supports replacement based on regular expression. If regex is true for mappable tags, additionally attribute replaceFull="true" can be specified (default false) to indicate the mapped value should replace the full value when there is a match. All such defined expressions would be sorted in natural order and a first match would be attempted going through all such mappings defined. Be careful to avoid unnecessary use of it to avoid bad performance. Tags mentioned as condition may or may not have value specified in mapping data, but it should still maintain the sequence through proper separator with blank condition value.
OOTB, only two mapping processor implementation would be provided.
wt.ixb.publicforapps.extendedmapping.processor.SingleTagMappingProcessor would handle single tag mapping including support for regex.
wt.ixb.publicforapps.extendedmapping.processor.MultiTagMappingProcessor would handle mappings with more than one tag (including condition tags). This processor would also support regex in both condition and mappable tags.
The above two OOTB mapping processors work on the concept of simple String manipulation. If any business logic is required to be attached to those string values under consideration from mapping data, you need to write their customized mapping processor/Mapper based on the guideline (as described in Customizing Mapping Behavior) to extend these two processors.
¿Fue esto útil?