Class ScriptExecution


  • public class ScriptExecution
    extends Object
    The static methods of this class are made available as functions in the scripts. This allows a script to call another script, which is available as a file.
    Author:
    Kai Kreuzer - Initial contribution
    • Constructor Detail

      • ScriptExecution

        public ScriptExecution()
    • Method Detail

      • callScript

        public static Object callScript​(String scriptName)
                                 throws ScriptExecutionException
        Calls a script which must be located in the configurations/scripts folder.
        Parameters:
        scriptName - the name of the script (if the name does not end with the .script file extension it is added)
        Returns:
        the return value of the script
        Throws:
        ScriptExecutionException - if an error occurs during the execution
      • createTimer

        public static Timer createTimer​(org.joda.time.base.AbstractInstant instant,
                                        org.eclipse.xtext.xbase.lib.Procedures.Procedure0 closure)
        Schedules a block of code for later execution.
        Parameters:
        instant - the point in time when the code should be executed
        closure - the code block to execute
        Returns:
        a handle to the created timer, so that it can be canceled or rescheduled
        Throws:
        ScriptExecutionException - if an error occurs during the execution
      • createTimerWithArgument

        public static Timer createTimerWithArgument​(org.joda.time.base.AbstractInstant instant,
                                                    Object arg1,
                                                    org.eclipse.xtext.xbase.lib.Procedures.Procedure1<Object> closure)
        Schedules a block of code (with argument) for later execution
        Parameters:
        instant - the point in time when the code should be executed
        arg1 - the argument to pass to the code block
        closure - the code block to execute
        Returns:
        a handle to the created timer, so that it can be canceled or rescheduled
        Throws:
        ScriptExecutionException - if an error occurs during the execution