text: user12775: I tried to add a "gather_results" task to a workflow that takes in an array of Files and moves output files to a new folder of a specified name.
  Cannot interpolate Array[File?]+ into a command string with attribute set wdl PlaceholderAttributeSet(None,None,None,Some( ))]
  The wdl file passes womtools and I have no idea what a PlaceholderAttributeSet is, which makes debugging quite difficult.
  --
  gather files task
  task gather_result{
    input{
      String dir
      String? subDir
      Array[File?]+ files
    }
  
    command
    {
      mkdir --parents ${dir}/${default="" subDir}; /bin/mv -t ${dir}/${default="" subDir} ${sep=" " files}
    }
    runtime
    {
      docker_image: "pipeline"
      memory: "2 GB"
    }
    output
    {
      String out = stdout()
    }
  }
  
  
  How it's called:
    call gather_result as gather_files {
        input: files=[create_hic.output_hic[1],
                      dedup.deduped_bam,
                      calculate_stats.stats[0],
                      calculate_stats.stats_hists[0],
                      calculate_stats.stats_json[0]],
              dir=OutputDir
      }
  
  
  
  user81: I think you'll need to convert your Array[File?]+ to a Array[File] before you can use ~{sep=" " files} in the command section.
  You can use the select_all function for that, which will only keep valid files.
  https://github.com/openwdl/wdl/blob/main/versions/development/SPEC.md#arrayx-select_allarrayx
  
original_text: 12775: <p>I tried to add a &quot;gather_results&quot; task to a workflow that takes in an array of Files and moves output files to a new folder of a specified name.</p>
  <p><code>Cannot interpolate Array[File?]+ into a command string with attribute set wdl PlaceholderAttributeSet(None,None,None,Some( ))]</code></p>
  <p>The wdl file passes womtools and I have no idea what a PlaceholderAttributeSet is, which makes debugging quite difficult.</p>
  <p>--</p>
  <p><strong>gather files task</strong></p>
  <pre><code>task gather_result{
    input{
      String dir
      String? subDir
      Array[File?]+ files
    }
  
    command
    {
      mkdir --parents <span class="math-container">${dir}/$</span>{default=&quot;&quot; subDir}; /bin/mv -t <span class="math-container">${dir}/$</span>{default=&quot;&quot; subDir} ${sep=&quot; &quot; files}
    }
    runtime
    {
      docker_image: &quot;pipeline&quot;
      memory: &quot;2 GB&quot;
    }
    output
    {
      String out = stdout()
    }
  }
  
  </code></pre>
  <p>How it's called:</p>
  <pre><code>  call gather_result as gather_files {
        input: files=[create_hic.output_hic[1],
                      dedup.deduped_bam,
                      calculate_stats.stats[0],
                      calculate_stats.stats_hists[0],
                      calculate_stats.stats_json[0]],
              dir=OutputDir
      }
  
  </code></pre>
   81: <p>I think you'll need to convert your <code>Array[File?]+</code> to a <code>Array[File]</code> before you can use <code>~{sep=&quot; &quot; files}</code> in the command section.</p>
  <p>You can use the <code>select_all</code> function for that, which will only keep valid files.</p>
  <p><a href="https://github.com/openwdl/wdl/blob/main/versions/development/SPEC.md#arrayx-select_allarrayx" rel="nofollow noreferrer">https://github.com/openwdl/wdl/blob/main/versions/development/SPEC.md#arrayx-select_allarrayx</a></p>
  