The community will be in read-only from Monday 11:59pm (PT) to Wednesday 7:30am (PT)
The community will be in read-only from Monday 11:59pm (PT) to Wednesday 7:30am (PT)
Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Rule issue in PPM 8.02

Highlighted
Mohit_Agrawal
Frequent Visitor

Rule issue in PPM 8.02

Hi All,

 

We have two SQL rules for a field change. I want that Rule1 should trigger first and then Rule2....

If I drag the rule1 upper of Rule2 in the Rules tab of workbench, then it does not work...

 

The problem is that..The Rule2 is picking up the old token value, not the new value (after rule1 triggers). How do we determine the sequence?

 

Any suggestions?

 

Thanks!!

Mohit Agrawal

3 REPLIES
Erik Cole
Honored Contributor

Re: Rule issue in PPM 8.02

All the rules use the field values as of the last request save date. If you change a field's value with a rule, subsequent rules cannot access that new value. Any reason you can't combine the two rules?

Mohit_Agrawal
Frequent Visitor

Re: Rule issue in PPM 8.02

No, rules do not take the last saved values. It may also take the new value changed by the rule if we are passing the token  of the field instead of fetching the value through database.

We cannt combine the rules as per the requirement and both rules have different parameters.

 

Basically Rule1 changes the field2 upon changing the field1. And then Rule2 uses the new value of field2 and subsequently calculates the field3 value.

 

Problem: The rule2 is taking the new values only when field1 is changed at least twice. It does not take the new value when the field1 is changed only once.

 

Hope I made it clear...

 

Thanks!!

Mohit Agrawal

Erik Cole
Honored Contributor

Re: Rule issue in PPM 8.02

You're right...if Rule2 has the same trigger event as Rule1 then Rule2 can use the new field value for Field2 that Rule1 calculated.

What I was thinking was that Rule2 cannot have a trigger event of 'on field change' event for Field2 because rules cannot trigger other rules.

This should work how you have it, I tested in 9.14 and it is working fine. You might look to see if any of the upgrades post 8.02 have fixes for this.

However, I still don't see why you couldn't just add Field3 to the result fields of Rule1 and include the logic in the same SQL...

If Field1 has possible values 1,2,3:

Field 2 gets the text version of Field1, and Field3 gets the length of the new text in Field2...

Select
decode('[REQD.FIELD1]','1','One','2','Two',3,'Three'),
decode('[REQD.FIELD1]','1','One','2','Two',3,'Three'),
length('[REQD.FIELD2]'),
length('[REQD.FIELD2]')
from dual

//Add this to "OnDomLoad" event