Skip to content
Snippets Groups Projects
Commit b375d8b7 authored by Armin Costa's avatar Armin Costa
Browse files

Update Plugins.md

parent ada08f14
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,7 @@ public interface GenericTaskInterface { ...@@ -20,7 +20,7 @@ public interface GenericTaskInterface {
* @param entity_name Name of executing entity (Task, Consumer, etc.) * @param entity_name Name of executing entity (Task, Consumer, etc.)
* @param parameters Parameters as defined by <Parameter> * @param parameters Parameters as defined by <Parameter>
* @param args List of arguments of the Task (String or Hashtables, to be checked by the plugin) * @param args List of arguments of the Task (String or Hashtables, to be checked by the plugin)
* @param files List of files of the Task iff <FileType>regexp</FileType> is defined, else null * @param files List of files of the Task IFF <FileType>regexp</FileType> is defined, else null
* @return ExitCodes * @return ExitCodes
*/ */
public int process(String basepath, String aoi_name, public int process(String basepath, String aoi_name,
...@@ -64,6 +64,52 @@ Note: Note: args[0] is the class name ...@@ -64,6 +64,52 @@ Note: Note: args[0] is the class name
If a given *Task* is implemented with a scripting language (*Perl*, *Python*, *Shell*), the script must consider the following input parameters: If a given *Task* is implemented with a scripting language (*Perl*, *Python*, *Shell*), the script must consider the following input parameters:
``` ```
[BASE_PATH] [AOI] [PROCESSOR] [Parameter_1] [Parameter_N] ... [$FILE*] [BASE_PATH] [AOI] [PROCESSOR] [Parameter_1] [Parameter_N] ... [$FILE*]
``` ```
IFF a *FileType* filtering is defined for the *Task*, the last parameter, defined above as $FILE, is the filename of the 1st file filtered by the Task execution.
In this case the script will be executed N times, for each file filtered by the FileType regular expression.
Example:
```perl
#!/usr/bin/perl -w
# This script is part of a Task collection available for the DES (Data Exchange Server)
# usage: testPerl.pl [base_path] [aoi] [procesosr_name] [CWD]
#main
print "running testPerl.pl\n";
my $base_path = "null";
my $aoi = "null";
my $processor_name = "null";
my $working_dir = "null";
print scalar(@ARGV);
print " ";
print "Parameters: @ARGV\n";
if(scalar(@ARGV) < 4){
print "missing arguments!\n";
print "usage: testPerl.pl [base_path] [aoi] [procesosr_name] [CWD]\n";
exit -1;
}else{
$base_path = $ARGV[0];
$aoi = $ARGV[1];
$processor_name = $ARGV[2];
$working_dir = $ARGV[3];
print "base_path: $base_path, aoi: $aoi, processor_name: $processor_name, CWD: $working_dir\n";
exit 0;
}
```
The *Task* definition for the script above is:
```xml
<Task name="testExitCode" type="cmd" active="yes" priority="NORM">
<EMail>mail@host.yourdomain</EMail>
<NotifyEmail>false</NotifyEmail>
<Command>perl</Command>
<Parameter>./test_data/scripts/testPerlExitCode.pl</Parameter>
<Parameter>0</Parameter>
</Task>
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment