Skip to content

Refactor XML to JSON conversion to include element-to-ID mapping#454

Open
stijnpotters1 wants to merge 2 commits intomasterfrom
fix/wrong-success-forward
Open

Refactor XML to JSON conversion to include element-to-ID mapping#454
stijnpotters1 wants to merge 2 commits intomasterfrom
fix/wrong-success-forward

Conversation

@stijnpotters1
Copy link
Copy Markdown
Contributor

@stijnpotters1 stijnpotters1 commented Apr 23, 2026

<Configuration xmlns:flow="urn:frank-flow"
               name="DefaultConfig">
  <Adapter name="SampleAdapter">
    <Receiver name="SampleReceiver"
              flow:y="-64"
              flow:x="190"
              flow:width="300">
      <ApiListener method="GET"
                   uriPattern="/sample"/>
    </Receiver>
    <Pipeline>
      <Exits>
        <Exit name="eksit"
              state="SUCCESS"
              flow:y="147"
              flow:x="1904"
              flow:width="150"
              flow:height="100"/>
        <Exit name="test"
              state="ERROR"
              flow:y="515"
              flow:x="2337"
              flow:width="150"
              flow:height="100"/>
      </Exits>
      <EchoPipe name="Result"
                getInputFromFixedValue="Hello World"
                flow:y="301"
                flow:x="627"
                flow:width="300">
        <Forward name="success"
                 path="Result"/>
      </EchoPipe>
      <ExceptionPipe name="Result"
                     flow:y="183"
                     flow:x="1322"
                     flow:width="300">
        <Forward name="success"
                 path="eksit"/>
        <Forward name="exception"
                 path="test"/>
      </ExceptionPipe>
      <Adios2XmlPipe name="test"
                     flow:y="515"
                     flow:x="1864"
                     flow:width="300">
        <Forward name="success"
                 path="test"/>
      </Adios2XmlPipe>
    </Pipeline>
  </Adapter>
</Configuration>
image

@stijnpotters1 stijnpotters1 self-assigned this Apr 23, 2026
@stijnpotters1 stijnpotters1 linked an issue Apr 23, 2026 that may be closed by this pull request
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@Matthbo Matthbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good other than this little thing


const targetNode = nodes.find((n) => n.data && 'name' in n.data && n.data.name === targetName)
const targetId = nameToId.get(targetName)
let targetNode = targetId ? nodes.find((n) => n.id === targetId) : undefined
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let targetNode = targetId ? nodes.find((n) => n.id === targetId) : undefined
let targetNode = targetId ? nodes.find((n) => n.id === targetId) : null

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

Successfully merging this pull request may close these issues.

Implicit success forward is wrong

2 participants