Importing Objects

There are several ways to import a CAR file that has been exported from a different RunMyJobs instance.

Note: To import an object, you must have sufficient privileges to create the object you are importing. In addition, if the App_Administrator global privilege has been enabled, you must have that global privilege.

Note: When you import Process Definitions, scheduled processes keep their existing start time. Running and completed Process Definitions are scheduled to run immediately.

Note: Because Import processes are initiated from outside your RunMyJobs instances, you must configure the /configuration/import/RunAsUser Registry key (Configuration > Registry) to specify the name of a user with sufficient privileges to create the objects to be imported.

Importing a CAR File Directly

To import a CAR file directly with the import wizard:

  1. Navigate to Promotion > Imports.

  2. Click .

  3. In the Select CAR file screen of the Submit Import Wizard pop-up window, click Browse and select the CAR file.

  4. In the Import Rule Set screen, do one of the following things:

    • If you want to use an Import Rule Set, click Use Import Rule Set field and select the Import Rule Set in the corresponding field. If you don't want to use an Import Rule Set, you can select this option and leave the field blank.

    • If you want to import all objects into a particular partition, click Import all objects into Partition and specify the target partition. This field is enabled if there is at least one partition which either has no source Remote System object, or the source Remote System object matches the source of the CAR file and allows its Import Rule Set to be overridden. Note that this option creates a temporary Import Rule Set that is used to set the partition of all imported objects. If your CAR file contains objects that must reside in the GLOBAL partition (for example, objects that use the System_Defaults_System Process Definition), the import will fail.

    • If you want to use the Remote System object's Import Rule Set, click Use Remote System Import Set. This control is enabled if there is at least one source Remote System object that matches the source RunMyJobs instance identified in the CAR file's <source-system> element. Multiple entries will be available if (a) there is more than one Remote System object in this RunMyJobs instance with a name that matches the name of the Remote System object in the CAR file, and (b) the Remote System objects specify different Import Rule Sets and at least one does not allow its Rule Set to be overridden.

    • If you want to use an embedded Import Rule Set, click Use embedded Import Rule Set with Target Partition and specify the target partition. This control is enabled only if the CAR file contains an Import Rule Set and no matching source Remote System object exists, or the matching source Remote System object allows its Import Rule Set to be overridden.

  5. In the Import Action Parameters screen, specify any action parameters you want to use.

  6. In the Import Details screen, follow this procedure:

    • Optionally, enter a Description and Documentation.

    • Select a Requested Start Time and time zone.

    • To do a test import, check Test Mode.

    • To invalidate the import process if any of the Source code does not compile, occurs, check Invalidate on Error.

  7. Click Submit.

Notes

The import wizard enables and/or disables certain fields in the Import Rule Set tab according to settings in your Remote System objects. This allows you to control which CAR files can be imported, and which partitions they can be imported into. Note that the System_Import_Archive Process Definition only allows you to specify an Import Rule Set; no checks are done at submit time.

The import wizard will enable the Use Import Rule Set field if either of the following is the case:

  • There is no source Remote System object in the GLOBAL partition that matches the Remote System object specified in the CAR file.
  • The matching source Remote System object in the GLOBAL partition allows its Import Rule Set to be overridden.

Importing a CAR File with System_Import_Archive

To import a CAR file using the System_Import_Archive Process Definition:

  1. Copy the CAR file to a server or web server and note its path or URL. For more information, see "Syntax for CAR File Paths and URLs", below.
  2. Navigate to Definitions > Processes.
  3. Right-click System_Import_Archive, and choose Submit from the context menu.
  4. Enter the path or URL of the CAR file.
  5. Click Submit.

Syntax for CAR File Paths and URLs

For a file on a file server, use the following syntax.

  • Native (local, NFS, SMB share): C:/car/import.car or C:\\car\\import.car on Windows and /opt/car/import.car on UNIX.
  • UNC: \\\\samba.example.com\\shared\\car\\import.car or //samba.example.com/shared/car/import.car. The central Redwood Server must reside on Windows.
  • JobFile expression: JobFile:<process_ID>:<shortname>
    • <process_ID>: The ID of the process that has the CAR file as an output file.
    • <shortname>: The short name of the process output file. The short name of a CAR file that has been imported with System_Import_Archive will be carin.car.

For a file on a web server, use the following URL syntax.

  • File: file://C:/car/import.car, or file:///opt/car/import.car. Note the three forward slashes on UNIX.
  • UNC: file:////samba.example.com/shared/car/import.car. Note the four forward slashes. The central RunMyJobs server must reside on Windows. Redwood recommends using the File on server field, because this lets you browse to the file and avoid path typos.
    • ftp[s]://: Anonymous or with the username and password specified in the URL (for example: ftp://jdoe:secret@ftp.example.com/pub/car/import.car). If your client is running on macOS or UNIX, Redwood recommends browsing to the file to avoid typos. If you are using FTPS, the Redwood server must trust your FTPS certificate.
    • http[s]://: http://share.example.com/car/import.car. You may encode the username/password in the URL, depending on the web server. If you are using HTTPS, the Redwood server must trust the HTTPS certificate.

Note: The user the JEE server runs as needs to have access to the share. If the central RunMyJobs server is running on Windows, ensure it is not running under local System account (NT Authority\System), because that user has no access to network shares.

Note: Microsoft Windows accepts forward slashes (/) instead of backslash (\) in paths as long as the command used with the path does not use old-style parameters like /?. Since backslash is a special character in many programming languages, Redwood strongly recommends the use of the forward slash over the backslash when you are not programming in Windows Command (CMD) / Batch (BAT).

Note: When you use FTP or HTTP with authentication, the password is sent in clear text over the network.

Importing CAR Files with apitool.jar

To import a CAR file with apitool.jar, you must have:

  • Java 1.8 or higher JVM

  • Unlimited strength Java Cryptography Extension (JCE) if your server uses TLS and/or SSL.

Note: TLS options can be set using JVM specific system properties.

You can import a CAR file with a command like the following:

java -jar api-tool.jar import <connection_file> <CAR> [-targetpartition <Partition>] [<ImportRuleSet>]

In the above command, the values are as follows.

  • <connection_file>: A file created using jsecret -c <connection_file> <server>.

  • <CAR>: The CAR file to import.

  • <Partition>: The optional target partition for imported objects.

  • <ImportRuleSet>: The optional Import Rule Set to use for import.

  • -targetpartition <partition>: Here, <partition> is a name of the partition to be assigned to all objects in the CAR file. Note that some objects, such as the library Custom and System_Defaults_System, must reside in the GLOBAL partition. The import will fail if you attempt to import objects that must be in the GLOBAL partition with the -targetpartition switch set to any other partition.

Tip: You can use JVM parameters for any other options.

Below are some samples of what apitool.jar imports might look like.

jsecret -c ./example.conn https://dublin.runmyjobs.cloud/redwood-example/dev
username:
password:

java -jar api-tool.jar import ./example.conn example.car

java -jar api-tool.jar import ./example.conn c:\Promotion\Application_GL_Accounting.car -targetpartition FIN_EMEA FIN_EMEA.QA2Prod

java -jar api-tool.jar import ./example.conn c:\Promotion\Application_GL_Accounting.car -targetpartition FIN_EMEA

java -jar api-tool.jar import ./example.conn /tmp/Application_GL_Accounting.car FIN_EMEA.QA2Prodh

Importing CAR files with cURL

You can use cURL to PUT a CAR file on a server like so:

https://<server>/<context>/api-rest/car

or

https://<region>.{runmyjobs,runmyfinance}.cloud/<company>/<environment>/api-rest/car

Note: This operation requires a basic Authorization header.

The URL might differ depending on whether you are using an on-premises instance of RunMyJobs or a SaaS instance.

  • On-premises: https://<server>/<context>/api-rest/car: Here, <server> is the FQDN of your server,
  • SaaS: https://<region>.{runmyjobs,runmyfinance}.cloud/<company>/<environment>/api-rest/car: Here, <region> is the region of your cloud instance (for example dublin, runmyfinance or runmyjobs), <company> is your company name, and <environment> the environment you want to use.

Below is an example of importing a CAR file using cURL.

EncodedSecret="$(jecho -base64 "admin:admin")"
Authoriation="Authorization: Basic $EncodedSecret"
ContentType="Content-Type: application/octet-stream"

curl -H "$Authorization" -H $ContentType" -X PUT --data-binary "@example.car" https://s1.example.com/redwood/api-rest/car