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

Bean component should provide list of available beans in the ref field #1553

Open
tplevko opened this issue Oct 10, 2024 · 1 comment
Open
Labels
bug Something isn't working canvas/config-form Configuration form related issues

Comments

@tplevko
Copy link
Contributor

tplevko commented Oct 10, 2024

Describe the Bug

Bean component doesn't provide list of available beans in the ref field.

Route used:

- beans:
    - name: myCustomer
      type: com.mycompany.Customer
      scriptLanguage: java
      script: |
        var b = new com.mycompany.CustomerBuilder();
        b.name('Acme').street('Somestreet 42').zip(90210).gold(true);
        return b.build();
- from:
    uri: "timer:yaml"
    parameters:
      period: "5000"
    steps:
      - bean:
          ref: myCustomer
          method: summary
      - log: "${body}"

Steps to Reproduce the Bug or Issue

  1. create route
  2. see the "Bean" component doesn't provide list of available beans in the ref field

Screenshots or Videos

vokoscreenNG-2024-10-10_12-15-28.mp4

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 0.30.0]
@tplevko tplevko added bug Something isn't working canvas/config-form Configuration form related issues labels Oct 10, 2024
@lordrip
Copy link
Member

lordrip commented Oct 11, 2024

I see, in the same way, we're assigning CustomLongTextField for the expression fields, we could do the same for ref fields, by default showing the Beans list. Maybe something like the following could help.

    case String:
      /* catalog preprocessor put 'string' as a type and the javaType as a schema $comment */
      if (comment?.startsWith('class:') || props.name.startsWith('ref')) {
        return BeanReferenceField;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working canvas/config-form Configuration form related issues
Projects
Status: Backlog
Development

No branches or pull requests

2 participants