Eclipse Integration

You can use Eclipse to create, import, edit, and export Process Definitions that use the RedwoodScript Definition Type. You can import the following types of objects.

There are two ways to import and export objects in Eclipse.

  • Connect directly to the RunMyJobs server from Eclipse.

  • Import and export can export objects as CAR files.

Note: You cannot install CAR files exported from Eclipse by double-clicking them. You must use the Promotion Module.

Editing Code

You can find RedwoodScript objects at the following locations in Eclipse.

  • RedwoodScript Process Definitions and trigger objects are located under <project>/src/java/<partition>/com.redwood.scheduler.custom/<object_type>_<name>.java/<object_type>_<name>/execute().

  • Process Definition actions are located under <project>/src/java/<partition>/com.redwood.scheduler.custom/<object_type>_<name><action_type>.java/<object_type>_<name><action_type>/execute().

  • Stub code for Process Definitions and trigger objects is located under <project>/src/stub/<partition>/com.redwood.scheduler.custom/<object_type>_<name>[<action_name>].java/<object_type>_<name>[<action_name>]//{<child_classes>/<java_objects>|<java_objects>}.

  • Libraries are located under <project>/src/library/<partition>/Custom_<name_suffix>/java/com.redwood.scheduler.custom/<class_name>.java/<class_names>/{<child_classes>/<java_objects>|<java_objects>}.

  • Objects (including their XML representations) are also available under <project>/src/.

To edit RedwoodScript code of trigger GLOBAL.TriggerTest imported into project Example, for example, navigate to Example/src/java/GLOBAL/com.redwood.scheduler.custom/Trigger_TriggerTest.java/Trigger_TriggerTest and see the execute() method.

Note: Stub code is generated and not exported. All changes should be made to the code at <project>/src/java/<partition>/.. The only exception is if you want to add or remove Process Definition parameters or edit the XML. The XML must be adapted for Process Definition parameters, and new parameters must also be declared in the stub code.

Note: Due to the complexity of XML, Redwood strongly recommends you create parameters in the central Redwood Server if you are not experienced with XML syntax.

Note: If you remove parameters from the XML, make sure you remove or adapt any constraints using the parameters in the XML and remove the parameter declarations from the stub.

Tip: You can view the JavaDocs for RedwoodScript here.

Prerequisites

To install and use the Eclipse plug-in, you need the following.

  • The full URL of your RunMyJobs instance (if you want to connect to it directly from Eclipse).
  • The credentials of a user with sufficient privileges to View and Edit the objects you intend to import, and sufficient privileges to import and export objects.
  • Eclipse version Juno 4.2 or higher.

Installing and Configuring the Plugin

Note: The following instructions are for Eclipse 2023-09. If you use a different version, the procedure may differ slightly.

To install the RunMyJobs plugin for Eclipse, follow this procedure.

  1. Launch Eclipse.
  2. Navigate to File > New > Project and select Java Project and choose Next.
  3. Enter a project name and choose Finish.
  4. Navigate to Help > Install New Software and enter your RunMyJobs server URL with /eclipse appended to the end in the Work with field.

    • on-site-related topic - http[s]://<server>:<port>/redwood/eclipse. For example: http://rw.example.com:10180/redwood/eclipse
    • cloud-related topic - https://<environment_url>/eclipse. For example: https://dublin.runmyjobs.cloud/example-inc/test/eclipse
  5. Click Add to add the repository to your Eclipse configuration.
  6. Enter a name for the repository in the Name field and enter the URL mentioned above in the Location field, then click Add. A checkbox named Scheduler should display.
  7. Select the Scheduler check box and then click Next.
  8. Click Finish.

    Note: At this point you may be asked to trust some certificates. If this is this case, select the certificate and click Ok.

  9. Restart Eclipse.

If you are in a SaaS environment and want to make a direct connection to the RunMyJobs server, also follow this procedure.

  1. Navigate to Window > Preferences and select Scheduler in the list on the left.
  2. Click Add to add a Scheduler connection.
  3. Enter a Name.
  4. Select Connect to RunMyJobs.
  5. Enter the URL of your RunMyJobs instance (for example: http://pr1.example.com:53000/redwood).
  6. Enter your RunMyJobs Username and Password.
  7. Right-click the project icon in Eclipse and choose Scheduler from the context menu.
  8. Check Scheduler project.
  9. Choose a scheduler from the Scheduler dropdown list and a version from the Version dropdown list.
  10. Click OK.

Importing Objects

To import objects from an SaaS instance of RunMyJobs, follow this procedure.

  1. Right-click your Eclipse project icon and choose Import from the context menu.
  2. Expand Scheduler and select Scheduler Files.
  3. Click Next.
  4. In the Import Scheduler files window, do one of the following things.
    • To import from a SaaS instance of RunMyJobs, select Server and choose the RunMyJobs instance from the corresponding dropdown list.
    • To import from a CAR file, select CAR file, click Browse, and select the CAR file containing the objects you want to import.
  5. In the Matching items area, select the objects you want to import. If the list of objects is long, you narrow it down by typing the first few characters of an object name in the Select an item to open field.
  6. Click Finish.

Note: If you have already imported and modified any of the objects you are importing, you can select whether to overwrite the existing objects or keep both versions. If you decide to keep both, imported objects are given a .new suffix.

Exporting Objects

To export modified objects from Eclipse, follow this procedure.

  1. Right-click the project icon and choose Export from the context menu.
  2. Expand Scheduler, select Scheduler Files, and then click Next.
  3. Do one of the following things.
    • To export the objects directly to your RunMyJobs instance, select Server and choose the instance from the corresponding dropdown list.
    • To export the objects to a CAR file, select CAR file and then specify a name and location.
  4. Click Finish.