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

String defined steps are not parsed correctly #2089

Open
mmelko opened this issue Mar 13, 2025 · 1 comment
Open

String defined steps are not parsed correctly #2089

mmelko opened this issue Mar 13, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@mmelko
Copy link
Contributor

mmelko commented Mar 13, 2025

Describe the Bug

According the YAML DSL schema it's possible to define some steps directly with the string instead of step parameters, e.g:

  - setExchangePattern: pattern
  - convertBodyTo: string
  -  removeHeader: header
  - removeProperties: props.*
  - toD: direct:a
```  instead of 
```yaml
  - setExchangePattern: 
       pattern:inOnly
  - convertBodyTo: 
       type: string
  -  removeHeader: 
         name: header
  - removeProperties: 
        pattern: props.*
  - toD: 
       uri:direct:a

It seems that Kaoto is recognising only steps with uri, and expressions and dataformat.

This might be quite hard but I believe I'd be nice to recognise steps which required attributes can be defined using string.

Related to: #2084

Steps to Reproduce the Bug or Issue

  1. in the source code view paste some route with string defied steps eg:
- route:
   id: route-2517
   from:
     id: from-2423
     uri: timer
     parameters:
       period: "1000"
       timerName: template
     steps:
       - log: ${body}
       - loadBalance:
           steps:
             - to: direct:a
           customLoadBalancer: new
       - setExchangePattern: inOnly
       - convertBodyTo: string
  1. check the convertBodyTo, customLoadBalancer, setExchangePattern in the visualisation form.

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 0.30.0]
@lordrip
Copy link
Member

lordrip commented Mar 14, 2025

There's still an issue that we need to consider for the next PR:

Starting with this XML route

<camel>
  <route id="route-8014">
    <from id="from-8738" uri="timer:template?period=1000"/>
  </route>
  <beans>
    <bean name="hola" type="org.slf4j.Logger">
      <constructors>
        <constructor value="value-0"/>
        <constructor value="value-1"/>
      </constructors>
    </bean>
  </beans>
</camel>

Going to YAML, we see this:

- route:
    id: route-8014
    from:
      id: from-8738
      uri: timer:template?period=1000
      steps: []
- beans:
    - constructors:
        "0": value-0
        "1": value-1
      name: hola
      type: org.slf4j.Logger

Notice how the URI in the from tag is not parsed into parameters.

@lordrip lordrip moved this from New to Backlog in Kanban Board Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants