Skip to main content
13-Aquamarine
December 7, 2023
Solved

Can OIR rules prepopulate value on a create form?

  • December 7, 2023
  • 1 reply
  • 1869 views

I have a situation where a particular field on our Change Request has different choices depending on which project they are part of.  Using Global Enumerations, I can set up the cascading dependencies to show the correct choices.  But... having to choose the project first on creation is something I'd like to avoid.  Each of our projects have their own contexts... if you create a CR in PRJ1-Library, I want the project field choice preset and the dependent field's valid choices already filtered.

 

I can use the OIR to set the project field but it only happens after the create form is submitted.  Can this be preset so the create form already has the correct project?

 

(I am trying to avoid writing custom code and handlers... please let me know if this a forlorn hope...)

Best answer by Fadel

as far as I know this needded anyways here is how my OIR looks :

           <AttrValue id="InternalProgram" algorithm="wt.rule.algorithm.StringConstant">
      <Arg>CSC</Arg>
     </AttrValue>
 
<AttrConstraint id="InternalProgram" 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.GetServerPreGeneratedValue"/> 
</AttrConstraint>
   

 

1 reply

Fadel
23-Emerald I
December 14, 2023
RFS13-AquamarineAuthor
13-Aquamarine
December 18, 2023

Unfortunately that did not work.  The OIR rule did get applied but only after the Change Request was submitted.  All of the examples in the above link are for naming and numbering... can they be used on IBA attributes?

 

The rule I used is as follows:

 

<AttributeValues objType="wt.change2.WTChangeRequest2|com.lmco.MS2ChangeRequest">
<AttrValue id="InternalProgram" algorithm="wt.rule.algorithm.StringConstant">
<Arg>CSC</Arg>
</AttrValue>

<AttrConstraint id="InternalProgram" algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value algorithm="com.ptc.core.rule.server.impl.GetServerPreGeneratedValue"/>
</AttrConstraint>
</AttributeValues>

 

Fadel
23-Emerald I
December 19, 2023

Have you added the internal name of the  attribute in the RuleConfigurableTypeAttribute.properties file  + server restart to make it usable with OIRs , jut test it it is working on 12.0.2.15

Fadel_0-1702976295722.png

 

Buiꓘa