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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Substring function for "folder.id" in OIR

pwilliams-3
12-Amethyst

Substring function for "folder.id" in OIR

Hi All,
I'm trying to get a substring of the "folder.id" attribute of a WTPart. I'm using the below OIR code and I'm getting a failure with the IndexOf algorithm. Does anyone have an example where you use IndexOf as a parameter to Substring? Please don't send the one from the Help, I've already seen it.

<attributevalues objtype="wt.part.WTPart">



<attrvalue id="lifeCycle.id" algorithm="com.ptc.core.foundation.lifecycle.server.impl.LifeCycleTemplateAttributeAlgorithm">
<value algorithm="wt.rule.algorithm.BooleanBranch">
<value algorithm="wt.rule.algorithm.StringEqualsTest">
<value algorithm="wt.rule.algorithm.Substring">
<attr id="folder.id"/">
<value algorithm="wt.rule.algorithm.IndexOf"> <-- This algorithm is causing the OIR to fail. If I hard code to an integer then it works.
<attr id="folder.id"/">
<arg>Manufacturing</arg>
<arg>0</arg>
</value>
<value algorithm="wt.rule.algorithm.LastIndexOf"> <-- This algorithm is causing the OIR to fail. If I hard code to an integer then it works.

<attr id="folder"/">
<arg>Manufacturing</arg>
</value>
</value>
<arg>Manufacturing</arg>
</value>
<arg>Steelcase Eng B Life Cycle</arg>
<arg>Steelcase Eng Life Cycle</arg>
</value>
</attrvalue>
</attributevalues>

Patrick Williams | Engineering Systems | c: 616.947.2110
[cid:image001.jpg@01D072B4.2CC608C0]

3 REPLIES 3

How about insert some java code into that webject example. Of course all that steelcase stuff in there may be causing the failure 🙂


Jim Van Dragt
PLM Architect
Information Technology

hermanmiller.com

This is not a webject Jim. It's OIR xml file.

Patrick Williams | Engineering Systems | c: 616.947.2110
[cid:image002.jpg@01D072B5.976C0430]

There are problems where index of etc works only in certain scopes where
folder.id is null and at other points you do see the value. I just
customize my own algorithm. Fairly basic code you almost never have to
worry about in an upgrade.
On Apr 9, 2015 10:59 AM, "Williams, Patrick" <->
wrote:

> Hi All,
>
> I’m trying to get a substring of the “folder.id” attribute of a WTPart.
> I’m using the below OIR code and I’m getting a failure with the IndexOf
> algorithm. Does anyone have an example where you use IndexOf as a
> parameter to Substring? Please don’t send the one from the Help, I’ve
> already seen it.
>
>
>
> <attributevalues objtype="wt.part.WTPart">
>
>
>
>
>
>
>
> <attrvalue id="lifeCycle.id"&lt;br"/>> algorithm="com.ptc.core.foundation.lifecycle.server.impl.LifeCycleTemplateAttributeAlgorithm">
>
> <value<br/>> algorithm="wt.rule.algorithm.BooleanBranch">
>
> <value<br/>> algorithm="wt.rule.algorithm.StringEqualsTest">
>
> <value<br/>> algorithm="wt.rule.algorithm.Substring">
>
>
> <attr id="folder.id"/">
>
>
> <value algorithm="wt.rule.algorithm.IndexOf"> ß This
> algorithm is causing the OIR to fail. If I hard code to an integer then it
> works.
>
>
> <attr id="folder.id"/">
>
>
>
> <arg>Manufacturing</arg>
>
>
> <arg>0</arg>
>
>
> </value>
>
>
> <value algorithm="wt.rule.algorithm.LastIndexOf"> ß This algorithm
> is causing the OIR to fail. If I hard code to an integer then it works.
>
>
>
>
> <attr id="folder"/">
>
>
> <arg>Manufacturing</arg>
>
>
>
> </value>
>
> </value>
>
>
> <arg>Manufacturing</arg>
>
> </value>
>
> <arg>Steelcase Eng B Life
> Cycle</arg>
>
> <arg>Steelcase Eng Life
> Cycle</arg>
>
> </value>
>
> </attrvalue>
>
> </attributevalues>
>
>
>
> *Patrick Williams* | Engineering Systems | c: 616.947.2110
>
> [image: sc_inc_black_sig_1_alt]
>
>
>
Announcements


Top Tags