Script

Use the Script component to write custom C# methods for use in automations. The Script component can contain multiple methods. This topic describes:

 

Script Component and Associated Files

When you add this component to an automation, the system places it on the Global tab of the component tray. For more information, see Adding Global Components to an Automation. This component must be global to be referenced by other automations in the project.

When you add a Script component to a solution and create at least one method for the script, Studio creates an assembly file (Script-identifier.dll) for the Script component. This file, along with DLL files required for any of the other Studio components that generate dynamic assemblies, are stored in the user's %LocalAppData% folder. These assembly files are used by Studio during project design only.

When you create a runtime deployment package for the project, the dynamic assembly created for the project contains all of the required component assemblies.

 

Creating Script Methods - Overview

To create Script methods, open the Script Constructs window. You can open this dialog by:

For more information, see Using the Script Component.

 

Script Component Properties, Methods, and Events

The properties, methods, and events specific to the Script component follow. For information on properties, methods and events common to all Studio components, see General Component Properties, Methods, and Events.

 

Properties

Property

Description

CodeConstructs

Use this property to open the Script Constructs dialog for creating custom methods using C#. A script can contain multiple methods. For more information, see Script Constructs.

Errors

If a method fails validation, messages describing the error display in this property.

References

Use this property to open the Script References dialog for specifying any external assemblies that the methods will require. Add the assembly/assemblies using this property before editing the script and using the references in the Script methods. You can add assemblies from:

  • Studio application folder

  • GAC assemblies

  • Dynamic assemblies (created when certain Studio components, such as Expressions, are used)

Note: You can also set the Script References by right-clicking on the Script component and selecting Edit References.

Valid

Displays a value of True or False indicating whether the syntax of the methods is accepted by Studio.

 

Methods

Method

Description

Parameters

Result Type

Method Name

 

When you create a method using the CodeConstructs property, it is displayed in Object Explorer to use in the automation along with the input and output parameters defined in the code. This name can contain spaces.

As required by Script method

As specified by Script method

 

Related information

Using the Script Component

 


Privacy | Trademarks | Terms of Use | Feedback

Updated: 18 June 2020

© 2016 - 2020 Pegasystems Inc.  Cambridge, MA All rights reserved.

 

OpenSpan data classification label