// Simple Action Element to Simulate a Delay // Gerard O'Rourke // date: 25/10/2017 import com.audium.server.AudiumException; import com.audium.server.voiceElement.ActionElementBase; import com.audium.server.session.ActionElementData; /** * This class is called when a standard action has been configured to use a * Java class. Since this is a standard action element, it applies to a * specific application and does not have a configuration. As a result, the * only method needed in this class is the doAction method. */ public class ActionDelay extends ActionElementBase { /** * All action classes must implement this method. The data is retrieved * through the ActionElementData class. Unlike decisions, there is no need * to return anything as all actions have a single exit state. */ public void doAction(String name, ActionElementData data) throws AudiumException { int timer = Integer.parseInt((String) data.getSessionData("delay-in-ms")); try { Thread.sleep(timer); } catch (InterruptedException e) { data.addToLog("ERROR InterruptedException", e.toString()); } } }