The Scripting Pipelet
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 |
ScriptLog
is a transient object you can use to retrieve detailed log information during script execution. Use ScriptLog information during development to report any errors.
You must put this object into the Pipeline Dictionary before you can use 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.
To generate persistent log information, use dw.system.Logger
.
You can write your own information with the trace()
function.
Use the following syntax:
To use the trace()
command, you must first specify the variable and then show it in a window, as shown here:
This example writes to the ScriptLog output.