0

Here's a Progress program that creates a record in the Symix database:

create audit.
    assign audit.table_name    = "JavaSample"
       audit.key_id        = "12345"
       audit.field_name    = "<FieldName>"
       audit.audit_dt      = today
       audit.audit_tm      = time
       audit.audit_user_id = "javauser".

I want to call this .p file from the java code.

piyushj
  • 1,546
  • 5
  • 21
  • 29
Santosh
  • 325
  • 5
  • 19

3 Answers3

5

Progress offers Open Client runtime package to call .p through AppServer. It is required to generate java classes from compiled .r file using ProxyGen from Progress OpenEdge Studio installation, then put those generated classes put into Java project. But this variant is complicated and not easy to use, especially if parameters changes frequently.

Alternative way to ProxyGen is to use opa library. It simplifies Progress .p procedures call from Java. All you need is this case - it is to create a simple parameters object and to call runProc method. Parameters will be mapped on the fly. Of course, you still require an AppServer on Progress side to run those .p.

More info in https://github.com/labai/opa

labai
  • 51
  • 1
  • 5
1

When using the AppServer you can run the .p file on the AppServer using the OpenClient proxies for Java:

http://documentation.progress.com/output/OpenEdge116/pdfs/dvjav/dvjav.pdf

Mike Fechner
  • 6,627
  • 15
  • 17
  • Thank you Mike. It is consoling that it is possible. Is there any sample code you have to refer to the same (That will really help)? – Santosh May 27 '16 at 06:41
  • Are you already using the AppServer? I'm not a Java Programmer - but used this in a number of projects with the help of others. – Mike Fechner May 27 '16 at 06:47
  • I use servlet container "Tomcat" instead of AppServer. Tomcat, you can imagine it as a mini version of AppServer like Weblogic App Server (WAS) for example. So the answer is yes. – Santosh May 27 '16 at 08:30
  • With AppServer I was referring to the OpenEdge AppServer – Mike Fechner May 27 '16 at 08:38
  • Sorry for misunderstanding your question at the first place. I am java developer, and i was given is the .p file shown above which will create a table in symix db (as told my client). I am expected to call this .p file from within my java file (running on local tomcat instance). If this .p file has to be within AppServer, then java file also needs to be within OpenEdge Appserver i suppose. Please correct if my understanding is wrong. I have very limted understanding of Symix application stack – Santosh May 27 '16 at 09:31
  • Depends on which OpenEdge AppServer your customer is using. The classic AppServer is a seperate installation from your Tomcat. And yes - the Java code on that Tomcat can connect via TCP to the OpenEdge AppServer in the way that is described in the PDF above. The new AppServer (PASOE) is embedded into Tomcat and as such can run Java Code and OpenEdge code. That comes as a seperate embedded Tomcat, so not the Tomcat you are using already. From the programming model in your Java code - both solutions are the some. – Mike Fechner May 27 '16 at 10:03
0

You could use Runtime to execute a shell script, as covered in for example this question: How to run Unix shell script from Java code?

Community
  • 1
  • 1
Jensd
  • 7,886
  • 2
  • 28
  • 37