$04 Suppressing OK message

Ben Price ben at clintelsystems.com
Mon Jun 27 02:30:24 EDT 2016


Hi Vik,

That is what I am doing (my sql is designed for multiple omnis 
instances) but my cluster consists of 1 (due to licensing).  I am using 
a program called troupware CRP (tried Restart On Crash but it crashes 
Omnis when it checks if application is running) which keeps my Omnis 
instance(s) up and running while there are more records without an 
updated PDF document snapshot.

All of this to ensure custom windows / reports are printed to a snapshot 
before custom windows / reports are modified.


After is is finished it deletes this server function and reverts back to 
the original desktop app.


All the best,

Ben Price
Software Engineer
p: (08) 8203 0550



On 27/06/2016 15:26, Vik Shah wrote:
> Hi Ben,
>
> Another way to approach this would be to duplicate the library and have a few omnis installations as print servers only.
>
> A few lines in the startup class identifies the library’s role (print server or not) and that way once they finish generating the x number of PDF’s the omnis engine quits and fires up again (in a bash script or something) and is ready to take on another volume of print jobs.
>
> Drop me a line off the list if you’d like me to elaborate on this idea.
>
> Regards,
>
> Vik Shah
> Director
> Keys2Solutions
> AU: +61 411 493 495
> SE: +46 21-495 01 05
> US: +1 (415) 413 4172
>
>> On 27 Jun 2016, at 10:43 AM, Ben Price <ben at clintelsystems.com> wrote:
>>
>> Hi Marten,
>>
>> I understand your concern. Doing a find replace on all classes in an 25mb Omnis library caused instability within instantiated objects (as code base changes behind them) causing Omnis to crash.
>>
>> Replacing 3000 OK box lines to a custom method when all options are used and different is a lengthy task which managers do not want to invest in. I do agree best practice would be to do your suggestion.
>>
>> My solution was to make a duplicate library (programmatically) do a find and replace on all classes in duplicate library as well as changing the library $startuptaskname so on launching the duplicate library only my procedure runs. After procedure is finished it relaunches the main library (which deletes the duplicate)
>>
>> It is not pretty but it was quick to implement.
>>
>> It has also helped me get around Omnis "Out of Memory" error which seemed to occur after reading / updating more than 1000 pdf snapshots through the Omnis studio 4 Postgres driver. (I seem to be getting a memory leak)
>>
>> Old list posts suggest doing this in batches of 500 records, before restart (or update your Omnis studio to a newer version - which i am unfortunately unable to do)
>>
>> So I am using an external program to launch Omnis if it is not running. This allows Omnis to processes 500 records before closing which is stopping if from crashing.
>>
>> -- 
>> All the best,
>>
>> Ben Price
>> Software Engineer
>> p: (08) 8203 0550
>>
>>
>> On 23/06/2016 22:29, Marten Verhoeven wrote:
>>> Hi Ben,
>>>
>>> First of all: I don't think you should do this at all. It is bad code because you are building a quick and dirty solution. If you often use these solutions your code will get really hard to maintain and expand. The proper way to do things is to separate the functionality from the user interface. You call the functionality from the user interface (and show dialogs there when needed), or you call the functionality from your automation routines. You are better off investing your time in such a cleaner design.
>>>
>>> That said: you cannot prevent the built in message boxes from popping up, but you can when you use your own message box. If you wrap this message box in your own message object, you can create some kind of global flag which tells the object to suppress all messages (and therefor will not show them when you set the flag at the start of your automation procedure).
>>>
>>> And the nice thing of Omnis is: you can easily create a function which replaces all use of the built in message boxes with your own implementation. I did the exact same thing when I wanted to change the message box design and wanted to implement multi language support. The function I created went through all of my source code and replaced the built in message boxes, extracted all texts from it and created proper string-tables to access them. From then off you have your own implementation so it is easy to add functionality to it (for example have a button to specific help pages when an error occurs).
>>>
>>> With kind regards,
>>>
>>> Marten Verhoeven
>>>
>>>
>>> -----Oorspronkelijk bericht-----
>>> Van: omnisdev-en [mailto:omnisdev-en-bounces at lists.omnis-dev.com] Namens Ben Price
>>> Verzonden: vrijdag 17 juni 2016 8:05
>>> Aan: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
>>> Onderwerp: Re: $04 Suppressing OK message
>>>
>>> Hi List,
>>>
>>> I think I have found a solution but it's not pretty (an elegant solution would be preferable) and I hope my interpretation of $findreplace using regex works!
>>>
>>> On loading my automated task I can loop through all $clib.$classes and call $findreplace('^.*OK Message.*$','^;.*OK Message.*$',ktrue,kfalse,
>>> ktrue) on each class which should comment them all out.
>>>
>>> At the end of task I can then  $findreplace('^;.*OK Message.*$','^.*OK Message.*$',ktrue,kfalse, ktrue) to put them all back.
>>>
>>> --
>>> All the best,
>>>
>>> Ben Price
>>> Software Engineer
>>> p: (08) 8203 0550
>>>
>>>
>>> On Fri, Jun 17, 2016 at 3:12 PM, Ben Price <ben at clintelsystems.com <mailto:ben at clintelsystems.com>> wrote:
>>>
>>>      Hi List.
>>>
>>>      I have written a automated process which opens up windows and prints
>>>      records, but on any one of the windows an OK box may be presented to
>>>      the user if the data or setup for the data is incorrect.
>>>
>>>      Is there any way in Omnis 4 to be able to suppress OK messages so
>>>      automated process to operate without user intervention?
>>>
>>>      --
>>>
>>>      All the best,
>>>
>>>      Ben Price
>>>      Software Engineer
>>>      p: (08) 8203 0550
>>>
>>>      _____________________________________________________________
>>>      Manage your list subscriptions at http://lists.omnis-dev.com
>>>
>>>
>>> _____________________________________________________________
>>> Manage your list subscriptions at http://lists.omnis-dev.com
>>>
>>> _____________________________________________________________
>>> Manage your list subscriptions at http://lists.omnis-dev.com
>>
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com
>
>
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com

-- 




More information about the omnisdev-en mailing list