Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
Hi,
I'm trying to learn how to set up OIRs and I ran into a problem.
I'm setting up a Part subtype, Vendor Part, with a standard soft attribute acme.vendor.VendorPartComment as a multi-line string. I want the new part wizard to display "No comments yet." by default.
Currently, my OIR for the Vendor Part contains the following pertaining to the comments:
<AttrValue id="acme.vendor.VendorPartComments" algorithm="wt.rule.algorithm.StringConstant">
<Arg>No comments yet.</Arg>
</AttrValue>
<AttrConstraint id="acme.vendor.VendorPartComments" algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value algorithm="com.ptc.core.rule.server.impl.GetServerPreGeneratedValue"/>
</AttrConstraint>
I'm using the same logic for the part name, and the wizard is displaying a default name correctly, but not this comment. The only difference between the two that I see is that the comment is displayed as a multi-line string vs a single-line string for the name.
Furthermore, the "No comments yet." appears after I create a vendor part, just not in the creation wizard.
Any suggestions?
Thanks,
SK
Hi Sergei,
Interesting issue.
I am wonder what is displayed in the wizard for this attribute?
Also how the constraints compare between name and comments in the type attribute manager.
Thanks,
Jarrett
Jarrett,
In the wizard, the attribute value is blank.
In the type and attribute management, the constraints are the following:
I was unable to find a solution through OIR, so in this case I would have to do it through
Type and Attribute Management, attribute settings, Default Values set to "No comments yet."
I just wanted to see if I can do it through the initialization rules XML, but I can't find a way.
What if you specify it as an IBA in the XML?
For example, I have the following set in one of my OIRs that sets the value for my XPOSASSY attribute to "Default":
<AttrValue id="IBA|XPOSASSY" algorithm="wt.rule.algorithm.StringConstant" ignore="false" force="true" final="false">
<Arg>Default</Arg>
</AttrValue>
Lori, do i need to change anything about my attribute in Type and Attributes administration?
It doesn't seem to be working for me.