Cas d'utilisation 16 : générer une structure en aval en fonction de l'attribut d'occurrence
Notez que la structure suivante est présente dans le Transformateur de nomenclature :
Un lien d'équivalence existe entre Top_Assembly (Design) et Top_MBOMAssembly (Manufacturing).
Part1, Part2 et Part3 ont respectivement les valeurs occv1, occv2 et occv3, pour l'attribut d'occurrence OccIBA.
MBOM_Assembly1, MBOM_Assembly2 et MBOM_Assembly3 ont respectivement les valeurs Value1, Value2 et Value3, pour l'attribut PartAttribute.
Pour générer la structure en aval en fonction des attributs d'occurrence, vous pouvez spécifier les règles de transformation et de restructuration à l'aide d'un fichier de règles ou de propriétés.
* 
Cette fonctionnalité est en cours d'amélioration. Pour l'instant, utilisez cette configuration pour transformer toutes les occurrences de l'article en amont vers la structure en aval.
Utilisation d'un fichier de règles
Dans un fichier texte, ajoutez les règles suivantes au format JSON :
{
"transformRules": [
{
"sourceType": "wt.part.WTPart",
"sourceAttributes": ["genericType=standard"],
"newAttributeMappings": [
[
"source.occurrence.OccIBA:occv1",
"target.part.PartAttribute:Value1"
],
[
"source.occurrence.OccIBA:occv2",
"target.part.PartAttribute:Value2"
],
[
"source.occurrence.OccIBA:occv3",
"target.part.PartAttribute:Value3"
]
],
"transformOption": "newBranch",
"targetType": "wt.part.WTPart"
}
]
}
Utilisation d'un fichier de propriétés
1. Accédez au fichier associativity.properties.xconf situé dans Windchill/codebase/com/ptc/core/foundation/associativity.
2. Ajoutez les règles de restructuration suivantes :
<Property name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart.rule1" multivalued="," default=""/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart.rule1" value="attribute.genericType=standard"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart.rule1" value="newAttributeMapping.rule1.entry1=source.occurrence.OccIBA:occv1,newAttributeMapping.rule1.entry2=target.part.PartAttribute:Value1"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart.rule1" value="newAttributeMapping.rule2.entry1=source.occurrence.OccIBA:occv2,newAttributeMapping.rule2.entry2=target.part.PartAttribute:Value2"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart.rule1" value="newAttributeMapping.rule3.entry1=source.occurrence.OccIBA:occv3,newAttributeMapping.rule3.entry2=target.part.PartAttribute:Value3"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart.rule1" value="transformOption=newBranch"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart.rule1" value="targetType=wt.part.WTPart"/>
Une fois que vous avez effectué l'action Générer une structure en aval, la structure suivante apparaît dans le Transformateur de nomenclature :
En fonction des critères spécifiés dans le fichier de règles ou le fichier de propriétés, la structure en aval est générée de la manière suivante :
2 occurrences de Part1 avec la valeur OccIBA définie sur occv1 sont ajoutées sous MBOM_Assembly1 (Manufacturing), qui a la valeur PartAttribute Value1.
2 occurrences de Part2 avec la valeur OccIBA définie sur occv2 sont ajoutées sous MBOM_Assembly2 (Manufacturing), qui a la valeur PartAttribute Value2.
2 occurrences de Part3 avec la valeur OccIBA définie sur occv3 sont ajoutées sous MBOM_Assembly3 (Manufacturing), qui a la valeur PartAttribute Value3.
Est-ce que cela a été utile ?