public String createSlaMessage ( final ExecutableFlow flow ) { final int execId = flow . getExecutionId ( ) ; final String durationStr = durationToString ( this . duration ) ; switch ( this . type . getComponent ( ) ) { case FLOW : final String basicinfo = "SLA Alert: Your flow " + this . flowName + " failed to " + this . type . getStatus ( ) + " within " + durationStr + "<br/>" ; final String expected = "Here are details : <br/>" + "Flow " + this . flowName + " in execution " + execId + " is expected to FINISH within " + durationStr + " from " + fmt . print ( new DateTime ( flow . getStartTime ( ) ) ) + "<br/>" ; final String actual = "Actual flow status is " + flow . getStatus ( ) ; return basicinfo + expected + actual ; case JOB : return "SLA Alert: Your job " + this . jobName + " failed to " + this . type . getStatus ( ) + " within " + durationStr + " in execution " + execId ; default : return "Unrecognized SLA component type " + this . type . getComponent ( ) ; } }
Construct the message for the SLA .