Interoperability

FredBear

Member
[frown] Hi,

I need to call a program written in Java from a business function and send thru data and receive data in response. the Java program itself will retrieve the data from whatever source. Is this possible? I have tried the B34A1030 but this does not allow me to pass values to the program. Will I be able to create a C Business function and call the java program from that? if so, how would I pass the data to it?

Thanks
 
Hi Fred.

I hope this will change your frown to a smile. . .
Business Function B34A1030 does allow you to pass data, (parameters), to the external program you are calling:

This BSFN will execute a command using the native command interpreter for the platform where the BSFN is mapped to run.

1. The input command line must be valid for the platform where this BSFN is run.
2. The BSFN runs the command line synchronously – it will not return until the command line is done executing.
3. Security and permissions to execute certain commands may be platform-dependant as well.
4. This BSFN cannot detect the status of the command. It can only detect if the command appeared to run, but not if the command completed successfully.
5. Processing: Call ANSI function system( ) with command line as parameter. If system( ) returns less than 0, set cErrorCode to ‘1’ and szErrorMessageId to ‘3143’.

Note the following Data Structure Description:
( Data Item, Data Structure Description, I/O - Notes )
SUPPS cSuppressErrorMessage Input - Enter ‘1’ if you don’t want the BSFN to set errors.
ERRC cErrorCode Output - Enter ‘1’ if there are errors, ‘0’ otherwise.
DTAI szErrorMessageId Output - Error code to be set, if any.
NFLF szCommandLine Input - Command line to be executed: Use alias CMDS for the report variable used to construct the command string. ie.)

Hope this helps.
Joseph
 
Hi

thanks for you quick response. I need to pass some data to this program (eg. AddressLine1, AddressLine2, AddressLine3, AddressLine4) The data is sent to the java program, which in turn executes a function on an s390. This function checks the info, makes corrections and sends the data back to the calling java program. This works. the problem is getting the corrected data back into jdedwards. Any idea of how one can get around this?

Thanks again
 
We had similar problem of calling Java method from JDE BSFN.
This is white paper(attached) If it helps you then great.

Enjoy
OW Hell
 

Attachments

  • 34966-Calling a Java Method from a OneWorld Business Function Using JNI.zip
    129.1 KB · Views: 153
Nice twist Fred.

I understand what you're saying.
In the past I never had to look at the returned data, but I would hope that the B34A103 parameters function the same way as any other Input/Output parameter. . .
That is to say: The 'Command' parameter for B34A1030 that specifies 'the program to execute and it's parameters', should be returned with the new parameter values.
It may not work this way, since this actually parameters within a parameter.

My personal logic would deduce the following:
Execute B34A1030 Parm('Call JAVA1 Parm('John Doe' '24 Side Street')
after program JAVA1 completes execution, control passes back to the OneWorld program that executed BSFN B34A1030.
This should then return the command parameter with the values:
B34A1030 Parm('Call JAVA1 Parm('John Doe' '155 Service Road')
That's assuming that '155 Service Road' was the changed data.

Is that clear as mud ?
( You could use a work-file to retrieve the data, but that's a work-around.)
Please let us know how your story ends.
This could be useful to some of us in the future.
Joseph
 
Hi,

We got this to work on the client side, thanks. Do you know if LoadLibrary and getProcAddress will work on an AS/400 as this is our platform?

Thanks
Fred
 
LoadLibrary and GetProcAddress will NOT work on an AS/400 instead use
JDERTN (HINSTANCE) JDEWINAPI jdeLoadLibrary(LPSTR lpszLibFileName);

JDERTN (FARPROC) JDEWINAPI jdeGetProcAddress(HMODULE hModule, LPCSTR lpszProc);

JDERTN (void) JDEWINAPI jdeFreeLibrary(HINSTANCE hModule);

These system apis are declare in JDELPRTO.h

All the best.....

Regards

OW Hell
 
Thanks... you wouldn't perhaps have some source code that uses this would you ?

Thanks
Fred
 
Back
Top