Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hi All,
Is there a way to write an XML, to add some softattributes to wt.part.WTPart. Also, add some constraints to those attributes.? These have to be done through XML, so that we can avoid manual creation of attributes and constraints.
Hi Chris,
This will add the constarints to an attribute of a softtype of WTPart. But have you tried adding this constraint to the WTPart itself?
Hi Chris/David,
Are you sure the given XML worked for you? For me it throws an error in the method server- '
The value for attribute<attribute_name> must be one of the following:<list_of_values_given_for_discrete_set>;.
For me, If I remove the DiscreteSet constraint and add ValueRequiredConstraint, it works fine. SO it seems there is some problem with the DiscreteSetConstraint in the way I am giving the values.
Hi guys,
Thanks for the help. But the one which worked for me is given below. The attribute has already been created before running this file using another XML.
<nmloader>
<csvtypenodeiconroot<br/>handler="com.ptc.core.meta.type.mgmt.server.impl.TypeDefinitionNodeLoader.getIconRoot">
<csviconroot>wtcore/images</csviconroot>
</csvtypenodeiconroot>
<csvbegintypedefnode<br/>handler="com.ptc.core.meta.type.mgmt.server.impl.TypeDefinitionNodeLoader.beginUpdateTypeDefinitionNode">
<csvnodename>wt.part.WTPart</csvnodename>
<csvparenthid></csvparenthid>
<csviconfile>part.gif</csviconfile>
<csvdescription>Part</csvdescription>
<csvdisplayname>Part</csvdisplayname>
<csvhierarchydisplayname>Part</csvhierarchydisplayname>
<csvinstantiable>true</csvinstantiable>
<csvdeleted>false</csvdeleted>
<csvuserattributable>true</csvuserattributable>
<csvlogicalidentifier>wt.part.WTPart</csvlogicalidentifier>
</csvbegintypedefnode>
<csvtypedefattrvalue<br/>handler="com.ptc.core.meta.type.mgmt.server.impl.TypeDefinitionNodeLoader.createAttributeValue">
<csvdefinition>DiscreteAttrTest</csvdefinition>
<csvvalue1>Value1</csvvalue1>
</csvtypedefattrvalue>
<csvtypedefconsvalue<br/>handler="com.ptc.core.meta.type.mgmt.server.impl.TypeDefinitionNodeLoader.createConstraintValue">
<csvbindingrule>SINGLE_ATTRIBUTE_BINDING_RULE</csvbindingrule>
<csvenforcementrule>com.ptc.core.meta.container.common.impl.DiscreteSetConstraint</csvenforcementrule>
<csvbindingruledata>DiscreteAttrTest</csvbindingruledata>
<csvenforcementruledata>Value1|Value2|Value3</csvenforcementruledata>
</csvtypedefconsvalue>
<csvendtypedefnode<br/>handler="com.ptc.core.meta.type.mgmt.server.impl.TypeDefinitionNodeLoader.endUpdateTypeDefinitionNode" />
</nmloader>