SDK: Default Parameters and Custom Editors (Basic)
  • 16 Aug 2021
  • 1 Minute to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

SDK: Default Parameters and Custom Editors (Basic)

  • Dark
    Light

Article summary

Overview

When creating simple steps by registering public methods, default values can be set for the inputs of those methods. This allows Designers to change these input values but populate the inputs with default values when the step is first used.

Custom codes are located at C:\Program Files\Decisions\Decisions Services Manager\Instances\Control\CustomReferences
Decisions has a Public GitHub Repository with various SDK examples available.

Example

The following code example demonstrates how to write a step to upload a file to an FTP server and having the server address and server port populated by default. 

Below is the code example of the method with the options parameters with the default inputs.

When a user first places this step in a Flow, the serverAddress and serverPort inputs will be populated.


public void FtpUpload(string username, string password, string serverAddress = "myftpserver.com", int serverPort = 21)
{
//upload files to ftp site
}


Custom editors can also be supplied on property values in the same manner.


public static void CreateUserAdvanced(
string ouPath,
string loginName,
[PasswordText]
string userPassword,
string email,
string firstName,
string lastName,
string department,
[PropertyClassification(0, INPUT_NAME_SYSTEM_USER_NAME, PROPERTY_NODE_ROOT, PROPERTY_NODE_LDAP_SETTINGS)]
string systemUserName,
[PasswordText]
[PropertyClassification(1, INPUT_NAME_SYSTEM_PASSWORD, PROPERTY_NODE_ROOT, PROPERTY_NODE_LDAP_SETTINGS)]
string systemPassword,
[PropertyClassification(2, INPUT_NAME_LDAP_SERVER_ADDRESS, PROPERTY_NODE_ROOT, PROPERTY_NODE_LDAP_SETTINGS)]
string ldapServerAddress)



Was this article helpful?