IBM / JTOpen

IBM Toolbox for Java, an IBM i communications library
https://ibm.github.io/JTOpen/
Other
56 stars 26 forks source link

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

Open pjyoung-ibm opened 3 weeks ago

pjyoung-ibm commented 3 weeks ago

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.