Intégration avec d'autres applications > Utilisation de Creo Parametric avec Windchill > Utilisation des règles d'initialisation d'un objet pour la dénomination et la numérotation > Configuration du nom et du numéro sur la même valeur non modifiable générée automatiquement
  
Configuration du nom et du numéro sur la même valeur non modifiable générée automatiquement
La règle ci-après définit les champs Nom et Numéro sur la même valeur générée automatiquement.
* 
La définition de la préférence Enregistrer sous > Nom de fichier hérité du numéro sur Oui dans le Gestionnaire des préférences garantit la correspondance entre le nom CAO et le numéro généré automatiquement avec l'extension adéquate.
Exemple :
- <AttributeValues objType="wt.epm.EPMDocument">
- <!-- Define a variable to hold the generated number
-->
- <VarDef id="GeneratedNumber"
algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.Number
Generator">
<Arg>{GEN:wt.enterprise.SequenceGenerator:EPM_seq:10:0}</Arg>
</VarDef>
- <!-- set the folder
-->
- <AttrValue id="folder.id"
algorithm="com.ptc.core.foundation.folder.server.impl.FolderPathAttributeAlgor
ithm">
<Arg>/Default</Arg>
</AttrValue>
- <!-- set the lifecycle
-->
- <AttrValue id="lifeCycle.id"
algorithm="com.ptc.core.foundation.lifecycle.server.impl.LifeCycleTemplateAttr
ibuteAlgorithm">
- <Arg>
- <!-- Translation of the word "Basic" must be the same as the translation done in
commonLifeCycles.xml
-->
<?loc-begin key="BASIC_LIFECYCLE_NAME" maxlen="30"?>
Basic
<?loc-end ?>
</Arg>
</AttrValue>
- <!-- set the team template
-->
- <AttrValue id="teamTemplate.id"
algorithm="com.ptc.core.foundation.team.server.impl.TeamTemplateAttributeAl
gorithm">
<Arg>Default</Arg>
</AttrValue>
- <!-- set the number to a generated number
-->
- <AttrValue id="number">
<VarRef id="GeneratedNumber" />
</AttrValue>
- <AttrValue id="name">
<VarRef id="GeneratedNumber" />
</AttrValue>
- <!-- set the version info to a generated version info
-->
- <AttrValue id="MBA|versionInfo"
algorithm="com.ptc.core.foundation.vc.server.impl.VersionInfoGenerator">
<Arg>wt.series.HarvardSeries</Arg>
</AttrValue>
- <!-- specify AttrConstraint tag
-->
- <AttrConstraint id="lifeCycle.id"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value
algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint" />
<Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint" />
</AttrConstraint>
- <AttrConstraint id="lifeCycle"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value
algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint" />
<Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint" />
</AttrConstraint>
- <AttrConstraint id="folder.id"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value
algorithm="com.ptc.core.rule.server.impl.GetServerPreGeneratedValue" />
</AttrConstraint>
- <AttrConstraint id="number"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value
algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint" />
<Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint" />
</AttrConstraint>
- <AttrConstraint id="name"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value
algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint" />
<Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint" />
</AttrConstraint>
- <AttrConstraint id="teamTemplate.id"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value
algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint" />
<Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint" />
</AttrConstraint>
- <AttrConstraint id="teamTemplate"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value
algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint" />
- <!-- <Value
algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint"/>-->
</AttrConstraint>
- <AttrConstraint id="organization.id"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
- <Value
algorithm="com.ptc.core.rule.server.impl.GetServerPreGeneratedValue">
<Value
algorithm="com.ptc.windchill.enterprise.org.server.impl.OwningOrgDefaultAlgo
rithm" />
</Value>
</AttrConstraint>
</AttributeValues>