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

JS7 Java Jobs API - the Outcome variables are ignored if the job throws an exception

    XMLWordPrintable

Details

    • Fix
    • Status: Released (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • 2.5.9, 2.6.6, 2.7.0
    • None

    Description

      Current Situation

      • If the JS7 API Job throws an exception and sets Outcome variables before the exception or in finally block, they will be ignored.
        • Example:
          public class MyJS7Job extends Job<MyJS7JobArguments> {
          
              @Override
              public void processOrder(OrderProcessStep<MyJS7JobArguments> step) throws Exception {
                  try{
                      ...
                      step.getOutcome().putVariable("my_variable","my_variable_value");
                      ...
                      throw new Exception("my exception");
                  }
                  catch (Throwable e) {
                      throw e;
                  }
                  finally {
                      step.getOutcome().putVariable("my_finally_variable","my_finally_variable_value");
                  }
              }
          }
          
        • The both variables my_variable and my_finally_variable are not set as Outcome variables and are not available for the subsequent jobs.

      Desired Behaviour
      A defined Outcome variable should be set regardless of whether Job run is successful or not.

      Attachments

        Activity

          People

            re Robert Ehrlich
            re Robert Ehrlich
            Uwe Risse Uwe Risse
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: