Skip navigation

CQ5

DavidMcCarty
Currently Being Moderated

Workflow - Absolutetime AutoAdvancer

Apr 11, 2012 12:02 PM

Was looking at the addition of a workflow step to queue/delay the activation of pages until an off-peak specified window, and had seen the Absolutetime AutoAdvancer as a process step, but wasnt aware of the appropriate criteria/format to use as input in the timeout.  Anyone familiar with the correct time format or criteria to satisfy that need?

 
Replies
  • Justin Edelson
    252 posts
    Nov 24, 2010
    Currently Being Moderated
    Apr 12, 2012 12:39 PM   in reply to DavidMcCarty

    The AbsoluteTimeAutoAdvancer reads a property named absoluteTime from the WorkflowData's MetaDataMap. It's used in the "Activate Later" and "Deactivate Later" workflows. The property is expected to be a long (or parseable to a long) containing the number of milliseconds since 1/1/1970 (typical Java Date stuff).

     

    I don't think this is necessarily the best choice for the problem you're describing. What you might want to do is write a new class which extends from AutoAdvance and implements the AbsoluteTimeoutHandler interface (just like AbsoluteTimeAutoAdvancer). In this class's getTimeoutDate method have logic like this:

     

    Date now = new Date();

    if (inPeakPeriod(now)) {

      return endOfPeakPeriod + 1 min; // timeout right after peak period ends

    } else {

      return -1; // timeout now

    }

     

    In other words, rather than determining whether or not the workflow should be delayed *when the workflow is initiated*, determine it when the delay step is executed. See  http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/workflow/job/ AbsoluteTimeoutHandler.html for more information on this interface.

     
    |
    Mark as:
  • Currently Being Moderated
    May 27, 2012 11:18 AM   in reply to Justin Edelson

    Hi Justin, I was wondering why the getTimeoutDate methods in only invoked while using participant steps. I looked at the code at it seems the ParticipantNodeHandler is only firing the publishTimeoutEvent while handling the node transition. I was wondering if this is the desired behavior or if this is a bug; if this is a bug is it resolved on CQ 5.5 ?. Thanks, Nicolas

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 2, 2012 4:46 AM   in reply to Justin Edelson

    I want a intermediate step that will allow to move to next step only after some date or time. Can I use AbsoluteTimeAutoAdvancer?

    Do I need to write a scheduler and job for this implementation of Timed Step completion?

     

    Please suggest.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points