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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

OIR Update for IBA Value

Sha11
12-Amethyst

OIR Update for IBA Value

Hello,

 

I have a below requirement, request you to shed some light on how the same can be achieved.

 

i) There are two IBAs loaded at WTPart level, let's say IBA1 and IBA2.

ii) If a specific value is selected for IBA1, IBA2 must be populated with an auto generated number similar to what we do for WTPart number generation.

 

I want to know the feasibility to achieve the above requirement by modifying the OIR of the part, since it would require less customization as compared to developing a data utility.

 

Thanks,

Hari

4 REPLIES 4

HI @Sha11 ,

Does IBA2 have list of values?

Sha11
12-Amethyst
(To:TT_9345405)

Hello,

 

No, it does not have a defined list of values but I want to generate a number for the IBA based on a DB sequence.

Hi,

 

I dont think so it will be possible from OIR.

Instead of datautility, We can implement a JS function in part.jsp.

HelesicPetr
22-Sapphire I
(To:Sha11)

Hi @Sha11 

Try to check an OIR of WTPart type there is a EndItem check to turn off an autonumbering.

it is nice example how to achieve what you need. 

Concert to the AttrConstraint element with number

 

For end items in PDMLink context, turn the autonumbering off -->
<AttrConstraint id="number" algorithm="wt.rule.algorithm.BooleanBranch">        
  <Value algorithm="com.ptc.core.rule.server.impl.IfContainerTypeEqualsProjectTest"/>       
  
  <Value algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
	 <Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint"/>                              
  </Value>        
  
  <Value algorithm="wt.rule.algorithm.BooleanBranch">  
	   <Value algorithm="wt.rule.algorithm.StringEqualsTest">
		  <Attr id="endItem"/>
		  <Arg>true</Arg> 
	   </Value>
	   
	   <Value algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints"/>
	   
	   <Value algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
		   <Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint"/> 
		   <Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint"/>        
	   </Value>        
   </Value>       
</AttrConstraint>  

 

 

You need to add your check with your IBA1 

it could looks like (I remove the EndItem check):

 

 

For end items in PDMLink context, turn the autonumbering off -->
<AttrConstraint id="IBA2" algorithm="wt.rule.algorithm.BooleanBranch">        
  <Value algorithm="com.ptc.core.rule.server.impl.IfContainerTypeEqualsProjectTest"/>       
  
  <Value algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
	 <Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint"/>                              
  </Value>        
  
  <Value algorithm="wt.rule.algorithm.BooleanBranch">  
	   <Value algorithm="wt.rule.algorithm.StringEqualsTest">
		  <Attr id="IBA1"/>
		  <Arg>yourStringValue</Arg> 
	   </Value>
	   
	   <Value algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
		   <Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint"/> 
		   <Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint"/>        
	   </Value> 
	   
	   <Value algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints"/>
   </Value>       
</AttrConstraint>  

 

 

try it if it works.

If not, you can not achieve what you need by OIR.

 

PetrH

Announcements

Top Tags