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!

  • 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!

     

  • Hello, ,
    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).