app/models/reference_analysis.rb
# validate that a requested WDL has a valid configuration in the reference_analysis workspace
validate that a requested WDL has a valid configuration in the reference_analysis workspace
validate that a requested WDL has a valid configuration in the reference_analysis workspace
def validate_wdl_configurations
    if extract_wdl_keys(:orchestration_wdl).size != 3
      errors.add(:orchestration_wdl, "is not in the correct format.  The value for this must be in the form of :namespace/:name/:version")
    end
    wdl_namespace, wdl_name, wdl_version = extract_wdl_keys(:orchestration_wdl)
    begin
      configurations = ApplicationController.fire_cloud_client.get_workspace_configurations(self.firecloud_project, self.firecloud_workspace)
      matching_config = configurations.find do |config|
        config['methodRepoMethod']['methodName'] == wdl_name &&
            config['methodRepoMethod']['methodNamespace'] == wdl_namespace &&
            config['methodRepoMethod']['methodVersion'] == wdl_version.to_i
      end
      if matching_config.nil?
        errors.add(:orchestration_wdl, "does not have a matching configuration saved in the workspace #{self.firecloud_project}/#{self.firecloud_workspace}")
      end
    rescue => e
      errors.add(:orchestration_wdl, "does not have a matching configuration saved in the workspace #{self.firecloud_project}/#{self.firecloud_workspace}")
    end
  end
def validate_wdl_configurations if extract_wdl_keys ( :orchestration_wdl ) . size != 3 errors . add ( :orchestration_wdl , "is not in the correct format.  The value for this must be in the form of :namespace/:name/:version" ) end wdl_namespace , wdl_name , wdl_version = extract_wdl_keys ( :orchestration_wdl ) begin configurations = ApplicationController . fire_cloud_client . get_workspace_configurations ( self . firecloud_project , self . firecloud_workspace ) matching_config = configurations . find do | config | config [ 'methodRepoMethod' ] [ 'methodName' ] == wdl_name && config [ 'methodRepoMethod' ] [ 'methodNamespace' ] == wdl_namespace && config [ 'methodRepoMethod' ] [ 'methodVersion' ] == wdl_version . to_i end if matching_config . nil? errors . add ( :orchestration_wdl , "does not have a matching configuration saved in the workspace #{self.firecloud_project}/#{self.firecloud_workspace}" ) end rescue => e errors . add ( :orchestration_wdl , "does not have a matching configuration saved in the workspace #{self.firecloud_project}/#{self.firecloud_workspace}" ) end end
validate that a requested WDL has a valid configuration in the reference_analysis workspace
validate that a requested WDL has a valid configuration in the reference_analysis workspace