inzh / talend-job-manager
Tool for manage and run Talend job
v1.0.0
2022-04-10 00:00 UTC
Requires
- php: >=5.6
- ext-mbstring: *
- ext-zip: *
README
A tool for manage Talend job (zip format) for your application.
Installation
You can install this lib in your PHP project using composer:
composer require inzh/talend-job-manager
Build your job
On first, you need to build your job with Talend, tested with Talend Open Studio.
Just right click on your job and select in menu:
File output example:
myjobname_0.1.zip
Development:
You can use directly executor class in your code, for example:
- For add or update job in repository
use inzh\talend\job\manager\executor\SimpleJobExecutor; $path = "myjobname_0.1.zip"; // Your job zip file $repositoryPath = "jobs"; // Your repository path SimpleJobExecutor::put($path, $repositoryPath);
- To run the latest version of job :
use inzh\talend\job\manager\executor\SimpleJobExecutor; $jobName = "myjobname"; // Your job name $repositoryPath = "jobs"; // Your repository path $parameters = ["contextparam1" => "value1", "contextparam2" => "value2"]; // Context parameters passed to job $output = SimpleJobExecutor::execute($jobName, $parameters, $repositoryPath); print_r($output);
- To run the specific version of job :
use inzh\talend\job\manager\executor\SimpleJobExecutor; $jobName = "myjobname"; // Your job name $repositoryPath = "jobs"; // Your repository path $parameters = ["contextparam1" => "value1", "contextparam2" => "value2"]; // Context parameters passed to job $version = 0.1; $output = SimpleJobExecutor::execute($jobName, $parameters, $repositoryPath, $version); print_r($output);