Version 0.9

Skip to end of metadata
Go to start of metadata

Introduction

Plugins let you add additional functionality to your ElastiCube builds, by adding .NET or Python code at the beginning and/or end of an ElastiCube build. Examples of what you can do include:

  • Copy csv files from a remote location to your local machine before running an ElastiCube build.
  • Manipulate and rename csv or Excel files before importing them into the ElastiCube.
  • Send emails after a build finishes.

Implementing with .NET

Plugins can be written in any .NET language.

Setting up your .NET project

  1. Add a reference to ElastiCube.PluginBase.dll in your project.
  2. Add a reference to the .NET dll System.ComponentModel.Composition in your project.
  3. Add an ElastiCubePart attribute to your main Class:
    [ElastiCubePart("MyPlugin", ExecutionTypes.ExecuteAlways, false)]

    The first parameter is the plugin name as it will be used in the ElastiCube Manager. The second parameter determines if the build should fail if the plugin fails.

  4. Your main class must implement the ‘IElastiCubePart’ interface (referenced inElastiCube.PluginBase.dll).
  5. Your plugin DLL file must be copied into the plugins folder in the installation directory:C:\Program Files\Sisense\Prism\server/plugins. Create the plugins folder if it does not exist.
Plugin Code Example  Expand source

Using the Plugin

  1. Open your ElastiCube in the ElastiCube Manager, and click ElastiCubes >Pre & Post Execution Plugins.
  2. In either the Pre- or Post-Execution Plugins, click Add. Rename the plugin to match the name you used in the Class attribute of your .NET project.
  3. Click the Edit icon to configure the plugin, and add arguments in XML form.

An example of how the arguments should be formatted:

You can then access these attributes from your .NET application using the args.Args.Attribute(name) method. Here’s an example in C#

You can use the same plugins for Pre & Post execution.

 Example:Send build status email

 The post plugin below sends emails to a list of email addresses with the build status.

A completed DLL file for the code below can be downloaded: Post Plugin DLL

You send arguments to your plugin in XML form by clicking the ‘Edit execution plugin arguments’ button on the right side of the window.
An example of how the arguments should be formatted:

XML Sample:

In this example we used smtp.google.com to send emails.

Implementing with Python

To create a plugin using a Python script, follow these steps:

Note: Python must be installed on your machine before beginning. 

  1. Extract the PyRunner.zip file to C:\Program Files\Sisense\Prism\plugins. You may have to create the plugins folder if it does not yet exist.
  2. Right-click the DLL file and click Properties. In the General tab, verify that the file is not locked. If it is, click Unblock.
  3. Write your python script and place it in the same folder (C:\Program Files\Sisense\Prism\Server\plugins).
  4. Open your ElastiCube in the ElastiCube Manager, and click ElastiCubes >Pre & Post Execution Plugins.
  5. In either the Pre- or Post-Execution Plugins, click Add, and rename the plugin PyRunner. 

  6. Click the Edit icon to configure the plugin. Enter the the following XML:
    <Config Program="yourfile.py"></Config>
  7. Replace yourfile with the name of your Python file.
  8. Build the ElastiCube. You can see the result in the build log.

On this page

  • No labels