Example 1 – Simple Input File
The following is a simple example that initializes a workflow called PVRWorkflow and sends four decision requests. When the simulator gets to the end of the input file, the terminate request message is sent automatically. It is suggested to turn the Business Rules Server trace on (console all comand) to see the initialize and decision requests being processed; individual data fields are displayed.
***** Call PVRWorkflow and write output to c:/temp/PVRWorkflow.txt
TF=c:/temp/PVRWorkflow.txt
WF=PVRWorkflow
***** Init & Decision Fields definition
IF=ibmSortType
IF=userField1,BYTE,5
DF=ibmNprAmount
DF=ibmNprPc
DF=ibmNprAccount
DF=ibmNprRT
DF=ibmNprExtProcCode
DF=ibmNprAuxOnUs
DF=myFlag,CHAR,1
***** Connect to the server and send decisions
ID=105,23
DD=12301,1234,,5533-3333,,,Y, // block
DD=12302,1234,,5566-6666,,,N, // batch
DD=12315,1234,12345678,021272655,2,,Y,
DD=121,,3213212,12345-123,,232355,, // Canadian
The output from the input file above displays in this section. The number next to the request: is a message counter. It matches the traces on the Business Rules Server. The line number identifies the location of the ID or DD statement in the input file.
The timing summary shows timing statistics from the run. Times are in seconds. Whenever the terminate
request message is processed, the output is the timing information. If more than one ID statement was
processed, there would be one for each and a final summary for all (see Example 5 – Running Multiple
Inits).
================== Business Rules Trace Log =====================
----- Request: 1 = Init ------ Line 38 ----------------------
----- Request: 2 = Decision -- Line 40 ----------------------
----- Request: 3 = Decision -- Line 41 ----------------------
----- Request: 4 = Decision -- Line 42 ----------------------
----- Request: 5 = Decision -- Line 43 ----------------------
----- Request: 6 = Term ------ Line 43 ----------------------
-------------------- Timing Summary (Init: 1) -------------------
Count Total Average Minimum Maximum
Init: 1 00.233.100
Decision: 4 00.011.083 00.002.770 00.000.532 00.007.067
Term: 1 00.000.493
Server Total: 00.244.676
Simulator: 00.027.487
Overall Total: 00.272.163
Server/Overall: 89%
========================= End Of File ===========================A
word of caution when using the trace output file option. Some editors and viewers will open files with the
exclusive setting on. If one of these applications leaves a file open, a subsequent run will fail when it
tries to write to the same output file. When this happens the following message is seen:
IO Exception trying to open trace file '../my_simulator/my_trace.txt'.
java.io.FileNotFoundException: ..\my_simulator\my_trace.txt
(The process cannot access the file because it is being used by another process.)