Class ScriptHelperImpl
java.lang.Object
org.apache.ofbiz.common.scripting.ScriptHelperImpl
- All Implemented Interfaces:
ScriptHelper
An implementation of the
ScriptHelper
interface.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateServiceMap
(String serviceName, Map<String, ? extends Object> inputMap) Extracts service IN parameters frominputMap
and returns them in a newMap
.void
Sets the event/service status to error status.evalString
(String original) Evaluates aString
and returns the result.void
Sets the event/service status to failure status.Returns aList
ofGenericValue
s.Finds aGenericValue
by primary key.Finds aGenericValue
by primary key.void
Logs an error message.void
Logs an info message.void
logWarning
(String message) Logs a warning message.Creates a new, emptyGenericValue
.Creates a new, emptyGenericValue
.runService
(String serviceName, Map<String, ? extends Object> inputMap) Runs a service synchronously.runService
(String serviceName, Map<String, ? extends Object> inputMap, Map<String, ? extends Object> args) Runs a service synchronously.void
success()
Sets the event/service status to success status.void
Sets the event/service status to success status.
-
Constructor Details
-
ScriptHelperImpl
-
-
Method Details
-
createServiceMap
public Map<String,? extends Object> createServiceMap(String serviceName, Map<String, ? extends Object> inputMap) throws ScriptExceptionDescription copied from interface:ScriptHelper
Extracts service IN parameters frominputMap
and returns them in a newMap
.- Specified by:
createServiceMap
in interfaceScriptHelper
- Returns:
- The matching service parameters
- Throws:
ScriptException
-
error
Description copied from interface:ScriptHelper
Sets the event/service status to error status.- Specified by:
error
in interfaceScriptHelper
-
evalString
Description copied from interface:ScriptHelper
Evaluates aString
and returns the result.- Specified by:
evalString
in interfaceScriptHelper
- Returns:
-
failure
Description copied from interface:ScriptHelper
Sets the event/service status to failure status.- Specified by:
failure
in interfaceScriptHelper
-
findList
public List<Map<String,Object>> findList(String entityName, Map<String, ? extends Object> fields) throws ScriptExceptionDescription copied from interface:ScriptHelper
Returns aList
ofGenericValue
s.- Specified by:
findList
in interfaceScriptHelper
- Returns:
- Throws:
ScriptException
-
findOne
Description copied from interface:ScriptHelper
Finds aGenericValue
by primary key. The helper will construct a primary key from existing variables.- Specified by:
findOne
in interfaceScriptHelper
- Returns:
- Throws:
ScriptException
-
findOne
public Map<String,Object> findOne(String entityName, Map<String, ? extends Object> fields, Map<String, throws ScriptException? extends Object> args) Description copied from interface:ScriptHelper
Finds aGenericValue
by primary key. The helper will construct a primary key from existing variables and/orfields
.- Specified by:
findOne
in interfaceScriptHelper
- Returns:
- Throws:
ScriptException
-
logError
Description copied from interface:ScriptHelper
Logs an error message.- Specified by:
logError
in interfaceScriptHelper
-
logInfo
Description copied from interface:ScriptHelper
Logs an info message.- Specified by:
logInfo
in interfaceScriptHelper
-
logWarning
Description copied from interface:ScriptHelper
Logs a warning message.- Specified by:
logWarning
in interfaceScriptHelper
-
makeValue
Description copied from interface:ScriptHelper
Creates a new, emptyGenericValue
.- Specified by:
makeValue
in interfaceScriptHelper
- Returns:
- Throws:
ScriptException
-
makeValue
public Map<String,Object> makeValue(String entityName, Map<String, Object> fields) throws ScriptExceptionDescription copied from interface:ScriptHelper
Creates a new, emptyGenericValue
.- Specified by:
makeValue
in interfaceScriptHelper
- Returns:
- Throws:
ScriptException
-
runService
public Map<String,? extends Object> runService(String serviceName, Map<String, ? extends Object> inputMap) throws ScriptExceptionDescription copied from interface:ScriptHelper
Runs a service synchronously.- Specified by:
runService
in interfaceScriptHelper
- Returns:
- Throws:
ScriptException
-
runService
public Map<String,? extends Object> runService(String serviceName, Map<String, ? extends Object> inputMap, Map<String, throws ScriptException? extends Object> args) Description copied from interface:ScriptHelper
Runs a service synchronously.- Specified by:
runService
in interfaceScriptHelper
- Returns:
- Throws:
ScriptException
-
success
public void success()Description copied from interface:ScriptHelper
Sets the event/service status to success status.- Specified by:
success
in interfaceScriptHelper
-
success
Description copied from interface:ScriptHelper
Sets the event/service status to success status.- Specified by:
success
in interfaceScriptHelper
-