cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

OIR default string value

ptc-6781903
1-Newbie

OIR default string value

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

5 REPLIES 5

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:

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

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.

LoriSood
22-Sapphire II
(To:ptc-6781903)

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.

Top Tags