Script Creation Cycle - Tools

The Mosaic Device Manager ACS contains all tools necessary to create, test and refine scripts. They include:

  • Scripting Editor – Create/edit your script here
  • Script Log – View script debug messages here
  • Event Log – View the TR-069 session results and debug messages here
  • BulkOp Details - View the results of the log.toReport() function here
  • Parameter Browser – View updated device parameter values here

A typical script creation cycle is:

  1. Edit script
  2. Execute script against a device
  3. Review the script and event logs for errors/debug messages
  4. Review updated parameters

Repeat this process until all errors are resolved and the needed functionality is achieved.

 

Script Editor

To create a new script navigate to the Script Editor under ADMINISTRATION (top) -> Scripts (left) and press the green + button located at the upper/left of the Script List. The Script Editor window will appear:

Enter the following:

  • Name - The script must have a unique name.
  • Code - The script must have a unique code. This is an internal reference to the script.
  • Usable with - Select the method(s) for triggering the execution of the script:
    • Users – The script can be executed against a single subscriber/device record by selecting the Scripts service under the target record.*
    • Bulk Operations – The script can be executed by a BULK OPERATION.
    • Events – The script can be executed when an event is detected (e.g. Initial Contact, Subscriber Associated, etc. See ADMINISTRATION -> Events).
    • Services – The script can be executed as part of a Service. (See ADMINISTRATION -> Services)
  • Parameters – If your script requires parameter inputs (arguments), specify the data type, name and description of the parameter(s).
  • JavaScript source – Enter the script’s source code here.

* NOTE: At a minimum scripts should be specified for use by “Users” so they can be executed against a test device during script development.

 

Script Log

Complete instructions for the Script Log feature are available in this article: Working With Scripts.

Use the log.info/warning/error/fatal functions to place messages in the script log. See the Script Logging Functions section of this guide to learn more.

 

Event Log

To view detailed logs containing all source code, log messages and TR-069 protocol for your script’s execution reference the Event Log by navigating to EXPERT (left) -> Event Logs and select on the blue text from the Recent Sessions list:

NOTE: Set the Logging Detail to Network prior to executing your script in order to include the most detail in the Event Log.

 

Selecting the blue text in the Recent Sessions list causes the Session Log to be displayed. select the Show Trace Detail and/or Show SOAP Detail check boxes to display the script source/messages and TR-069 (SOAP/XML) respectively:

 

BulkOp Details

You can view the results of the log.toReport() function in any completed bulk operation. To access the log, navigate to BULK OPERATIONS and select the desired operation.

NOTE: The log.toReport() function is exclusively available for bulk operation scripts.

 

Parameter Browser

To view the effects your script has on the device’s data model reference the Parameter Browser by navigating to Parameter Browser in the left navigation bar, then expand the tree until the script’s target parameters are displayed in the Properties pane:

NOTE:

  1. Change the Save Level to Save Parameters prior to executing your script.
  2. If you would like to view ALL parameter values presently stored in the device, execute the TR069 – Get All Parameters script to populate the Parameter Browser tree.