This will execute a Groovy script written and saved to a text file.

In case of errors a diagnostic message is logged to the standard ROB-EX log window.

Example parameter configuration

Parameter descriptions

(* = configuration required)

parameters
Pass one or more parameters to your script
Enter e.g. “type=import” as parameter. You may add additional parameters separated by semi color. E.g. “type=import; debugOn=false”.

Inside the actual Groovy script, this parameter is available as a var of type Map, with the name “parameters”. You may use it within groovy like this:

if (parameters != null) {
  // extract possible parameters from the ExcecuteScript macro
  def type = parameters['type']
  if (type == "export")
    GlobalVars.type = 0;
  else if (type == "import")
    GlobalVars.type = 1;
  def doDebug = parameters['debugOn']
  if (doDebug != null) {
    boolean debugOn = (doDebug == 'true');
    GlobalVars.debugOn = debugOn;
  }
}

runOnUIThread
If the script called will be executed on the ROB-EX UI (User Interface) thread or not. If the value is “true”, the script will run on the UI of the client – this also means that the UI of the client will be blocked for the duration it takes to execute the script. If your script will update UI elements it is important to run the script on the UI thread, since UI updating is not thread safe.
If the value is “false” make sure your script is thread safe, i.e. that it can run concurrently with other running threads in the ROB-EX Client.

scriptFileName
The path and filename of the script to execute. You may right click in this property field to open a file chooser in order to easily navigate to the file.
Also note that it is possible to specify a directory path relative to the ROB-EX Scheduler installation directory, which will always be the working directory of the ROB-EX client. So specifying custom\scripts\myScript.groovy will find the script in <sch_dir>\custom\scripts\myScript.groovy, where as an example would be c:\program files\Scheduler\planner.

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment