org.kuali.rice.kew.engine.node
Class IteratedRequestActivationNode

java.lang.Object
  extended by org.kuali.rice.kew.engine.node.IteratedRequestActivationNode
All Implemented Interfaces:
Node, SimpleNode
Direct Known Subclasses:
KRAMetaRuleNode

public class IteratedRequestActivationNode
extends Object
implements SimpleNode

A node which will iteratively activate any requests pending on it. Subclasses are responsible for generating the requests to be activated, and then delegating to superclass process(RouteContext, RouteHelper) to activate those requests. This node can be used to serve multiple batches of requests, and can be re-entered multiple times. The algorithm it implements is:

  1. activate any existing requests (requests may have been generated by an external party)
  2. while request fulfillment criteria indicates that any pending requests have been satisfied
    1. generate new requests
    2. if no requests were generated, we are done, return and transition
    3. otherwise if requests were generated
      1. activate requests (depending on activation policy, serial or parallel, NOT ALL GENERATED REQUESTS MAY BE ACTIVATED AT THIS POINT)
      2. determine a request fulfillment criteria
      3. continue in loop
    4. otherwise if pending requests have not been satisfied, block until invoked again
    This node transitions/completes when there are no remaining blocking action requests (i.e., no approval or completion requests).

    Author:
    Kuali Rice Team (rice.collab@kuali.org)

    Nested Class Summary
    protected static interface IteratedRequestActivationNode.RequestFulfillmentCriteria
               
     
    Field Summary
    protected  org.apache.log4j.Logger LOG
               
     
    Constructor Summary
    IteratedRequestActivationNode()
               
     
    Method Summary
    protected  boolean activateRequests(RouteContext routeContext)
              Activates any pending requests and returns whether there are outstanding blocking requests
    protected  boolean generateNewRequests(boolean initial, RouteContext context, RouteHelper routeHelper)
              Template method that subclasses should override to generates new requests
    protected  IteratedRequestActivationNode.RequestFulfillmentCriteria getRequestFulfillmentCriteria(RouteContext routeContext)
              Template method that subclasses should override to indicate when activated requests have been fulfilled.
     SimpleResult process(RouteContext routeContext, RouteHelper routeHelper)
               
    protected  void saveActionRequest(RouteContext context, ActionRequestValue actionRequest)
               
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    LOG

    protected final org.apache.log4j.Logger LOG
    Constructor Detail

    IteratedRequestActivationNode

    public IteratedRequestActivationNode()
    Method Detail

    process

    public SimpleResult process(RouteContext routeContext,
                                RouteHelper routeHelper)
                         throws Exception
    Specified by:
    process in interface SimpleNode
    Throws:
    Exception

    getRequestFulfillmentCriteria

    protected IteratedRequestActivationNode.RequestFulfillmentCriteria getRequestFulfillmentCriteria(RouteContext routeContext)
    Template method that subclasses should override to indicate when activated requests have been fulfilled. The default implementation is that all pending blocking requests must be fulfilled.

    Returns:
    a RequestFulfillmentCriteria that indicates when activated requests have been fulfilled.

    generateNewRequests

    protected boolean generateNewRequests(boolean initial,
                                          RouteContext context,
                                          RouteHelper routeHelper)
                                   throws WorkflowException,
                                          Exception
    Template method that subclasses should override to generates new requests

    Parameters:
    initial - whether this is the very first request generation, that is, the first generation in the first invocation of the node
    Returns:
    whether new requests were generated
    Throws:
    Exception
    WorkflowException

    activateRequests

    protected boolean activateRequests(RouteContext routeContext)
                                throws WorkflowException
    Activates any pending requests and returns whether there are outstanding blocking requests

    Parameters:
    context - the RouteContext
    Returns:
    whether there are outstanding blocking requests
    Throws:
    WorkflowException - if anything goes wrong...

    saveActionRequest

    protected void saveActionRequest(RouteContext context,
                                     ActionRequestValue actionRequest)


    Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.