|
I agree with David. Using a ProgramCallDocument just seems easier to me. It
could ALMOST be considered and interface, maybe a better term would be a
defined contract. Plus the ProgramCallDocument.getValue(String) returns an
Object so all you have to do is cast, not create the object from a byte
array.
The one draw back is there is no native date handling.
Here is a simple example.
<pcml version="4.0">
<program name="DELETEORDER" path="/QSYS.LIB/%LIBL%/WVOE01R.PGM">
<data name="INCOMPANYID" type="int" length="4" precision="31"
usage="input" />
<data name="INCUSTOMERID" type="char" length="15" usage="input" />
<data name="INSHIPTO" type="char" length="15" usage="input" />
<data name="INORDERNUMBER" type="int" length="4" precision="31"
usage="inputoutput" />
</program>
</pcml>
public boolean deleteOrder(OrderHeader header) {
String module = "DELETEORDER";
try {
ProgramCallDocument pcmlDoc = createPCMLDoc("WVOE01R");
pcmlDoc.setValue(module + ".INCOMPANYID",
header.getCompanyId());
pcmlDoc.setValue(module + ".INCUSTOMERID",
header.getCustomerId());
pcmlDoc.setValue(module + ".INSHIPTO", header.getShipToId());
pcmlDoc
.setValue(module + ".INORDERNUMBER", header
.getOrderNumber());
return call(pcmlDoc, module);
} catch (PcmlException e) {
LoggingUtil.getLogger(this).log(Level.SEVERE,
"Could not delete the order.", e);
}
return false;
}
--
James R. Perkins
http://twitter.com/the_jamezp
On Wed, Oct 28, 2009 at 07:25, Dan Kimmel <dkimmel@xxxxxxxxxxxxxxx> wrote:
I've been using ProgramCall successfully for years. You have to get the--
datatypes right and do the conversions, but once you've got one, all the
rest come pretty easily. And I have some with lots and lots of
parameters going both directions with lots of data types. What do think
is the advantage of PCML? Don't you have to do basically the same thing
in a different format?
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of David Gibbs
Sent: Wednesday, October 28, 2009 9:06 AM
To: Java Programming on and around the iSeries / AS400
Subject: Re: Retrieving integer parameter after JT400 ProgramCall?
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.