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

Can OIR rules prepopulate value on a create form?

RFS
12-Amethyst
12-Amethyst

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

ACCEPTED SOLUTION

Accepted Solutions
Fadel
22-Sapphire II
(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 II
(To:RFS)
RFS
12-Amethyst
12-Amethyst
(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 II
(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
12-Amethyst
12-Amethyst
(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 II
(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
Announcements

Top Tags