Troubleshooting Script Manager
Our tips to help figure out why you're having a problem in the Script Manager.
Compilation errors
These error types are mainly due to one of the following reasons:
- The saved script was renamed, moved, or deleted.
- The package path doesn't match the folder structure.
- Class was not found due to missing import.
- A dependent saved script fails to compile.
An error will typically mention a class or 'scriptnot found'.
Missing saved scripts
When a saved script has been deleted but is still referenced:
- Script failing with compilation errors of missing classes or properties.
- Some execution errors will reference only the script ID.
- The name of the deleted script is not available.
- Fix: Choose a new saved script, or contact Support to have the deleted script restored.
Was a saved script deleted?
You should check the following:
- Missing script, or missing method exceptions.
- 'Script not found' errors that reference a UUID.
Does the folder path match the package declaration?
You may notice this as a missing script, or missing method exceptions.
Autocomplete does not appear to work
Autocomplete only works for classes, not plain scripts. It will work for methods contained within scripts too, but only after a manual import has occurred.
Some level of failure can occur during autocompletion as we fetch code from remote storage and compile on the fly so if a saved script appears to be missing according to the autocompletion but you know it's there, you can fallback to writing the import statement manually.
Script Manager content is unusually large, or deeply nested
If there are too many scripts, you should simplify.
We have built Script Manager to handle hundreds of scripts, even thousands. However, Cloud environments can have drawbacks when operating at such scales and various limiting conditions can occur depending on variations like scripts size, scripts count, names length and other. We recommend that if you use large numbers of saved scripts then it should only be considered as an extreme case and efforts should be made to prevent the codebase from reaching such extents.
Other limitations
- We do not enforce a hard limit on the number of scripts you can create. However, based on maximum name length and other system considerations, we recommend keeping your codebase to no more than 3,000 scripts.
- There is no restriction on script length, but very large scripts can be difficult to maintain. We recommend organizing your code into smaller, easier-to-maintain scripts.
- Script Manager does not introduce significant performance overhead. However, because scripts are stored in the cloud, you may experience minor sub-second delays when modified scripts are loaded into the runtime environment.
Recommendations
ABC.groovy, is the same as the class name:class ABC {
}package utils
class Test {
static def myTest1() {
return "hello"
}
static def myTest2() {
return "goodbye"
}
}If multiple classes within one file is preferred, you can create one overarching class that contain child classes within:
package utils
public class DoubleClass{
class DoubleClassOne{
static String returnSomething(String something){
return something;
}
}
class DoubleClassTwo{
static String returnSomething(String something){
return something;
}
}
}import utils.DoubleClass
logger.info(DoubleClass.DoubleClassOne.returnSomething('Hi')+DoubleClass.DoubleClassTwo.returnSomething('Bye'))