Package org.compiere.model
Class Scriptlet
java.lang.Object
org.compiere.model.Scriptlet
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 resultGet DescriptionGet EnvironmentgetResult
(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 Environmentvoid
setEnvironment
(Properties prop, int WindowNo) Set Environmentvoid
Set Scriptvoid
setVariable
(String variable) Set VariabletoString()
String Representation incl.void
validate()
-
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.ParseException- Throws:
bsh.ParseException
-
getVariable
Get Variable- Returns:
- variable
-
setVariable
Set Variable- Parameters:
variable
- - if null set to VARIABLE
-
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- Parameters:
ctx
-
-
getEnvironment
Get Environment- 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
-