atg.projects.b2bstore.approval
Class ProcCheckRequisitionNumbers

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.projects.b2bstore.approval.ProcCheckRequisitionNumbers
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, PipelineProcessor, java.util.EventListener

public class ProcCheckRequisitionNumbers
extends GenericService
implements PipelineProcessor

This pipeline processor returns one of two values, depending on whether or not an order contains any payment group with an associated requisition number. Pipeline chains can use this processor to branch and treat requisition-based orders differently from other orders (e.g., to automatically require approval of orders that specify requisition numbers).

This processor can also add an error message to the pipeline result object in cases where the order specifies a requisition number, which allows the ProcExecuteChain processor to return a different value to an enclosing pipeline chain.


Field Summary
static java.lang.String CLASS_VERSION
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.service.pipeline.PipelineProcessor
STOP_CHAIN_EXECUTION, STOP_CHAIN_EXECUTION_AND_COMMIT, STOP_CHAIN_EXECUTION_AND_ROLLBACK
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
ProcCheckRequisitionNumbers()
           
 
Method Summary
 int getRequisitionNotUsedValue()
          Get the value to return if an order does not contain requisition numbers in any of its payment groups.
 java.lang.String getRequisitionUsedPipelineMessage()
          Get the string to use as the error object if requisitionUsedAddsPipelineError is true and the order contains requisition numbers in any of its payment groups.
 int getRequisitionUsedValue()
          Set the value to return if an order does contain requisition numbers associated with any of its payment groups.
 int[] getRetCodes()
          Return an array of possible return values for this processor.
protected  boolean isBlank(java.lang.String pStr)
          Return true if the string specified by pStr is null, an empty string, or consists entirely of whitespace.
 boolean isRequisitionUsedAddsPipelineError()
          Query whether to add an error object to the pipeline result if an order contains requisition numbers in any of its payment groups.
 int runProcess(java.lang.Object pParam, PipelineResult pResult)
          Iterate over payment groups in an order, returning requisitionUsedValue if any payment group in the order specifies a requisition number, and returning requisitionNotUsedValue and optionally adding an error to the pipeline result otherwise.
 void setRequisitionNotUsedValue(int pRequisitionNotUsedValue)
          Set the value to return if an order does not contain requisition numbers in any of its payment groups.
 void setRequisitionUsedAddsPipelineError(boolean pRequisitionUsedAddsPipelineError)
          Specify whether to add an error object to the pipeline result if an order contains requisition numbers in any of its payment groups.
 void setRequisitionUsedPipelineMessage(java.lang.String pRequisitionUsedPipelineMessage)
          Ste the string to use as the error object if requisitionUsedAddsPipelineError is true and the order contains requisition numbers in any of its payment groups.
 void setRequisitionUsedValue(int pRequisitionUsedValue)
          Set the value to return if an order does contain requisition numbers associated with any of its payment groups.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Constructor Detail

ProcCheckRequisitionNumbers

public ProcCheckRequisitionNumbers()
Method Detail

runProcess

public int runProcess(java.lang.Object pParam,
                      PipelineResult pResult)
               throws InvalidParameterException
Iterate over payment groups in an order, returning requisitionUsedValue if any payment group in the order specifies a requisition number, and returning requisitionNotUsedValue and optionally adding an error to the pipeline result otherwise.

Specified by:
runProcess in interface PipelineProcessor
Parameters:
pParam - an optional user parameter
pResult - the PipelineResult object which is used to return errors or other data
Returns:
an integer value which is mapped to the next processor to execute. STOP_CHAIN_EXECUTION will notify the PipelineManager to stop execution. An unmapped value will throw a RunProcessException.
Throws:
InvalidParameterException

getRetCodes

public int[] getRetCodes()
Return an array of possible return values for this processor. The array will contain two entries, whose values are specified by requisitionUsedValue and requisitionNotUsedValue.

Specified by:
getRetCodes in interface PipelineProcessor
Returns:
an array of all the return codes that could be returned by this PipelineProcessor.

isBlank

protected boolean isBlank(java.lang.String pStr)
Return true if the string specified by pStr is null, an empty string, or consists entirely of whitespace.


setRequisitionUsedValue

public void setRequisitionUsedValue(int pRequisitionUsedValue)
Set the value to return if an order does contain requisition numbers associated with any of its payment groups.


getRequisitionUsedValue

public int getRequisitionUsedValue()
Set the value to return if an order does contain requisition numbers associated with any of its payment groups. This value defaults to STOP_CHAIN_EXECUTION_AND_COMMENT (i.e., to zero).


setRequisitionNotUsedValue

public void setRequisitionNotUsedValue(int pRequisitionNotUsedValue)
Set the value to return if an order does not contain requisition numbers in any of its payment groups.


getRequisitionNotUsedValue

public int getRequisitionNotUsedValue()
Get the value to return if an order does not contain requisition numbers in any of its payment groups. This value defaults to 1.


setRequisitionUsedAddsPipelineError

public void setRequisitionUsedAddsPipelineError(boolean pRequisitionUsedAddsPipelineError)
Specify whether to add an error object to the pipeline result if an order contains requisition numbers in any of its payment groups.


isRequisitionUsedAddsPipelineError

public boolean isRequisitionUsedAddsPipelineError()
Query whether to add an error object to the pipeline result if an order contains requisition numbers in any of its payment groups. The default value is false.


setRequisitionUsedPipelineMessage

public void setRequisitionUsedPipelineMessage(java.lang.String pRequisitionUsedPipelineMessage)
Ste the string to use as the error object if requisitionUsedAddsPipelineError is true and the order contains requisition numbers in any of its payment groups.


getRequisitionUsedPipelineMessage

public java.lang.String getRequisitionUsedPipelineMessage()
Get the string to use as the error object if requisitionUsedAddsPipelineError is true and the order contains requisition numbers in any of its payment groups.