Script Execution Plugin

<< Click to Display Table of Contents >>

RayFlow > 7.4 u1 > User and Administration Guide > Configuration > Basic > Plugin Configuration 

Script Execution Plugin

The Script Execution Plugin can be configured here. Select the Script Return Datafield and the Plugin Executing User by using the dropdown menus.

 

BasicScriptExecutionPlugin

 

Activation

To activate the plugin, go to Administration > Plugins and select the Script Execution Plugin.

 

Plugins_ScriptExecutionPlugin

 

Activate the Script Execution Plugin for a project by setting the checkmark in the Active box for the project and clicking on the green OK button to save the change.

 

In the next step, go to Configuration > Basic and select the Script Execution Plugin from the list.

 

BasicsScriptExecutionPlugin

 

Script Return Datafield: Select the datafield into which the plugin will write the return calls form the scripts.

Plugin Execution User: Select a user for the execution of the plugin.

 

finger1

Be aware:

The user that is used needs edit rights for all phases where the plugin will be used.

 

Script Configurations

In order to use the Script Execution Plugin it is necessary to define at least on script configuration in the ScriptSettings.cfg. The ScriptSettings.cfg can be found in the Plugins folder of the RayFlow installation (by default: C:\inetpub\wwwroot\rayflow\bin\Plugins). For the file the JSON format is used.

 

warning1

WARNING

Script configurations can only be configured within the "ScriptSettings": [] scope. There can only be one "Script Settings":[] scope within the ScriptSettings.cfg. Do not define another "ScriptSettings":[] scope!

 

A script configuration contains the following settings:

 

Setting

Description

Example

"Name"

The name of the script configuration.

"ExampleConfiguration"

"Active"

Defines if the script configuration is active or not. If set to true, the configuration is active. If set to false, the configuration is inactive and will not trigger in the current phase.

true

"ScriptPath"

Path to the script depending on the what type of script is used. It is possible to use either .ps1, .exe, .bat, or the cmd.exe. For all but the cmd.exe it is necessary to use the full path to the script.

"C:\\Scripts\\ExampleScript.ps1"

cmd.exe

"Arguments"

Arguments that will be used when the script is executed. The arguments depend on the type of script that is being used. In addition there are replaceables available that can be used with the arguments.

-projectId ##Project##

"TriggerPhase"

The phase in which the script will be triggered. Only one phase can be listed here

"PKG"

"TriggerStatus"

Defines the status of the task that will trigger the script.

"Active"

 

Replaceables

It is possible to use replaceables as arguments. When the script is executed, these replaceables will be exchanged for their value in RayFlow.

 

The following static replaceables are available in RayFlow.

 

##Task##

##Phase##

##Project##

##Category##

##Status##

##User##

 

Furthermore it is possible to use datafields as replaceables. The syntax to use a datafield as a replaceable ##(datafieldname)##.

 

finger1

Be aware:

If using a datafield as a replaceable and the datafield is empty the value will be returned as an empty string. Depending on the script that is being used, this might lead to problem!

 

Default ScriptSettings.cfg File

{

  "ScriptSettings": [

    {

      "Name": "TestPowershell",

      "Active": true,

      "ScriptPath": "C:\\Scripts\\TestScript.ps1",

      "Arguments": "-statusId ##Status## -projectId ##Project## -dtf1 \"\"\"##Arch##\"\"\" -dtf2 \"\"\"##OS Compat##\"\"\"",

      "TriggerPhase": "PKG",

      "TriggerStatus": "Active"

    },

    {

      "Name": "TestPowershell2",

      "Active": false,

      "ScriptPath": "C:\\Scripts\\TestScript.ps1",

      "Arguments": "-statusId ##Status## -projectId ##Project## -datafield1 \"\"\"##Manu facturer##\"\"\"",

      "TriggerPhase": "PKG",

      "TriggerStatus": "Active"

    },

    {

      "Name": "TestBatch",

      "Active": true,

      "ScriptPath": "C:\\Scripts\\TestScript.bat",

      "Arguments": "##Status## ##Project## \"##Manu facturer##\"",

      "TriggerPhase": "EVAL",

      "TriggerStatus": "Active"

    },

    {

      "Name": "TestCommandline",

      "Active": false,

      "ScriptPath": "cmd.exe",

      "Arguments": "ipconfig",

      "TriggerPhase": "PKG",

      "TriggerStatus": "Active"

    },

    {

      "Name": "TestExecutable",

      "Active": false,

      "ScriptPath": "C:\\Scripts\\TestScript.exe",

      "Arguments": "-v",

      "TriggerPhase": "PKG",

      "TriggerStatus": "Active"

    }

  ]

}