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

Add getMessageOption() and setMessageOption() to ProgramCallDocument #187

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

pjyoung-ibm
Copy link
Member

This PR implements two new functions on ProgramCallDocument: getMessageOption() and setMessageOption(). These new functions allow users to specify how many messages should be returned when calling a given program in their (X)PCML document. This option already existed on standard ProgramCalls and ServiceProgramCalls, but this option was not exposed to users of ProgramCallDocuments, thus locking them to the default of AS400Message.MESSAGE_OPTION_UP_TO_10. This PR now exposes that option to ProgramCallDocument users. They behave exactly the same as the functions of the same names in the ProgramCall class (since all these changes do is just call those ProgramCall functions to propagate the value when ProgramCallDocument.callProgram() is called).

This PR also makes a change to when the message list is saved when calling a program through a ProgramCallDocument. Previously, the message list would only be saved if the program call signaled that the call errored. So a successful call would not save off the messages, even if the program call did return messages during the call. In the standard ProgramCall, the message list was always saved off after the call was made, no matter the result of the call. So I have changed ProgramCallDocument to do the same. Now, ProgramCallDocument.getMessageList() will always have whatever messages were returned from the most recent call for the given program node, based on the message option value.

Allows users to specify how many messages should be returned when calling a program. This option already existed on ProgramCalls, but there was no way to set this through (X)PCML calls. These changes expose that option now.
Also made a change to always save the message list after the program call is run. Previously, the message list would only be saved if the program call signaled an error. However, the underlying ProgramCall would always save the message list off no matter the result. So match that behavior for (X)PCML calls.

Signed-off-by: Parker Young <[email protected]>
@pjyoung-ibm pjyoung-ibm force-pushed the pjyoung/pcml-msgopt branch from 8f246ad to 1ec8c1a Compare June 27, 2024 16:28
@jeber-ibm jeber-ibm merged commit 5702fe2 into IBM:main Sep 5, 2024
2 checks passed
@pjyoung-ibm pjyoung-ibm deleted the pjyoung/pcml-msgopt branch October 21, 2024 20:23
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.

2 participants