Uploaded image for project: 'JITL - JobScheduler Integrated Template Library'
  1. JITL - JobScheduler Integrated Template Library
  2. JITL-733

Extend Job API to execute JVM Jobs (JITL, Java)

    XMLWordPrintable

Details

    • Feature
    • Status: Released (View Workflow)
    • Medium
    • Resolution: Fixed
    • None
    • 2.5.7, 2.6.4
    • None

    Description

      Current Situation

      • Users can add JVM jobs of type JITL, Java and JavaScript to their workflows.

      Desired Behavior

      • Users would like to use JavaScript for pre-processing and post-processing of JVM jobs.
      • The JS7 Job API offers a method to execute JITL and Java JVM jobs from JavaScript jobs:
        class JS7Job extends js7.Job {
        	processOrder(js7Step) {
        		js7Step.getLogger().info("calling JITL FileExistsJob");
        		js7Step.executeJob(com.sos.jitl.jobs.file.FileExistsJob);
        
        		js7Step.getLogger().info("calling JITL PLSQLJob");      
        		js7Step.executeJob(com.sos.jitl.jobs.db.oracle.PLSSQLJob);
        	}
        }
        
      • Any matching arguments of the current job are forwarded to the job invoked by executeJob(<job>).
      • Users can map arguments individually like this:
        class JS7Job extends js7.Job {
        
            processOrder(js7Step) {
        	  js7Step.getLogger().info("call PLSQLJob");
        	
                  //1 - Arguments as JavaScript Map
                  var jsMap = new Map();
                  jsMap.set('result_file', '/tmp/jsMap.xml');
                  js7Step.executeJob(com.sos.jitl.jobs.db.oracle.PLSQLJob.class, jsMap);
              
                  //2 - Arguments as Java Map
                  var javaMap =  new java.util.HashMap();
                  javaMap.put('result_file', '/tmp/javaMap.xml');
                  js7Step.executeJob(com.sos.jitl.jobs.db.oracle.PLSQLJob.class, javaMap);
              
                  //3 - Arguments as <n> Java JobArguments
                  var my_resultset_as = new com.sos.js7.job.JobArgument("resultset_as", false, "csv");
                  var my_result_file = new com.sos.js7.job.JobArgument("result_file", false, "/tmp/my_result_file.csv");
                  js7Step.executeJob(com.sos.jitl.jobs.db.oracle.PLSQLJob.class, my_resultset_as, my_result_file);
            }
        }
        

      Attachments

        Activity

          People

            re Robert Ehrlich
            ap Andreas PĆ¼schel
            Kanika Agrawal Kanika Agrawal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: