Skip to content
Steve Cote edited this page Sep 11, 2019 · 2 revisions

Command Line

The toolkit comes with a loader which allows you to make calls similar to the following:

java -jar CoyoteDX-X.X.jar engine.json

This will load and run the default transformation engine with the configuration specified in the engine.json file.

Loader Configuration

It is possible to use a properties file to load additional system properties into the runtime. The cdx.properties file will load data into the system properties for your component to use at runtime.

The Loader will check several locations for the file and each time it is found it is loaded and overrides any previously set system properties.

Code

It is possible to use the engine programmatically:

// Get the reference to the file which contains our transformation engine 
// configuration
File cfgFile = new File( "engine.json" );

if ( cfgFile.exists() && cfgFile.canRead() ) {

  // have the Engine Factory create a transformation engine based on the
  // configuration in the file
  TransformEngine transform = TransformEngineFactory.getInstance( cfgFile );

  // run the transformation 
  try {
    transform.run();
  } catch ( Exception e ) {
    log.error( "Problems running batch job: {}", e.getMessage() );
  } finally {
    try {
      transform.close();
    } catch ( IOException e ) {
      log.error( "Problems closing batch job: {}", e.getMessage() );
    }
  }
} else {
  System.err.println( "Cannot read " + cfgFile.getAbsolutePath() );
}

The above example passes a file reference to the TransformEngineFactory, but it also supports a String argument which contains the JSON configuration for the engine.

Windows Task Scheduler

One of the most common use cases is to call a CoyoteDX job from a scheduler such as cron or at on *nix systems but Windows users most often use the Windows Task Scheduler.

  1. Open the Windows menu and start typing "Task Scheduler".

  2. Open the Task Scheduler icon.

  3. If prompted, type the administrator’s password or click Continue. The Task Scheduler window appears.

  4. On the left side, select the top item, Task Scheduler (Local). You see the Task Scheduler Summary. It provides a review of your tasks, including which tasks have run and which are active.

  5. On the left side, choose Task Scheduler Library. Tasks are organized into folders. The Task Scheduler Library folder is the “root folder” for all tasks. Additional tasks in the Task Scheduler window are organized by the owner. You can create new folders by right-clicking in any folder and selecting "New Folder"; it is a good way to organize your tasks.

  6. Richt-click on any folder and select "Create Task". You will be presented with a dialog with several tabs.

  7. In the "General" tab, enter the name and optional description of the task. In the "Security options" panel select which options are best for your job. There are many things to consider when configuring this section so you will have to research which is best for your task.

  8. Select the "Triggers" tab and press the "New" button. Choose the best option for your task. Again, the options are varied and beyond the scope of this simple guide.

  9. Select the "Actions" tab and press the "New" button. Adding a new action involves choosing "Start a program" from the "Action:" dropdown box, and the complete path to the cdx.bat file. For example: C:\Users\Bob\Tools\coyotedx\bin\cdx.bat assumes the CoyoteDX program was installed in C:\Users\Bob\Tools\coyotedx.

  • Next, add the arguments like you would from the command line in the "Add arguments (optional):" text box. For example: -owd D:\altcoin\PoloniexScanner.json tells CoyoteDX to override the working directory (-owd) and run the job configuration in the D:\altcoin\PoloniexScanner.json file. Any and all command-line arguments are placed in the arguments text box; it is not really optional.

  • You can place the name of the working directory in the "Start in (optional):" text box. This will run the job from that directory. Since we specified -owd in the command line above, the working directory for the job will be that given directory

  • Press the "OK" button.

You can experiment with configuring the other tabs, but the above is the basic procedure.

Many/most jobs run "On a schedule", as a particular user, whether the user is logged-in or not. The trigger is usually run "Daily", often repeated every few minutes/hours for a duration of "indefinitely". But these are for basic polling/integration jobs. Your tasks may be different.

Home

  1. Concepts
  2. Features
  3. Transform Engine
  4. Quick Start
  5. Configuration
  6. Secrets Vault
  7. Readers
  8. Writers
    • List of Writers
    • Custom Writers
  9. Filters
    • Accept
    • Reject
    • Custom Filters
  10. Tasks
    • List of Tasks
    • Custom Tasks
  11. Validators
    • List of Validators
    • Custom Validators
  12. Listeners
    • List of Listeners
    • Custom Listeners
  13. Transforms
    • List of Transforms
    • Custom Transforms
  14. Mappers
  15. Context
  16. Databases
  17. Templates
  18. Logging
  19. Encryption
  20. Usage
  21. Expressions
  22. Examples
Clone this wiki locally