-
Notifications
You must be signed in to change notification settings - Fork 2
Usage
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.
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.
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.
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.
-
Open the Windows menu and start typing "Task Scheduler".
-
Open the Task Scheduler icon.
-
If prompted, type the administrator’s password or click Continue. The Task Scheduler window appears.
-
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.
-
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.
-
Richt-click on any folder and select "Create Task". You will be presented with a dialog with several tabs.
-
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.
-
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.
-
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 inC:\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 theD:\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.
- Concepts
- Features
- Transform Engine
- Quick Start
- Configuration
- Secrets Vault
-
Readers
- List of Readers
- Custom Readers
-
Writers
- List of Writers
- Custom Writers
-
Filters
- Accept
- Reject
- Custom Filters
-
Tasks
- List of Tasks
- Custom Tasks
-
Validators
- List of Validators
- Custom Validators
-
Listeners
- List of Listeners
- Custom Listeners
-
Transforms
- List of Transforms
- Custom Transforms
- Mappers
- Context
- Databases
- Templates
- Logging
- Encryption
- Usage
- Expressions
- Examples