Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error, cannot cast String to Map for array of records as input #446

Open
whlavina opened this issue Dec 26, 2018 · 0 comments
Open

Error, cannot cast String to Map for array of records as input #446

whlavina opened this issue Dec 26, 2018 · 0 comments

Comments

@whlavina
Copy link

Using rabix-cli-1.0.5, Rabix fails on CWL that specifies complex inputs, such as an array of records. By comparison, Cromwell and the reference cwltool both succeed on the sample inputs.

An example error message is:

Execution failed for root. org.rabix.bindings.cwl.processor.CWLPortProcessorException:
org.rabix.bindings.cwl.processor.CWLPortProcessorException:
Error: java.lang.String cannot be cast to java.util.Map while processing value:
[{my_field=field_1}, {my_field=field_2}]

Both CWL examples below fail with this same sample input - test.yaml:

my_array:
    - my_field: field_1
    - my_field: field_2

Using inline JS - test-command-line.cwl

cwlVersion: v1.0 
class: CommandLineTool
requirements:
  - class: InlineJavascriptRequirement
baseCommand: echo
arguments: ["$(JSON.stringify(inputs))"]
inputs:
    my_array:
        type: 
            type: array
            items: 
                  type: record
                  name: my_record
                  fields:
                      my_field: string

outputs:
    my_output:
        type: stdout

Using ExpressionTool - test-expression.cwl

cwlVersion: v1.0 
class: ExpressionTool
requirements:
  - class: InlineJavascriptRequirement
expression: "$({'my_output':inputs})"
inputs:
    my_array:
        type: 
            type: array
            items: 
                  type: record
                  name: my_record
                  fields:
                      my_field: string

outputs:
    my_output:
        type: Any

P.S. I'm not sure if InlineJavascriptRequirement is needed for an ExpressionTool or whether the expression should work with a simple string value (rather than an interpolated value). The CWL specifications and tutorial don't give much details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant