Skip to content

Batch 7: Result sections for JavaScript, Repeat, End repeat, XSD validator, XSLT, Ping, Telnet and Web service available. #8970 - #9132

Merged
bamaer merged 2 commits into
apache:mainfrom
Adalennis:8970-7
Oct 30, 2026
Merged

bamaer merged 2 commits into
apache:mainfrom
Adalennis:8970-7

Conversation

@Adalennis

Copy link
Copy Markdown
Contributor

Addresses #8970

Seventh batch: a Result section on the pages of JavaScript, Repeat, End repeat, XSD validator, XSLT, Ping, Telnet and Web service available.

Every row comes from a hop-run test against the current code (54 workflows, plus the child workflows run by Repeat). What the tests show:

  • JavaScript: a false script gives 0 errors; only a script that can't run (syntax or runtime error) gives 1 error. A value that is not a boolean is converted the JavaScript way (0 is false, a non-empty text is true). The errors variable in the script still holds the previous action's error count.
  • Repeat: adds the result files, rows and metrics of the last run only (a child run 3 times, adding 2 rows and a different file each time, passes on 2 rows and 1 file). When the stop variable already has its value, the file isn't run and the previous result is passed on unchanged, also when it was false. The value is compared without case. An empty File to repeat or a non-numeric delay stops the workflow instead of giving a false result.
  • End repeat: always true with 0 errors, also outside a Repeat.
  • Ping, Telnet, Web service available: false with 1 error on failure and when the host or URL is empty. Web service available is false on an HTTP error status such as 404.

Also fixed:

  • XSD validator: the page said any DOCTYPE is refused. Only a DOCTYPE that points to an external DTD, or an external entity, is refused; a DOCTYPE with only internal declarations is accepted.
  • XSLT: "Fail" makes the action false with 1 error, not the workflow fail; "Do Nothing" leaves the file and is true. Labels: Output Filename, Transformer factory, Do Nothing, Add output filename to result.
  • Ping: classic ping is true when the ping command ends with exit code 0 (on Linux and macOS: when at least one packet gets a reply), not "when no packets are lost". Labels: Action name, Nr packets to send.
  • Repeat labels: File to repeat (.hpl or .hwf), Keep variable values after executions, and four labels without the trailing "?". Telnet: Timeout (ms). JavaScript: a typo.

Found while testing, documented as a NOTE on the XSLT page:

  • Since 57bd0dc only XML File name, XSL File name, Output Filename and If file exists are saved. Get filenames from previous result, Transformer factory, Add output filename to result and the Advanced tab have no effect once the workflow is saved and opened again, or run with hop-run.
  • Create new with unique name builds the new name but writes to the original file, so the existing file is overwritten.
  • When the XSL file doesn't exist, the error in the log names the XML file instead (not in the docs).

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Run mvn clean install apache-rat:check to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If you have a group of commits related to the same change, please squash your commits into one and force push your branch using git rebase -i.
  • Mention the appropriate issue in your description (for example: addresses #123), if applicable.

To make clear that you license your contribution under the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

…dator, XSLT, Ping, Telnet and Web service available. apache#8970
@bamaer

bamaer commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Thanks @Adalennis, checked these against the code. All rows match except one; the XSD DOCTYPE fix and both XSLT notes are confirmed.

Worth fixing

  • Repeat, True row (repeat.adoc:91): Repeat never sets its result to true. When the loop ends normally, it passes on the previous action's true/false result. I ran a JavaScript action returning false, then an unconditional hop to Repeat, whose child workflow runs End repeat. The loop ends after one run, and Repeat follows its red hop (false, 0 errors). With true in the JavaScript action it follows the green hop. Suggested fix: add to the True row "...and the previous action was true", plus a NOTE like the one at line 97: after a false previous action (reached through an unconditional or red hop) the result stays false, even when the loop ended normally.

Reviewed against the code; Repeat checked with hop-run, docs site not built.

@Adalennis

Copy link
Copy Markdown
Contributor Author

Thanks! Confirmed with hop-run: Repeat passes on the previous action's result when the loop ends normally, both with End repeat and with the stop variable. JavaScript false → unconditional or red hop → Repeat ends false with 0 errors, even though the child ran all 3 times; with true and a green hop it's true. I added "and the previous action was true" to the True row, and merged your suggested NOTE with the existing one about the variable already being set, since both are the same rule: Repeat doesn't set a true result of its own.

@Adalennis

Copy link
Copy Markdown
Contributor Author

Reported: #9172 (XSLT action: settings lost since 57bd0dc, Create new with unique name overwrites, wrong file named when the XSL is missing).

@bamaer

bamaer commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Thanks @Adalennis, the Repeat True row and NOTE now match the code (including the 0 errors, since the error count is reset before Repeat runs). Nothing else open from my side.

@bamaer
bamaer merged commit c6fdffb into apache:main Oct 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants