Highlighted
Absent Member.. Absent Member..
Absent Member..
529 views

SM 9.40: How to auto close a request fulfillment when all tasks are closed

Hi Gurus,

I'm looking for a solution to close a request fulfillment record when all tasks related are closed. Any RequestService function I should use? When I should create the Rule Set in the request task workflow?

Thanks!

0 Likes
2 Replies
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: SM 9.40: How to auto close a request fulfillment when all tasks are closed

One way to do is via RuleSet (using JavaScript-SL) on closure phase of each request task. When an RFT is closed/enters closure phase, the ruleset should execute the  SL script and check for all open tasks. If none then 'Close' the RF (add code in SL to set RF status and phase to 'Closed').

Thanks!

 

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: SM 9.40: How to auto close a request fulfillment when all tasks are closed

Hello, @Marcelo Sano,
You can do that on Workflow by using RuleSet but you need to do that on Request Task which will check when it's put in "Closed" status if there is any opened Request Task which is related to Request if there is no any than you can close the request.
You can do that on Closure phase on step "After Successful Enter", there you can put your RuleSet which has JavaScript validation rule.
1. The first check opened Request Task's with Request Number which is related to current Request Task
2. If there is any opened Request Task then don't do anything and wait for remaining Request Task to close
3. If there is no opened Request Task's then you can close the Request

It would be best if the operator that is closing the Request Task has rights to Request because you can then yous action in JavaScript doAction("Save") which will activate Document Engine and it will activate all rules of the Workflow for Request.
If you can't confirm that operator has rights to request then you need to use doUpdate() action which will update "Request" in the background so it would be best that you have automatic transition on Request which will be triggered after updating the Request (but there could be problems because document engine is not activated).

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.