Automize scripting and Remote Task

Discuss Task Sequences and Scripting related issues.

Automize scripting and Remote Task

Postby Tech Support » Mon Sep 21, 2015 1:08 pm

We have some Automize Scripting questions. I’ve looked through the example_scripts directory and that gives some basics of interacting with Tasks and Automize Variables.

A few open questions:
· Is there an object model or diagram somewhere to say what classes we should/should not use for scripting?
· We’re working with an environment with more than one licensed instance using RemoteTasks
o Is there a way to access RemoteTasks via the Scripting API?
o How about setting variables in a remote instance?
o Is there a recommended way to gather information from one environment in the other?

Thanks in advance!
Tech Support
Site Admin
 
Posts: 1276
Joined: Thu May 25, 2006 11:12 am

Re: Automize scripting and Remote Task

Postby Tech Support » Mon Sep 21, 2015 1:09 pm

1) If you use java or groovy to script, you can use all the features of these languages. Groovy is far better than the default java beanshell included. beanshell is not updated for many years but still works well for most needs. I have never tried or needed anything beyond basic java.text, java.lang, java.util classes, but everything including java.nio, java.net, javax.sql etc.. are available.

2) The only access to hitek classes is via the following static methods of Script class. Most of this is used in the ‘Hitek Methods’ examples.
static void act(java.lang.String msg) - write a string to activity log
static void err(java.lang.Exception e) - write error stack trace for exception e to debug log.
static java.lang.String getPar(java.lang.String taskTitle, java.lang.String par) - get a task parameter value
static java.lang.String getVar(java.lang.String var) - get a task variable value
static void out(java.lang.String msg) - write a string to output log
static void resumeSchedule(java.lang.String scheduleTitle) - resume a task schedule
static int run(java.lang.String taskTitle) - run a task and get its exit code
static void setPar(java.lang.String taskTitle, java.lang.String par, java.lang.String val) - set a task parameter value
static void setVar(java.lang.String var, java.lang.String val) - set a task variable value
static void suspendSchedule(java.lang.String scheduleTitle) - suspend a task schedule
static void tasklog(java.lang.String taskTitle, java.lang.String msg) - write a string to a specific task log

3) Remote Tasks can be run via the Script. But the variables/Parameters are those of the local ‘Remote Task’ task, not the actual task which which is run on the remote server. So, essentially your interaction is limited to just running tasks at this point. If you have shared network access to the remote Automize folder, then you can read (or set) the variables directly from the ‘...Automize11\data\variables’ folders using the java Properties class.

4) I have added to our 11.x wishlist to add some tasks to get/set variables and get/set task parameters on remote systems.
Tech Support
Site Admin
 
Posts: 1276
Joined: Thu May 25, 2006 11:12 am


Return to Task Sequences, Chains and Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron