Package org.compiere.model
Class Scriptlet
java.lang.Object
org.compiere.model.Scriptlet
Bean Shell Script Model
- Version:
- $Id: Scriptlet.java,v 1.2 2006/07/30 00:51:03 jjanke Exp $
- Author:
- Jorg Janke
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionexecute()
Execute Script.
Loads environment and saves result.Get DescriptionGet Environment ContextgetResult
(boolean runIt) Get ResultGet ScriptGet Variablevoid
setEnvironment
(String key, Object value) Set Environment key to valuevoid
setEnvironment
(String key, String stringValue) Set Environment key to valuevoid
setEnvironment
(HashMap<String, Object> ctx) Set Environment Contextvoid
setEnvironment
(Properties prop, int WindowNo) Set Environmentvoid
Set Scriptvoid
setVariable
(String variable) Set Result Variable Name.toString()
String Representation incl.void
validate()
Validate script.
-
Field Details
-
VARIABLE
Default Result Variable Name- See Also:
-
DESCRIPTION_VARIABLE
Default Description Variable Name- See Also:
-
-
Constructor Details
-
Scriptlet
public Scriptlet()Constructor -
Scriptlet
Full Constructor- Parameters:
variable
- Variable Namescript
- The Scriptprop
- EnvironmentWindowNo
- Included Window variables
-
Scriptlet
Full Constructor- Parameters:
variable
- Variable Namescript
- The Scriptctx
- Environment
-
-
Method Details
-
execute
Execute Script.
Loads environment and saves result.- Returns:
- null or Exception
-
validate
public void validate() throws bsh.ParseExceptionValidate script.- Throws:
bsh.ParseException
-
getVariable
Get Variable- Returns:
- variable
-
setVariable
Set Result Variable Name.- Parameters:
variable
- - if null set toVARIABLE
-
setScript
Set Script- Parameters:
script
-
-
getScript
Get Script- Returns:
- script
-
setEnvironment
Set Environment- Parameters:
prop
-WindowNo
- included Window variables
-
setEnvironment
Set Environment key to value- Parameters:
key
- variable name ('#' will be converted to '_')stringValue
- try to convert to Object
-
setEnvironment
Set Environment key to value- Parameters:
key
- variable name ('#' will be vonverted to '_')value
-
-
setEnvironment
Set Environment Context- Parameters:
ctx
-
-
getEnvironment
Get Environment Context- Returns:
- environment
-
getResult
Get Result- Parameters:
runIt
- if true, execute script- Returns:
- result or null
-
getDescription
Get Description- Returns:
- description or null
-
toString
String Representation incl. Result
-