Process Designer Scripting API
We have provided a short collection of script fragments to take a look at and copy and paste to serve as starting points or fragments of your own scripts.
The Visual Process Designer Scripting API expose the following members:
-
AddEvent: Adds any text to the log (for informational or auditing purposes).
-
AddInput: Adds an input item to the process.
-
AddOutput: Adds an output item to the items for the specified export.
-
AddPassword: Adds a script password.
-
AddRuntimeFieldValue: Sets the value for a runtime field. This value will be used, if called for, by subsequent exports.
-
AddVariable: Adds a variable to the script.
-
ClearPasswords: Clears all script passwords.
-
ClearRuntimeFieldValues: Clears values for runtime fields.
-
ExpandMacros: Expands macros in a given string, in the context of the entire log.
-
GetEvents: Gets the list of events for the log item specified by name.
-
GetExports: Gets the list of process export names.
-
GetInputs: Gets the list of input items.
-
GetOutputRowCount: Gets the row count of Report, Table, Summary, or DataPrep export by export element name; by export element name and location; or by export element name, location, and table name.
-
GetOutputs: Gets the list of output items for a process.
-
GetOutputs (string): Gets the list of output items for a specified process export.
-
GetOutputTableNames: Gets the table names of Report, Table, Summary, or DataPrep export by location.
-
GetPassword: Gets the list of script passwords.
-
GetProcessName: Returns the name of the process.
-
GetRuntimeFieldValue: Returns the current value, if any, for a given runtime field name.
-
GetTrackingId: Gets the tracking ID of the current log.
-
GetVariable: Gets the list of script variables.
-
HasPassword: Returns “true” if the password as added using the AddPassword method
-
HasRuntimeFieldValue: Returns true if a value has already been set for a given runtime field name.
-
RiseAlert: Rise process or global alert by name with a specified message.
Here are some specific examples.
API.AddInput Method
Adds an input item to the process.
Syntax: void AddInput(string fileName)
Parameters:
fileName
Type: System.String
Path to the input file.
API.AddOutput Method
Adds an output item to the items for the specified export.
Syntax: void AddOutput(string exportName, string location)
Parameters:
exportName
Type: System.String
Name of process export.
location
Type: System.String
Path to the output file.
API.AddRuntimeFieldValue Method
Adds an output item to the items for the specified export.
Syntax: void AddRuntimeFieldValue(string fieldName, string fieldValue)
Parameters:
fieldName
Type: System.String
Name of runtime field.
fieldValue
Type: System.String
Value of runtime field.
API.ClearRuntimeFieldValues Method
Clears values for runtime fields.
Syntax: void ClearRuntimeFieldValues()
API.GetExports Method
Gets the list of process export names.
Syntax: IList<string> GetExports()
Return Value:
Type: StringCollection
A StringCollection containing the process export names.
API.GetInputs Method
Gets the list of input items.
Syntax: IList<string> GetInputs()
Return Value:
Type: StringCollection
A StringCollection containing the process inputs.
API.GetProcessName Method
Returns the name of the process.
Syntax: string GetProcessName()
Return Value:
Type: String
The name of the process.
API.GetOutputs Method
Gets the list of output items for a process.
Syntax: IList<string> GetOutputs()
Return Value:
Type: StringCollection
A StringCollection containing the process outputs.
API.GetOutputs Method
Gets the list of output items for a specified process export.
Syntax: IList<string> GetOutputs(string exportName)
Parameters:
exportName
Type: System.String
Name of process export.
Return Value:
Type: StringCollection
A StringCollection containing the outputs of the process export.
API.GetRuntimeFieldValue Method
Returns the current value, if any, for a given runtime field name.
Syntax: string GetRuntimeFieldValue(string fieldName)
Parameters:
fieldname
Type: System.String
Name of runtime field.
Return Value:
Type: String
Value for the specified runtime field or empty string.
API.HasRuntimeFieldValue Method
Returns true if a value has already been set for a given runtime field name.
Syntax: bool HasRuntimeFieldValue(string fieldName)
Parameters:
fieldname
Type: System.String
Name of runtime field.
Return Value:
Type: Boolead
True if this field has a value already set