Details
-
Feature
-
Status: Released (View Workflow)
-
Medium
-
Resolution: Fixed
-
None
-
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); } }