There’s only one scripting pipelet, located in the Scripting folder in the B2C Commerce API. This pipelet executes a Server-Side JavaScript, which might require a database transaction.
The pipelet's configuration parameters are:
| Properties | Description |
|---|---|
| OnError | Calls PIPELET_ERROR to process the error |
| ScriptFile | The name of the actual script relative to the script's folder containing the pipeline |
| Timeout | Timeout in seconds. Default is 30 seconds. |
| Transactional | Selection of false or true |
Using ScriptLog
ScriptLog is a transient object for retrieving detailed log information during script execution. Use ScriptLog information during development to report any errors.
note: Put this object into the Pipeline Dictionary before using it. To add it to the pipeline dictionary, in the script node, under Dictionary Output, add a variable name to the ScriptLog property. For example, add myLog as the variable name.
Display ScriptLog data in any template with a simple ISML statement.
<pre>
<isprint value="${myLog}">
<pre>
note: To generate persistent log information, use dw.system.Logger.
Using Trace()
Write your own information with the trace() function.
Use the following syntax:
trace(msg : String, params : Object...)
To use the trace() command, you must first specify the variable and then show it in a window, as shown here:
var res = googlesvc.doGoogleSearch(
...
);
trace( res );
This example writes to the ScriptLog output.