Example 5 – Running Multiple Inits

Whenever an InitData line is found in the input file, the simulator reconnects to the Business Rules Server. This allows the user to run several different workflows with one input file. The output may also be written to separate files for each initialize request or all output may be written to the same file.

This example runs each initialize using the same workflow but writing the output to separate files.
Note:
  1. The filename of the second file is shown as the continuation filename at the end of the first file.
  2. The filename of the first file is shown as the continuation filename at the beginning of the second file.
  3. With two or more initialization requests, there is an additional overall timing summary written to the output file.
TF=c:/temp/PVRWorkflow1.txt
WF=PVRWorkflow

IF=ibmSortType
IF=userField1,BYTE,5
DF=ibmNprAmount
DF=ibmNprPc
DF=ibmNprAccount
DF=ibmNprRT
DF=ibmNprExtProcCode
DF=ibmNprAuxOnUs
DF=myFlag,CHAR,1

ID=105,23
DD=12301,1234,,5533-3333,,,Y, 
DD=12302,1234,,5566-6666,,,N, 
TM
TF=c:/temp/PVRWorkflow2.txt

ID=106,23
DD=12315,1234,12345678,021272655,2,,Y, 
DD=121,,3213212,12345-123,,232355,,

================== Business Rules Trace Log =====================
----- Request:   1 = Init ------ Line   28 ----------------------
----- Request:   2 = Decision -- Line   41 ----------------------
----- Request:   3 = Decision -- Line   42 ----------------------
----- Request:   4 = Term ------ Line   49 ----------------------
-------------------- Timing Summary (Init: 1) -------------------
            Count  Total       Average     Minimum     Maximum
Init:           1  00.233.488  
Decision:       2  00.011.488  00.005.744  00.002.508  00.008.980
Term:           1  00.000.433  
Server Total:      00.245.409
Simulator:         00.030.291
Overall Total:     00.275.700
Server/Overall:    89%
Simulation continued in: PVRWorkflow2.txt
========================= End Of File ===========================

================== Business Rules Trace Log =====================
Simulation continued from: PVRWorkflow1.txt
----- Request:   1 = Init ------ Line   56 ----------------------
----- Request:   2 = Decision -- Line   79 ----------------------
----- Request:   3 = Decision -- Line   80 ----------------------
----- Request:   4 = Term ------ Line   84 ----------------------
-------------------- Timing Summary (Init: 2) -------------------
            Count  Total       Average     Minimum     Maximum
Init:           1  00.219.630  
Decision:       2  00.001.280  00.000.640  00.000.602  00.000.678
Term:           1  00.000.247  
Server Total:      00.221.157
Simulator:         00.011.042
Overall Total:     00.232.199
Server/Overall:    95%
==================== Timing Summary (Overall) ===================
            Count  Total       Average     Minimum     Maximum
Init:           2  00.453.118  00.226.559  00.219.630  00.233.488
Decision:       4  00.012.768  00.003.192  00.000.602  00.008.980
Term:           2  00.000.680  00.000.340  00.000.247  00.000.433
Server Total:      00.466.566
Simulator:         00.042.857
Overall Total:     00.509.423
Server/Overall:    91%
========================= End Of File ===========================

This example also shows the usage of the TermMsg (TM) operation. The simulator does not perform any kind of look ahead as it works. Failure to include this statement would have put the timing summary for the first initialize into the output file for the second initialize.