REGENEREATE BANG RECORD (recreated) (Indexing)
At 08 JUN 2018 04:44:00AM Ed Keeman wrote:
Hi,
We use a document system where records are filled with some default, dynamic information (template).
Sometimes someone opens a new document, but does not save any mutations.
That leaves the initial record in the database.
To get around this problem we created a template file, where templates are saved.
In mfs when a document can't be read, it checks the template file.
The record variable (document) is set with the contents of the template file record, and the filesystem thinks a document is read.
This all works fine, except for indexing.
Document fields read from the templates file will not be indexed, when they are not changed.
We think this is because the indexing system does not see mutations in the document.
How can we get indexes working in this situation?
Ed Keeman
At 08 JUN 2018 07:56AM D Harmacek wrote:
It appears that SI.MFS thinks the value of those template fields have not changed so an index change entry is not created.
I think SI.MFS upon a WRITE is reading the original version of the record and comparing the values in the indexed fields. Perhaps your mfs is filling them with the defaults and thus, they are not changing value from "null".
Have you reviewed the source code for the ! record you can find in the !table of this table? That source may help you see what is happening. I believe you can retain the source if you place a record named !! in the !table if memory serves me.
Inspect the ordering of the MFS for that table. Perhaps reordering so that SI.MFS processes before your own mfs.
Dave Harmacek, Harmacek Database Systems, near Boston, Mass.
At 08 JUN 2018 09:32AM Donald Bakke wrote:
Ed - when you read the data from the template, are you writing this back to the document table right away or are you simply loading the record in memory? If you are writing to the table, how are you doing this?
At 08 JUN 2018 09:37AM Ed Keeman wrote:
Hi Don,
The writing to the table is done by the write event from a window.
The MFS is only putting the record in memory
Ed Keeman
At 08 JUN 2018 10:09AM bob carten wrote:
You might be able to have your MFS read, when you load from template, load the same record into the SI.MFS common variable OLD.REC
IIRC there was an old SENL article about this. [pre]COMMON /SI/MAX.UPDATE.SIZE,INDEXES,INDEXES.FILEVAR,NO.PROTECT,OLD.REC,OLD.FLAG,OLD.FV,OLD.ID,DICT.FVS%[/pre]
At 08 JUN 2018 10:09AM D Harmacek wrote:
Do all of those template fields loaded by the MFS appear as a control on the form? OI writes by field.
What I do is have EDITLINE for each and if user is not to change them I make them a single pixel square and hide them VISIBLE property = 0.
Dave Harmacek, Harmacek Database Systems, near Boston, Mass.
At 08 JUN 2018 10:16AM Donald Bakke wrote:
Bob - Wouldn't he want to clear that variable so the SI.MFS compare logic will detect the change?
At 08 JUN 2018 10:18AM Ed Keeman wrote:
I Agree with Don
Ed Keeman
At 08 JUN 2018 03:19PM bob carten wrote:
Me too.
![]()
BTW, in OI10 I added a program RTI_REGENEREATE_BANG_RECORD
RTI_REGEnerate_bang_record( filename, sourcemode)
parameters:
filename = name of the data table
sourceMode (optional) default to null
= 0 / null → remake the ! record in !FILENAME table
= 1 → remake the ! file, and the !! record in the !FILENAME table
= 2 → remake the !! record as a program named BANG_<FILENAME> in sysprocs, create a ! record in the !FILENAME table which calls BANG_FILENAME. The idea is to let you put a debug in the bang_filename program to watch it work so you can determine what is happening.