app/models/reference_analysis.rb
# populate inputs & outputs from reference analysis WDL definition.  will automatically fire after record creation
# also clears out any previously saved inputs/outputs, so use with caution!
populate inputs & outputs from reference analysis WDL definition.  will automatically fire after record creation
also clears out any previously saved inputs/outputs, so use with caution!
populate inputs & outputs from reference analysis WDL definition . will automatically fire after record creation also clears out any previously saved inputs / outputs so use with caution!
def load_parameters_from_wdl!
    begin
      self.reference_analysis_data.delete_all
      wdl_namespace, wdl_name, wdl_version = extract_wdl_keys(:analysis_wdl)
      config = ApplicationController.fire_cloud_client.get_method_parameters(wdl_namespace, wdl_name, wdl_version.to_i)
      config.each do |data_type, settings|
        settings.each do |setting|
          vals = setting['name'].split('.')
          call_name = vals.shift
          parameter_name = vals.join('.')
          parameter_type = data_type == 'inputs' ? setting['inputType'] : setting['outputType']
          optional = setting['optional'] == true
          config_attr = {
              data_type: data_type,
              parameter_type: parameter_type,
              call_name: call_name,
              parameter_name: parameter_name,
              optional: optional
          }
          unless self.reference_analysis_data.where(config_attr).exists?
            self.reference_analysis_data.create!(config_attr)
          end
        end
      end
      true
    rescue => e
      Rails.logger.info "Error retrieving analysis WDL inputs/outputs: #{e.message}"
      e
    end
  end
def load_parameters_from_wdl! begin self . reference_analysis_data . delete_all wdl_namespace , wdl_name , wdl_version = extract_wdl_keys ( :analysis_wdl ) config = ApplicationController . fire_cloud_client . get_method_parameters ( wdl_namespace , wdl_name , wdl_version . to_i ) config . each do | data_type , settings | settings . each do | setting | vals = setting [ 'name' ] . split ( '.' ) call_name = vals . shift parameter_name = vals . join ( '.' ) parameter_type = data_type == 'inputs' ? setting [ 'inputType' ] : setting [ 'outputType' ] optional = setting [ 'optional' ] == true config_attr = { data_type : data_type , parameter_type : parameter_type , call_name : call_name , parameter_name : parameter_name , optional : optional } unless self . reference_analysis_data . where ( config_attr ) . exists? self . reference_analysis_data . create! ( config_attr ) end end end true rescue => e Rails . logger . info "Error retrieving analysis WDL inputs/outputs: #{e.message}" e end end
populate inputs & outputs from reference analysis WDL definition.
populate inputs & outputs from reference analysis WDL definition .