Skip to main content
1-Visitor
December 8, 2014
Question

OIR default string value

  • December 8, 2014
  • 2 replies
  • 1966 views

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

2 replies

1-Visitor
December 8, 2014

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

1-Visitor
December 8, 2014

Jarrett,

In the wizard, the attribute value is blank.

In the type and attribute management, the constraints are the following:

  • name
    • Single-Valued
    • Required
    • String Length from: 0 to: 60
  • acme.vendor.VendorPartComments
    • String Length from: 0 to: 4,000
    • Single-Valued
1-Visitor
December 10, 2014

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.

23-Emerald II
December 13, 2014

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>

1-Visitor
December 15, 2014

Lori, do i need to change anything about my attribute in Type and Attributes administration?

It doesn't seem to be working for me.