Introduction

This article describes how to add custom entries to the BPA Platform Event Log.

Available VBScript Functions

We have made available four VBScript functions as Task Browser properties to help write such entries:

Run — Allows you run an external command in the VBScript
Syntax automatically added: ThisStep.Run
LogInfo — Adds Event Log - Information entries (information) type messages to the Event Log
Syntax automatically added: ThisStep.LogInfo ""

Add required static text inside the double-quotes.

LogError — Adds Event Log - Error entries (error) type messages to the Event Log
Syntax automatically added: ThisStep.LogError ""

Add required static text inside the double-quotes.

LogWarning — Adds Event Log - Warning entries (warning) type messages to the Event Log
Syntax automatically added: ThisStep.LogWarning ""

Add required static text inside the double-quotes.

For more information about available Task Browser properties, refer to the product help.

Note: This article is not intended to be a VBScript tutorial and only covers the necessary functions to complete the task in hand.

Writing Custom Entries

To add custom entries, you use the Run VBScriptClosed The Run VBScript tool is used to create a task step that runs a Visual Basic Script using data produced by other steps in the task. tool. Do the following:

  1. Open the relevant task.
  2. Add a Run VBScript step.
  3. Add a meaningful Name and Description in the General tab.
  4. Go to the Main tab.
  5. Drag the relevant Task Browser property to a new line between Function <step_name>_Function () and End Function.
  6. Add required static text inside double-quotes. Dynamic data, such as recordset columns, variables, formulas, and functions, can be dragged from the Task Browser into the VBScript — no additional formatting is required for such data as they already use VBScript syntax.
  7. Use Check Syntax to ensure the script will execute correctly at task run-time.
  8. Click OK to save and close the Run VBScript step.
  9. It may be an idea to manually queue the task now to ensure the new Run VBScript step correctly updates the Event Log.

    Click Event Log button (Event Log) in the Tasks toolbar to open the Event Log.

Example Information Entry

You have a task that uses the Send Email (SMTP)Closed The Send Email (SMTP) tool sends messages to any SMTP compliant mail server. This tool is capable of sending multiple messages in either text or HTML formats, incorporating data from Input and Format steps to any number of recipients. If recordset data being used from an Input step includes a column containing email addresses, then this can be used as a "dynamic" recipient address. step. However, the email server that is used is dynamically determined by a task variableClosed Variables are created and used extensively throughout and can either have fixed values or values that are dynamically populated when a task is run. Task variables are only available for the specific task they are created for. Users with Task Administrator rights can create task variables. at run-time. So that you have a record of which server is used for each task run-time, you can add a Run VBScript step with the following:

ThisStep.LogInfo Task.Name & " used email server " & Variables("EmailCxn")

where Task.Name is a Task Browser property and EmailCxn is the variable containing the relevant Send Email (SMTP) global connection.