Page 1 of 1

Batch compile of webevent functions V12

Posted: Wed Mar 01, 2017 2:06 am
by Troy
We are currently running V12 of the Lansa IDE and are needing to recompile several webevent functions. Is there a way to use a batch compile to accomplish this, or some other automated way?

Re: Batch compile of webevent functions V12

Posted: Thu Mar 02, 2017 1:18 am
by Troy
Here were some suggestions I was given.
If this is an RDML partition on IBMi, then you can build a function to do this using specialized development BIFS.
You would use
GET_FUNCTION_LIST (input is a process name)
And feed the functions returned to a compile BIF
COMPILE_PROCESS
Of particular interest is, make sure this flag
Generate HTML Pages?
Is set to NO. If you have any manual changes to your webevent html pages, they would get overwritten otherwise.
I know people in the paste have used these with success, but I don’t have any sample code.

If this is an RDMLX partition, these BIFs are not available.
The option here would be to export everything to a dedicated RDML partition (if they are all RDML objects), compile them there, and then move them back.

Another was this.
One easy solution is to install Visual LANSA against the same IBMi server LANSA installation and then run a compile from VL (check-in). You can select to compile all the functions in one sweep.

Re: Batch compile of webevent functions V12

Posted: Thu Mar 02, 2017 10:15 am
by MarkDale
If you need an example of using the the compile_process bif, there is one here:

http://docs.lansa.com/14/en/lansa015/Co ... rocess.htm

Its a lansa function that requests a process name from the user and compiles all the functions in a process, but you could modify it to compile a known list of processes without requesting anything from the user.

********* Define arguments and lists
DEFINE FIELD(#PROCES) TYPE(*CHAR) LENGTH(10)
DEFINE FIELD(#FUNCTN) TYPE(*CHAR) LENGTH(7)
DEFINE FIELD(#RETCOD) TYPE(*CHAR) LENGTH(2)
DEF_LIST NAME(#WKFUNL) FIELDS((#FUNCTN)) TYPE(*WORKING)
DEF_LIST NAME(#BWFUNL) FIELDS((#FUNCTN))
********* Clear working and browse lists
BEGIN_LOOP
CLR_LIST NAMED(#WKFUNL)
INZ_LIST NAMED(#BWFUNL) NUM_ENTRYS(10) WITH_MODE(*CHANGE)
********* Request Process and Functions
REQUEST FIELDS(#PROCES) BROWSELIST(#BWFUNL)
********* Move Functions from the browselist to the working list
SELECTLIST NAMED(#BWFUNL)
ADD_ENTRY TO_LIST(#WKFUNL)
ENDSELECT
********* Execute built-in-function - COMPILE_PROCESS
USE BUILTIN(COMPILE_PROCESS) WITH_ARGS(#PROCES #WKFUNL) TO_GET(#RETCOD)
********* Check if submission was successful
IF COND('#RETCOD *EQ ''OK''')
MESSAGE MSGTXT('Compile Process submitted successfully')
CHANGE FIELD(#PROCES) TO(*BLANK)
ELSE
MESSAGE MSGTXT('Compile Process submit failed with errors, refer to additional messages')
ENDIF
END_LOOP