The RunMyJobs Registy is the place to be to store environment-specific settings. The Registy can be used to store the name of the environment or an username to connect to an application database. Registry Key and associated values can be set through the GUI of RunMyJobs. These values can be read with RedwoodScript.
Below is example to read the value of the key DatabaseCredentials. This value is store in the key /Configuration/Oracle. From the Configuration level, additional custom made Registry Key can be created. The Registry Key type is always String. The components of the Full Path of a Registry Key are separated by "/". It is better to use the constant RegistryEntry.PATH_SEPARATOR to be sure the right separator is used. Use the following RedwoodScript ro read this value:
{ String res ; String key = RegistryEntry.PATH_SEPARATOR + "configuration" + RegistryEntry.PATH_SEPARATOR ; key = key + "Oracle" + RegistryEntry.PATH_SEPARATOR + "DatabaseCredential" ; RegistryEntry databaseCredential = jcsSession.getRegistryEntryByPath(key); if(databaseCredential!=null) { jcsOut.println("Found Credential: " + databaseCredential.getValue() ) ; }