com.ptc.windchill.uwgm.proesrv.action
Class ModelCheckAction

java.lang.Object
  extended bycom.ptc.windchill.uwgm.proesrv.action.UwgmAction
      extended bycom.ptc.windchill.uwgm.proesrv.action.ModelCheckAction

public class ModelCheckAction
extends UwgmAction

ModelCheckAction class is a gatekeeper that confirms model check results from the CADDoc (IBAHolder) as stored by client on saving the model. This is applicable only in the context of user agent being "Pro/Engineer".


Field Summary
private  WTCollection actionObj
           
private static String configAlias
           
private static String configSetting
           
private static String errSetting
           
private static boolean isModelCheckEnabled
           
private static Log log
          Logging
private static String mcConfig
           
private  WTCollection mcConfigFailedObjs
           
private  WTCollection mcErrFailedObjs
           
private  WTCollection mcTSFailedObjs
           
private static int numPermissibleErrors
           
private static long numPermissibleHours
           
private static String tsSetting
           
 
Fields inherited from class com.ptc.windchill.uwgm.proesrv.action.UwgmAction
 
Constructor Summary
ModelCheckAction(RequestContext context, WTCollection modelsToValidate)
          Creates a new instance of ModelCheckAction
 
Method Summary
private  ErrorElement createConfigError(WTCollection configObj)
          Utility method to create exception element for models checked against invalid config rules
private  ErrorElement createModelCheckError(WTCollection mcObj)
          Utility method to create exception element for collection of invalid models
private  ErrorElement createNumPermissibleError(WTCollection errObj)
          Utility method to create exception element for models having errors exceeding valid limits
private  ErrorElement createTimeStampError(WTCollection tsObj)
          Utility method to create exception element for models whose checks were outdated
protected  void executeAction()
          executes action (should be overwritten by implementation action subclasses)
private static void initPermissibleConfigs()
          Extract permissible configurations
private static void initPermissibleErrorCondition()
          Extracts the permissible number of errors from Administrative Policy
private static void initPermissibleTimeRange()
          Extracts number of hours within which the MC should have run prior to checkin! This seems to be a workaround; as the appropriate check would be to know: 1.
static boolean isApplicable(RequestContext reqCtx)
          Convenience public method to know if ModelCheck is applicable in a request context, and is enabled.
protected  boolean isModelCheckStale(String mcTS)
          Validates whether the last MC time stamp is within permissible range
private  boolean isModelConfigValid(String MC_CONFIG)
          Checks whether the MC Configs are valid
private  boolean isNumErrInPermissibleRange(String MC_ERRORS)
          Checks whether the MC errors are in permissible range
protected  boolean scanModelCheck(IBAHolder ibah)
          Scan the model check attributes of individual IBAHolders for validity
 
Methods inherited from class com.ptc.windchill.uwgm.proesrv.action.UwgmAction
addWarning, checkExecutionSuccess, execute, getContext, getWarnings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actionObj

private WTCollection actionObj

mcErrFailedObjs

private WTCollection mcErrFailedObjs

mcTSFailedObjs

private WTCollection mcTSFailedObjs

mcConfigFailedObjs

private WTCollection mcConfigFailedObjs

isModelCheckEnabled

private static boolean isModelCheckEnabled

errSetting

private static String errSetting

numPermissibleErrors

private static int numPermissibleErrors

tsSetting

private static String tsSetting

numPermissibleHours

private static long numPermissibleHours

configSetting

private static String configSetting

mcConfig

private static String mcConfig

configAlias

private static String configAlias

log

private static Log log
Logging

Constructor Detail

ModelCheckAction

public ModelCheckAction(RequestContext context,
                        WTCollection modelsToValidate)
Creates a new instance of ModelCheckAction

Method Detail

executeAction

protected void executeAction()
                      throws UwgmConflictException,
                             UwgmErrorException
Description copied from class: UwgmAction
executes action (should be overwritten by implementation action subclasses)

Specified by:
executeAction in class UwgmAction
Throws:
UwgmErrorException
UwgmConflictException

scanModelCheck

protected boolean scanModelCheck(IBAHolder ibah)
Scan the model check attributes of individual IBAHolders for validity


isNumErrInPermissibleRange

private boolean isNumErrInPermissibleRange(String MC_ERRORS)
Checks whether the MC errors are in permissible range


isModelCheckStale

protected boolean isModelCheckStale(String mcTS)
Validates whether the last MC time stamp is within permissible range


isModelConfigValid

private boolean isModelConfigValid(String MC_CONFIG)
Checks whether the MC Configs are valid


isApplicable

public static boolean isApplicable(RequestContext reqCtx)
Convenience public method to know if ModelCheck is applicable in a request context, and is enabled.


initPermissibleErrorCondition

private static void initPermissibleErrorCondition()
                                           throws Exception
Extracts the permissible number of errors from Administrative Policy

Throws:
Exception

initPermissibleTimeRange

private static void initPermissibleTimeRange()
                                      throws Exception
Extracts number of hours within which the MC should have run prior to checkin! This seems to be a workaround; as the appropriate check would be to know: 1. whether MC was performed after last modification (part of Admin policy) 2. whether any MC rules have changed after the last validation.

Throws:
Exception

initPermissibleConfigs

private static void initPermissibleConfigs()
                                    throws Exception
Extract permissible configurations

Throws:
Exception

createModelCheckError

private ErrorElement createModelCheckError(WTCollection mcObj)
Utility method to create exception element for collection of invalid models


createTimeStampError

private ErrorElement createTimeStampError(WTCollection tsObj)
Utility method to create exception element for models whose checks were outdated


createNumPermissibleError

private ErrorElement createNumPermissibleError(WTCollection errObj)
Utility method to create exception element for models having errors exceeding valid limits


createConfigError

private ErrorElement createConfigError(WTCollection configObj)
Utility method to create exception element for models checked against invalid config rules