You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Prerequisites on Linux

  1. You have to install a 32Bit Perl
  2. Create 2 symlinks in the ./lib directory of the JobScheduler installation
    1. The first symlink with the name libperl.so have to point to the libperl.so of the 32Bit Perl installation
    2. The second symlink with the name libsosperlscript.so have to point to the ./lib/libsosperlscript.<perl-version>.so.

In the ./lib directory of the JobScheduler installation you find the following libsosperlscript.<perl-version>.so.

  • libsosperlscript.5.10.0.so
  • libsosperlscript.5.12.0.so
  • libsosperlscript.5.14.0.so
  • libsosperlscript.5.8.0.so
  • libsosperlscript.5.8.6.so
  • libsosperlscript.5.8.7.so
  • libsosperlscript.5.8.8.so

For example you have a Perl installation with version 5.12.3 and the 32Bit libraries are located in /usr/lib/perl5.
Then go to the ./lib directory of the JobScheduler installation and create the following symlinks:

 > ln -s /usr/lib/perl5/5.12.3/i586-linux-thread-multi/CORE/libperl.so libperl.so
 > ln -s libsosperlscript.5.12.0.so libsosperlscript.so

Job Example

Now you can test the JobScheduler-Perl-API with e.g. the following job.

<job>
	<script language="perlScript">
	<![CDATA[
		sub spooler_init \{
    			my $rc = 1;
    
    			$spooler_log->info("spooler_init");  
    
    			return $rc;
  		\}
  			
  			
  		sub spooler_process \{
    			my $rc = 1;
    
    			$spooler_log->info("spooler_process");
    			$spooler_log->info($spooler_job->name . " is running"); 

    			return signal_return($rc);
  		\}
  			
  			
  		sub spooler_exit \{
     
     			$spooler_log->info("spooler_exit"); 

  		\}
  			
  			
  		###################################################
  		# This method provides that the method   
  		# spooler_process is called only for one time.
  		#
  		# Standalone Jobs: 
  		# JobScheduler continues calling the spooler_process 
  		# method until it returns 0.
  		#  
  		# Order Jobs in a Job Chain: 
  		# The Order acquires the next node in the Job Chain 
  		# if spooler_process returns 1
  		# and the error node if spooler_process returns 0
  		#
  		# see http://www.sos-berlin.com/doc/en/scheduler.doc/api/Job_impl-perl.xml#method__spooler_process
  		###################################################
  		sub signal_return \{
    			my ($rc) = @_;
    			if(defined($spooler_task->order)) \{ #is an Order Job
    	 			return $rc;
    			\}
    			return 0;
  		\}
  			
        ]]>
	</script>
	<run_time/>
</job>

For more information about the JobScheduler API look at http://www.sos-berlin.com/doc/en/scheduler.doc/api/api-perl.xml

  • No labels