Book a Demo

Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Prev Next

Data Miner Scripts

A Data Miner Scripts element (DMScripts) can be used to process the raw data returned from a DMSet. The script is written in JavaScript and will receive the data in a number of different formats, depending on the source.

Add a new script

The scripts to be run are defined as 'Operations' on the DMScripts element. Add one or more operations and define the JavaScript code to be run on the Data Miner data.

For access to starter scripts you can use a Pattern or use the Model Wizard to create a new Data Miner model:

  • Select a Package in the Browser window
  • Set the Perspective to: Perspective > Management > Data Miner.

Then either:

  • Create a new Data Miner diagram
  • Drag a Pattern from the Toolbox


  • Open the Model Wizard (Start Page > 'Create from Pattern')
  • Locate the Data Miner pattern you want to use
  • Click on the Create Model(s) button to create one of the Data Miner models in your Package

The DMScript element will contain sample JavaScript code to use as a starter for creating your own Data Miner.

Connecting a script operation to a DMSet

The connection between a DMScript and a DMSet must be a connection to a specific operation in the DM Script element, not just to the DM Script element itself. The connector type is 'Harvester'.

Shows the connector attached to a specific script operation of the DMScripts element

To set this connection:

  • Select the DMScripts element
  • Click on the operation in the element
    This will show the Feature Linker on the side of the element:
  • Drag the Feature Linker to the DM Set element
  • Select Harvester in the context menu.

Each script operation can be connected to multiple DMSet elements and, when run, will receive each data set in turn.


The script is written in JavaScript and uses the Data Miner Package automation classes. To access the Script for editing:

  • Select the DMScripts element
  • Right-click on the element
  • Select Edit Data Miner Processor.

For more details on using the Data Miner automation, see the Data Miner Package Help topics. For more details on using the automation to create elements and connectors in the model see the Element Package and Connector Package under the automation Reference Help topic.

Run the Data Miner

Run all scripts:

  • Right click on the DMScripts element
  • Select Run Data Miner Processor.

Run a specific script:

  • Select the script operation in the DMScripts element
  • Right click the script operation and select Run.

Learn More