Respected Contributor.. M_A_A Respected Contributor..
Respected Contributor..
410 views

Request Rule Needs to Check New Status Value

I would like to update a Request Detail value using a Request Detail Rule only when the new next status will be a specific value.

I have a workflow decision step, "Prioritizing", that can go to next steps/statuses of On Hold, Request Additional Information, or Approved.

I would like to update the "Approved Date" Request Detail Field automatically with a timestamp only when the Request's Workflow Action is "Approved" and is pressed, but I cannot see anyway to check for a new next status, or transition to, Approved in the Request Rules.

I tried using the "On Page Load" Event and Status is equal to Approved.  But the actual save of the timestamp in the request record does not occur until a next Save Action is performed.  And I need the request record updated as soon as the transition is performed from Prioritizing to Approved.

We are running currently using HP PPM 9.22.

0 Likes
3 Replies
Outstanding Contributor.. Amishra Outstanding Contributor..
Outstanding Contributor..

Re: Request Rule Needs to Check New Status Value

Hello There,

Not sure if there is a specific need to use the rules (because the rule will fire everytime the page loads i.e. save etc) 

You can try 'After Transition' rule event. 

[14 June Correction with Apologies] There is no such rule event, it is 'Before Transition'

Safer way to handle this would be via a execution step in the workflow. Add a step between two steps to populate the approved date. 

See sample code below. 

ksc_run_sql QUERY_STRING="SELECT to_char(SYSDATE,'YYYY-MM-DD HH24:MI:SS') FROM DUAL" ENV_NAME="[SOURCE_ENV.ENVIRONMENT_NAME]"
ksc_store REQD.P.BEN_TRIAGE_COMP_DATE="[SQL_OUTPUT]"

 

Ajay

Regards,
Ajay Mishra
0 Likes
Respected Contributor.. M_A_A Respected Contributor..
Respected Contributor..

Re: Request Rule Needs to Check New Status Value

Ajay, thank you for the reply.

I had looked before and could not find any 'After Transition' or 'After Save' rule event for Demand Management in PPM 9.22.  An After Save or After Transition would be perfect.  But I could not find a way to do that for a Request Type rule.

I already tried to add an extra execution step, 'Approved', but no Request Type rules appear to be executed during an execution step.  An execution step only appears to be a pass-through transition and only sets a status, but does not interact or process any Request Type rules.  Am I somehow missing something?

The entire scenario I am trying to do is to provide an email notification to the data team when a request moves from prioritizing to Approved and only for Data Fix type of Category of Work.  The notification must contain the Approved date of the Request Detail.

I have created a Request Sub Type of Data Fix.  I have created a Request Type Notification on Sub Type being changed to Data Fix.  I have created a Request Type rule that says if status is prioritizing and Category of work is Data Fix set Sub Type to Data Fix, with the Before Transition event.

Everything is working as expected, with 2 slight problems I am having is that 1) I only want the Sub Type rule to be invoked when the transition is to Approved, and not any of the other available steps and 2) Approved Date does not seem to get Saved before the Sub Type Notification goes out, resulting in its value always being NULL

Here is the process flow :

1. At the Prioritize and Approve workflow step user enters Approved Date & Category of Work.

2. User presses Approve Action Button to send to Approve workflow step and set status to In Progress.

3 Request Type Sub Type rule specifies - if in Prioritize and Approve Status, before transition, if Category of Work equals Data Fix, set Sub Type to Data Fix..

I did try an execution step between prioritize and In Progress, but the notification never seemed to fire.   Besides creating the execution, the only thing i did was change the Sub Type rule for Status is equal to Approved, the new execution step status.   And that Request rule never seemed to get invoked from out of the execution step.

Maybe if could surround and Execution Step's Execution Command with an if Statement, this could work out for me.  Something like a Workflow execution step with -

'if Category of Work = Data fix then set Sub Type = Data Fix". 

Then my Sub Type notification would fire on the Approved execution step with the Approved Date already having been saved.  This would provide the perfect solution.  I just do not know how to setup the Exeuction Step for this, and if the Sub Type Notifiction in the Request Type would actually fire.

0 Likes
Outstanding Contributor.. Amishra Outstanding Contributor..
Outstanding Contributor..

Re: Request Rule Needs to Check New Status Value

"I had looked before and could not find any 'After Transition' or 'After Save' rule event for Demand Management in PPM 9.22.  An After Save or After Transition would be perfect.  But I could not find a way to do that for a Request Type rule."

[AJ] My bad, apologies no such rule event.

" I already tried to add an extra execution step, 'Approved', but no Request Type rules appear to be executed during an execution step.  An execution step only appears to be a pass-through transition and only sets a status, but does not interact or process any Request Type rules.  Am I somehow missing something?" 

[AJ] Correct, it wont work.

"I did try an execution step between prioritize and In Progress, but the notification never seemed to fire.  "

[AJ] For notifications on the execution steps, check if ‘Don’t send if obselete’ option is checked (should be unchecked) Refer Attached.

 

With regards to populating the Approved Date: Would recommend to handle via execution i.e. Create a execution step between in progress and prioritize, this step will update the Approved Date (not via rules, but via command in the execution step)

Refer attached.

Sample code below: Replace BEN_TRIAGE_COMP_DATE with your Approved date token

ksc_run_sql QUERY_STRING="SELECT to_char(SYSDATE,'YYYY-MM-DD HH24:MI:SS') FROM DUAL" ENV_NAME="[SOURCE_ENV.ENVIRONMENT_NAME]"
ksc_store REQD.P.BEN_TRIAGE_COMP_DATE="[SQL_OUTPUT]"

Regards,
Ajay Mishra
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.