Sometimes you may want to start a workflow, but delay specific parts of the workflow until a specified date or time has come: A new user might need to be created at a certain date, a workflow action should be performed at midnight, an object needs to be created at one time and be deleted some time later.

While all of these actions could be performed by IDM drivers, it may often be more flexible, easier and a matter of minutes to add such delays in the workflow itself.

The idea behind this concept is to create a “Dummy Approval” with a programmatically calculated timeout.

A request sits in the approval queue of this Dummy Approval and waits for the specified date/time to come.

Once the timeout has been reached, the workflow continues and the subsequent activities are processed.

There is no actual need to use a “real” user for the Dummy Approval, since all we need is wait for the timeout.

However, if you wish, you may even utilize the option that you CAN open the Dummy Approval form and manually approve or deny the request if needed.

The sample workflow attached to this note can be imported into IDM Designer if you like. This allows you to review or copy the relevant elements into your own workflows.

To implement the delayed approval I have created a very simple request form with a date picker.

The “Dummy Approval” form contains not much more than a field to display the selected date.

Two mapping activities have been added to calculate the required timeout:

  • The first mapping activity “Calculate Execution Time” converts the date input to a Java Date (milliseconds since 1970)

    function getStartTime() {
      var currentTime     = (new;
      // e.g., currentTime=1246042183027
      var startTime       = currentTime; // default
        // get customStartDate as String
        var customStartDate   = flowdata.get('start/request_form/fldTargetDate');
        //  e.g., customStartDate=20100630140000000+0200
        // use YYYYMMDD substring (keep date, set time to midnight)
        customStartDate    = customStartDate.substring( 0, 8 ) + '000000';
        //  e.g., customStartDate=20100630000000
        // convert string to time (ms)
        startTime = (new "yyyyMMddHHmmss" )).parse( customStartDate ).getTime();
        //  e.g., startTime=1246312800000
      catch ( e )
      return( startTime );

    The result is stored in flowdata.

  • The second mapping activity “Calculate Timeout” calculates the difference between the date input and the current time (in milliseconds)

    function getTimeout() { 
    	var timeout = 1000;	// default timeout: 1 sec
    		// get current time
    		var currentTime 	= (new;
    		// get scheduled start time
    		var customStartDate 	= flowdata.get('start/custom/executionTime');
    		// if time has not yet come, calc timeout in ms
    		if ( customStartDate > currentTime )
          		timeout = customStartDate - currentTime;
    	catch ( e ) {}
    	return timeout ;

  • The result is stored in flowdata.

All that remains to do is to specify the “Dummy Approval” details:

Display some info from the request:

Leave escalation open,

Select a dummy approver of your choice (e.g., some Admin account), and enter the calculated timeout.

You’re ready to go.

A request you submit will stay in the “Dummy Approval” queue until it times out, or until the selected approver manually approves or denies the request.

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.

Disclaimer: As with everything else at NetIQ Cool Solutions, this content is definitely not supported by NetIQ, so Customer Support will not be able to help you if it has any adverse effect on your environment.  It just worked for at least one person, and perhaps it will be useful for you too.  Be sure to test in a non-production environment.

Leave a Reply

No Comments
Jun 10, 2010
2:20 pm
Active Directory Authentication Automation Cloud Computing Cloud Security Configuration Customizing Data Breach DirXML Drivers End User Management Identity Manager Importing-Exporting / ICE/ LDIF Intelligent Workload Management IT Security Knowledge Depot LDAP Monitoring Open Enterprise Server Passwords Reporting Secure Access Supported Troubleshooting Workflow