protected int getWaitPeriodInSeconds ( ) throws ActivityException { String unit = super . getAttributeValue ( WAIT_UNIT ) ; int factor ; if ( MINUTES . equals ( unit ) ) factor = 60 ; else if ( HOURS . equals ( unit ) ) factor = 3600 ; else if ( DAYS . equals ( unit ) ) factor = 86400 ; else factor = 1 ; // Means specified value is already in seconds int retTime ; String timeAttr ; try { timeAttr = super . getAttributeValueSmart ( WorkAttributeConstant . TIMER_WAIT ) ; } catch ( PropertyException e ) { throw new ActivityException ( - 1 , "failed to evaluate time expression" , e ) ; } retTime = StringHelper . getInteger ( timeAttr , DEFAULT_WAIT ) ; return retTime * factor ; }
Method that returns the wait period for the activity