Uploaded image for project: 'JS - JobScheduler'
  1. JS - JobScheduler
  2. JS-602 Setting endstate for an order and then execute the order deletes the order
  3. JS-604

Setting endstate for an order and then execute the order deletes the order (2)

    XMLWordPrintable

Details

    • Sub-task
    • Status: Dismissed (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • Job Scheduler Binaries
    • None

    Description

      Die Änderungen aus JS-602 sollten etwas eleganter gelöst werden.

      Was fehlt, die Behandlung des end_state, wenn set_end_state gerufen wird. Folgende Änderungen sollten in Order.cxx vorgenommen werden:

      Neu:
      bool Order::end_state_reached2()
      {
      bool result = false;

      if( Job_chain* job_chain = this->job_chain() )
      {
      if( Node* node = job_chain->node_from_state_or_null( _state ) )

      { if( node->is_type( Node::n_end ) ) result = true; }

      else
      result = true;
      }

      return result;
      }

      Änderung:
      bool Order::end_state_reached()
      {
      bool result = false;

      if( _end_state_reached ) result = true;
      else
      result = end_state_reached2();

      return result;
      }

      Änderung:
      void Order::set_state1( const State& order_state )
      {
      check_state( order_state );

      if( _job_chain )
      {
      ptr<Order> hold_me = this;
      State previous_state = _state;
      Node* node = NULL;

      if( !order_state.is_empty() )

      { node = _job_chain->referenced_node_from_state( order_state ); if( node != _job_chain->node_from_state( order_state ) ) _log->info( message_string( "SCHEDULER-859", node->order_state().as_string(), order_state ) ); }

      move_to_node( node );

      if( previous_state != _state && end_state_reached2() )

      { handle_end_state(); }

      }
      else
      set_state2( order_state );
      }

      Änderung:
      void Order::set_end_state( const State& end_state )
      {
      if( previous_state != _state) {
      if( !end_state.is_null_or_empty_string() )

      { if( Job_chain* job_chain = this->job_chain() ) job_chain->referenced_node_from_state( end_state ); // Prüfen }

      _end_state = end_state;
      _order_xml_modified = true;
      if(end_state_reached2() )
      handle_end_state();
      }
      }

      Änderung in spooler_command.cxx:

      Statt:
      if( order->finished() && !order->has_base_file() && !order->is_on_blacklist() )

      { order->remove_from_job_chain( Order::jc_remove_from_job_chain_stack, &ta ); order->close(); }

      else

      { order->db_update( Order::update_anyway, &ta ); }

      nur noch:
      order->db_update( Order::update_anyway, &ta );

      Attachments

        Activity

          People

            ss Stefan Schädlich (Inactive)
            ss Stefan Schädlich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: