Hi All,

I have been experimenting with modifying the Tax Advisor application in
"Jess In Action".
On pg. 169 Ernest makes the comment "...You should be thinking about putting
together a complete test harness now..".

I have been structuring my Jess scripting code in modules, placing them in
separate files, and calling them from a master *.clp file like so..

;;======= pat.clp ============
;; Application batch script
(clear)
(watch all)
(batch pat_main.clp)
(batch pat_ask.clp)
(batch pat_startup.clp)
(batch pat_survey.clp)
(batch pat_recommend.clp)
(batch pat_report.clp)
(batch pat_run.clp)
(start-pat)

Also, as Ernest suggested, this is called via a simple DOS batch file like:

@ECHO OFF
CLS
:BEGIN_MENU
ECHO ========== Jess Menu ==========
ECHO A. Run Jess stand-alone
ECHO B. Run Jess/PAT
ECHO Q. Quit
ECHO ===============================

SET ITEM=
SET /P ITEM=Type the letter and press Enter:

IF NOT '%ITEM%'=='' SET ITEM=%ITEM:~0,1%
ECHO.

IF /I '%ITEM%'=='A' GOTO ItemA
IF /I '%ITEM%'=='B' GOTO ItemB
IF /I '%ITEM%'=='Q' GOTO End
ECHO "%ITEM%" is not valid. Please try again.
ECHO.
GOTO BEGIN_MENU

:ItemA
REM ***** JESS STAND-ALONE  ******
@ECHO OFF
ECHO Switching to JESS6.1p6 directory
CD C:\Jess61p6
ECHO  Starting jess.Main...
java jess.Main
GOTO RESTART

:ItemB
REM ***** JESS / PAT ******
@ECHO off
ECHO Switching to JESS6.1p6\pat directory
CD C:\Jess61p6\pat
ECHO Starting pat.clp from jess.Main...
java jess.Main pat.clp
PAUSE
GOTO RESTART

:RESTART
PAUSE
CLS
GOTO BEGIN_MENU
:END

So far, it seems to work nicely, since I can comment out files that are
in-progress and isolate bugs better.
Are there any pitfalls to this approach (namely calling batch files from
batch files in Jess) and is there a better way?

Thanks!

Jason Morris
-------
Morris Technical Solutions
[EMAIL PROTECTED]
www.morristechnicalsolutions.com
fax/phone: 503.692.1088

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to