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

OIR Question

OIR question

Can anyone tell me what the highlighted section means in this OIR:


id="number"
algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator"
ignore="false"
force="false"
final="false">
<value algorithm="wt.rule.algorithm.BooleanBranch">
<attr id="template.templated"/">
<arg>{GEN:wt.enterprise.SequenceGenerator:WTCHANGEORDERID_seq::10:0}</arg>
<arg>{GEN:wt.enterprise.SequenceGenerator:WTCHANGEORDERID_seq:5:0}</arg>
</value>
</attrvalue>
<attrvalue<br/>
Thanks

Steve

OIR question

Steven,
The Hi-Lighted section below is the sequence number generator for the NUMBER field. It pulls the next sequence number from the database and formats it to the number of characters in the OIR (:10:0).

NOW, there should ONLY be ONE of these in the OIR for the number, not two! Plus the first one has a syntax error in it (the double colon after seq).

Mike Ibosh

OIR question

Hi Mike,

I don't know why there is two, that was puzzling me as well.

As far as the syntax goes does (:10:0) mean that it will have 10 digits starting with ZERO?

Steve

OIR question

Steven,
No, the 10:0 means 10 digits total, padded by zeros (0000000021).

Mike Ibosh

OIR question

Ok thanks Mike for the info and your time.

Steve

RE: OIR question

If you want to use an IBA attribute in the OIR, either to auto-enumerate or to use it as a source for number or whatever, you should include it in the list of attributes manipulated by the OIR.


It is done by includding its value in the file:


<windchill_home>\codebase\com\ptc\core\rule\server\delegate\init\RuleConfigurableTypeAttribute.properties


with the xconfmanager command.



Saul

In Reply to Steven Bugros:


Ok thanks Mike for the info and your time.

Steve

Highlighted

OIR question

Hello Steven,

You can find the description in the help. There is a 'BooleanBranch' where the line '<attr id="template.templated"/">' returns true or false.
So you should read it as:


<value algorithm="wt.rule.algorithm.BooleanBranch">

<attr id="template.templated&lt;a" style="COLOR:" blue;=" text-decoration:=" underline&quot;=" target="_BLANK" href="http://www.ptc.com/cs/help/windchill_hc/wc102_hc/WCCG_BusLogicCust_ChangeMgmt_ChgTmplInitRules.html?queryId=14600043d6b">">http://www.ptc.com/cs/help/windchill_hc/wc102_hc/WCCG_BusLogicCust_ChangeMgmt_ChgTmplInitRules.html?queryId=14600043d6b>"

<arg>{GEN:wt.enterprise.SequenceGenerator:WTCHANGEORDERID_seq:10:0}</arg>

<arg>{GEN:wt.enterprise.SequenceGenerator:WTCHANGEORDERID_seq:5:0}</arg>
</value>

So depending on the test, one of the 2 numbering schemes will be used.

Regards
Bart

RE: OIR question

Steve,


The fact that there are 2 number generator definitions is because there is a "boolean branch" instruction included as well.
This boolean branch will check an expression and if the outcome is true, first <arg> line is used, otherwise the second.


So in this case if the validation returns 'true', the number will be generated as a 10 digit number with preceeding '0' (as also explained inother reactions). If it returns 'false' the number will be a 5-digit one. The sequence number itself though comes from the samedatabase sequence as the instruction calls the same sequence called 'WTCHANGEORDERID_seq'.


What the real validation expression actually is, is defined in the <attr> line just below the booleanbranch statement. In this case it calls for an ID "template.templated" which unfortunately I don't recognize, but makes me think that the OIR is checking if the object is created from a template or not. And if so, the number is 10-digit, if not the number is 5-digit.


Jan Van Koetsem


PLM Consultant / SAVACO