Article

Closing a Workflow Request Based on a Directory Query

Author Info

18 July 2007 - 1:00am
Submitted by: rduym

article
Reads:

1253

Score:
0
0
 
Comments:

0

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);

Author Info

18 July 2007 - 1:00am
Submitted by: rduym




User Comments

© 2009 Novell, Inc. All Rights Reserved.