Add getMessageOption() and setMessageOption() to ProgramCallDocument #187
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements two new functions on
ProgramCallDocument
:getMessageOption()
andsetMessageOption()
. 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 ofAS400Message.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 theProgramCall
class (since all these changes do is just call thoseProgramCall
functions to propagate the value whenProgramCallDocument.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 standardProgramCall
, the message list was always saved off after the call was made, no matter the result of the call. So I have changedProgramCallDocument
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.