Redwood Documentation

Product Documentation

 

›RedwoodScript

RunMyJobsRedwoodScript Development

Developing Applications

  • Developing Applications

RedwoodScript

  • RedwoodScript
  • Scripting in the Shell
  • Mixing REL and RS Code in a Library
  • Controlling Process Servers with RedwoodScript
  • Controlling Queues with RedwoodScript
  • Managing Applications with RedwoodScript
  • Substitution Parameters
  • Date Formatting and Parsing
  • Impact of Modified Process Definitions or Chain Definitions on Processes and Chains
  • Using the RedwoodScript Definition Type
  • Using RedwoodScript in Processes
  • Using Eclipse to Create and Edit Process Definitions

Debugging Your Code

  • Changing Process Logging Levels

Triggering Custom Code

  • Triggering Custom Code
  • Using Triggers
  • Trigger and Action Examples
  • Using Actions
  • Executing Your Own Classes from a Library
  • Library Examples
  • Extending Redwood Server Functionality with Extension Points
  • Extending Edit Pages with ObjectPageExtensionPoint
  • Creating Extension Points
  • Extending Redwood Server Functionality with Extension Points

Using Tables

  • Using Tables to Store Frequently Used Values

PL/SQL API

  • Cronacle PL/SQL API Module
  • Creating the OracleJob Process Server
  • Using the OracleJob Definition Type
  • Packages
  • RS/JCS Views

Tuning Redwood Platform

  • Tuning Redwood Platform

Memory Tuning

  • Tuning Memory Usage and Garbage Collection

Reference

  • Using SQL to Query the Data Model
  • Embed Redwood Server Overviews into Extension Points with the Embed API
  • API Documentation
  • Script Date Formats
  • Datamodel
  • Redwood Expression Language Functions and Implicit Objects
  • RedwoodScript Scripting Contexts and Implicit Objects
← RedwoodScriptMixing REL and RS Code in a Library →

Scripting in the Shell

The Shell allows you to access the Repository directly with a scripting language. You can use it to automate repetitive tasks, for example, submit 10 processes. It can also be used to write or debug your RedwoodScript or Redwood Expression Language code as well.

RedwoodScript Version

By default, RedwoodScript is based on Java 11; you set the /configuration/javatoolkit/SourceVersion and /configuration/javatoolkit/TargetVersionregistry entries to your desired version and can use all the features of the version you specify.

Setting Locales

By default, the scripting locale is set to English, you can change it to German, for example, using the following code:

importPackage(java.util);

jcsSession.setLocale(Locale.GERMAN);


Setting the Return Code

The jcsShell.setReturnCode(int) method is used to set the return code of the script. You throw an exception if you want to terminate processing; the last effective call to jcsShell.setReturnCode() will set the return code. This is used by the api-tool.jar and jtool script.

Procedure

  1. Navigate to "Scripting > Shell".
  2. Enter your code in the lower pane.
  3. Choose Submit Command.
  4. The result of your code will be printed in the upper pane.
  5. Close the tab when you are finished.

Example

To submit one process without parameters, you could use the following code:

{
  // Get the JobDefinition object
  JobDefinition jDefinition = jcsSession.getJobDefinitionByName("System_Sleep");

  // Create a process object
  Job process = jDefinition.prepare();

  // To submit the process, you need to commit changes to the database
  jcsSession.persist();
}


To submit 10 processes without setting any parameters, you could use the following code:

{
  // Get the JobDefinition object
  JobDefinition jDefinition = jcsSession.getJobDefinitionByName("System_Sleep");

  for (int i = 0; i < 10; i++)
  {
    // Create a process object
    jDefinition.prepare();
  }

  // To submit the processes, you need to commit changes to the database
  jcsSession.persist();
}


See Also

  • RedwoodScript in Processes
  • RedwoodScript in Queues
  • RedwoodScript in Process Servers
← RedwoodScriptMixing REL and RS Code in a Library →
  • RedwoodScript Version
  • Setting Locales
  • Setting the Return Code
  • Procedure
  • Example
  • See Also
Docs
Getting StartedInstallationFinance InstallationConcepts
TroubleshootingArchiving
Learn and Connect
Support Portal
BlogEventsResources
ISO/ IEC 27001 Information Security Management
Automate to be human

2023 All Rights Reserved |

Terms of Service | Policies | Cookies | Glossary | Third-party Software | Contact | Copyright | Impressum |