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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Can OIR rules prepopulate value on a create form?

RFS
11-Garnet
11-Garnet

Can OIR rules prepopulate value on a create form?

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...)

1 ACCEPTED SOLUTION

Accepted Solutions
Fadel
22-Sapphire I
(To:RFS)

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>
   

 

Fede

View solution in original post

5 REPLIES 5
Fadel
22-Sapphire I
(To:RFS)
RFS
11-Garnet
11-Garnet
(To:Fadel)

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
22-Sapphire I
(To:RFS)

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

 

Fede
RFS
11-Garnet
11-Garnet
(To:Fadel)

I did not do that and I will try.  Is this necessary for IBA attributes?  The rule does work... but only after the object is created.  It refuses to apply itself before the form is displayed.

Fadel
22-Sapphire I
(To:RFS)

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>
   

 

Fede
Top Tags