Forums » Runtime » Infrastructure »
Running converted code from linux
Added by Antanas Valencius about 3 years ago
Hello,
We have a system module that runs some code based on environment variables. The module calls some shell bash files, which may call a progress procedure:
Progress procedure: --------------------------------- ... os-command silent value(subst("script1.sh &1 &2", param1, param2)). ... --------------------------------- script1.sh: --------------------------------- ... mpro -db dbname -b -p anotherProcedure.p ... ---------------------------------
In my understanding, we will have to adapt our scripts to run java class methods instead. Could you please aid on how such approach would look like and provide links to additional resources? Thank you.
Replies (4)
RE: Running converted code from linux - Added by Greg Shah about 3 years ago
we will have to adapt our scripts
Yes, you are correct that the scripts need to be edited. At some point we will implement replacements for the OE executibles like mpro
but we have not done so yet.
to run java class methods instead
This is possible but it is not the obvious choice. Our sample projects have good sample scripts (see deploy/client/client*.sh
) that show how we can launch a FWD client process. This same approach can be used directly because the client.sh
is really just setting up the environment and creating the command line to execute the ClientDriver
class in FWD. So you can execute this class yourself or you can use the client.sh
(and other examples) to do it for you.
The documentation is in Running the Client
In regard to the mpro
parameters:
- The
-db dbname
is something that we enable in the FWD server'sdirectory.xml
. Configure an "auto-connected" database in thedirectory.xml
. See Database Configuration, but please be aware that at this moment, that page is out of date for FWD v4.0. Eric is making some updates and will post here when it is ready. - The
-b
means this is a batch process. We implement that by passingclient:driver:type=chui_batch
to theClientDriver
or we run theServerDriver -b <process_id>
. Please also see Batch Processes for details on setup of a batch process. This documentation is missing right now. Constantin is writing it up and will post here when it is ready. - The
-p anotherProcedure.p
is a startup program. You can tell the client to execute a specific startup program usingclient:cmd-line-option:startup-procedure=anotherProcedure.p
.
RE: Running converted code from linux - Added by Constantin Asofiei about 3 years ago
I've added the documentation for batch process directory configuration and batch process launching.
RE: Running converted code from linux - Added by Eric Faulhaber about 3 years ago
I've updated the database configuration documentation to reflect the changes in FWD v4.
RE: Running converted code from linux - Added by Greg Shah about 3 years ago
Configure an "auto-connected" database in the directory.xml.
As noted in the updated documentation, you must set the load_at_startup
value to true
for any database where the 4GL code does not have a CONNECT
statement. At this time we don't provide more granular control over this value (we are fixing this in issue #3930). In the short term, if you can't globally set this flag for all sessions, then change the 4GL code to add a program that does the CONNECT
before launching the procedure.