Skip to content

Incompatible type from task's output and outputAs's input #1200

@mcruzdev

Description

@mcruzdev

What happened:

Having the following set of tasks:

                            function("scoreProposal", (Proposal input) -> {
                                Integer score = calculateScore(input.abstractText());
                                System.out.println("Score calculated having the result as: " + score);
                                return score;
                            }, Proposal.class)
                                    .outputAs((Integer score) -> {
                                                return new ProposalScore(score, score >= 7);
                                            }, Integer.class),

I am receiving the following:

java.lang.ClassCastException: java.lang.Long incompatible with java.lang.Integer

What you expected to happen:

To execute the outputAs method.

How to reproduce it:

To create a workflow using the provided tasks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    javaPull requests that update java codespec:1.0.0

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions