>I supposed I could understand doing it dynamically if there's a large
number of different processes or perhaps more importantly, the users need to
be able to changed the "assigned" process often.

Basically yes.  Anything to allow process flow to change without
recompiling.  Another example I thought of is electronic customer
interaction (i.e. order statuses, ship notification, etc).  

Say PGMA was in charge of releasing a scheduled job to notify a customer
that their order just shipped. Let's assume that your organization has
customers with varying levels of communication style (i.e. some do business
over the phone, some email, some EDI, some XML, etc), but PGMA doesn't
really care about how the customer likes their data, it just knows it has to
get this notification scheduled/queued.  PGMA could CHAIN out to a PF and
determine which service program and sub procedure are "registered" with this
particular customer and event (event=Ship Notification). It would then pass
the order number to the sub-procedure being activated and walla! A ship
notification has been sent. 

You could even modify the above to iterate over a grouping of events because
there are many times that you will have to send an email AND send
programmatic notification (say EDI, Web Service, etc) for an order being
shipped.  

Now would be the time to discuss the performance concerns of dynamic
activation vs. other methods.  If somebody wants to pipe in on those points
feel free as I just know enough to be dangerous:-)

Aaron Bartell

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Wilt, Charles
Sent: Tuesday, May 09, 2006 3:07 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Dynamically activing bound programs (was RE: Calling
aFunctionfrom RPG Program having multiple Functions)

Scott,

I guess what I don't understand is how doing it dynamically is of any
benefit.

Why not just:
  
   procToUse = LookupProc(fieldsNeededToDetermine);
   select;
     when procToUse = PROC1;
       Process1();
     when procToUse = PROC2;
       Process2();
     //and so on
   endsl;

I supposed I could understand doing it dynamically if there's a large number
of different processes or perhaps more importantly, the users need to be
able to changed the "assigned" process often.

But coming from an X12 EDI background, it would seem to me that the process
for a given XML document would be pretty static.


I don't doubt Aaron's got a good reason for doing it the way he his, I'm
just trying to understand the reason.  As I mentioned before, I've never
needed to do it.

One idea I came up with is basically pseudo-inheritance.  You could have a
base version of a service program in a base library, then individual
locations and/or versions could have there own version of the base service
programs procedures in the individual's own service program.

Seems like that would get pretty complex, and you'd lose some of the
compiler and run-time checking advantages the "regular" use of service
programs give you.


Thanks,
Charles Wilt
--
iSeries Systems Administrator / Developer Mitsubishi Electric Automotive
America
ph: 513-573-4343
fax: 513-398-1121
  

> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx
> [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
> Sent: Tuesday, May 09, 2006 3:30 PM
> To: RPG programming on the AS400 / iSeries
> Subject: Re: Dynamically activing bound programs (was RE: 
> Calling a Functionfrom RPG Program having multiple Functions)
> 
> Hi Charles,
> 
> > I don't see anything here that requires the manual activation of a 
> > service program and the use of procedures pointers to call the 
> > procedures.
> 
> It sounds to me like Aaron is reading some sort of key from an XML 
> document, using that to look up a service program & subprocedure name 
> in a database, and then handing off control to that subprocedure.
> 
> Since he's looking up the names in a database at run-time, he'd have 
> to dynamically call the procedures.
> 
> It was the following paragraph (from Aaron) that made me think that:
> 
> >> PGM1 receives in a request and determines what program should be 
> >> called to  process the xml based on DB2 entries. PGM1 then
> "activates" 
> >> PGM2 SUBPROCEURE1 and "hands off" the parsing of the
> request and the
> >> composing of the response.
> 
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing 
> list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, 
> unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a 
> moment to review the archives at http://archive.midrange.com/rpg400-l.
> 
> 


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.