//
// Integrity sample script.
//
// This script runs a custom java code in com.abc.custom.
//
function run
{
Packages.com.abc.custom.CopyFile;
}
var eb = bsf.lookupBean("siEnvironmentBean");
print("TRIGGER SCRIPT echo.js: Event Type: " + eb.getEventName()
+ ", " + eb.getEventType() + ", " + eb.getEventContext());
|
|
Custom Java code runs inside the PTC RV&S server JVM and therefore can impact server performance. Code that runs computationally intensive activities can degrade server performance.
|
installdir/data/documentation/javadocs/triggers/index.html
|
JavaScript
|
Java
|
|---|---|
|
Not object-oriented
|
Object-oriented language
|
|
Not compiled, runs interpretively
|
Is compiled
|
|
Tries to continue running on errors
|
Exceptions raised on errors
|
|
Variable declaration is optional
|
Variables must be declared
|
|
Variables can change data type
|
Variables cannot change data type
|
|
Functions are used
|
Methods are used
|
|
Little encapsulation – only function variables are private
|
Full range of encapsulation (public, protected, private) for methods and variables
|