Novell Home

Closing a Workflow Request Based on a Directory Query

Novell Cool Solutions: Tip
By Rudy Duym

Digg This - Slashdot This

Posted: 18 Jul 2007
 

Problem

A Forum reader recently asked:

How can I automatically close an IDM 3.5 workflow request form, based on the result of a directory query? For example, I want to put an end to a request if a certain condition is met, such as when the user already has a given resource.

Solution

Suppose you want to close a request form by cancelling it upon a certain condition, such as if the request has already been granted. You can query the directory with a call to IDVault.get() to get the value of an attribute for an entity. It can be a global query, a value of a control present on the form, the result of an ajax service call, etc.

1. Add the following inline script to your form:

    function checkExists(form,IDVault) {
     var v = IDVault.get(null, "request object's dn here","entitykey","a-required-attribute");
     if (v) {
       alert("Request already granted, closing request form");
       form.submit("CancelAction");
       return;
    }
    form.showMsg("Validation ok, please proceed");
    }

2. Call the script from one of the onload events. Any control will do (except Title - it does not have a browser-side object representation):

    checkExists(form,IDVault);


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell