Uniface User Forum

 View Only
  • 1.  Updating large number of forms in batch?

    PARTNER
    Posted 02-08-2023 16:48
    We have over 300 reports that we would like to switch from Modal to Non-Modal so that we can add a "cancel" button to the main report menu and "kill" a long running report (e.g. through an asynchronous trigger)

    Is there a "bulk" / "batch" way we can do this (rather than going through every single form one by one?)  I know there used to be some "update Batch" method, but it's been about 20 years since I used it!


    Part #2 - is there a way to "blast" code into the ASYNC trigger for these same forms?

    Thanks,
    J. DeTurk​

    ------------------------------
    DeTurk Joanne
    Software Manager
    Mirion Technologies (Canberra), Inc.
    ------------------------------


  • 2.  RE: Updating large number of forms in batch?

    Posted 02-09-2023 11:33

    Under goto -> administration -> global updates - you can set the properties for updates as well as the retrieve profiles.
    Failing that - simply create a form with uform on it, set the fields / triggers you want and hey presto, done.
    (Remember to add the WRITE trigger to UFORM as it's never inclided in DICT.).
    Good luck, 

    Knut



    ------------------------------
    Knut Dybendahl
    ------------------------------



  • 3.  RE: Updating large number of forms in batch?

    ROCKETEER
    Posted 02-09-2023 12:01

    I just checked and these specific Window Properties of a component are apparently not covered by Global Updates. You probably could set them through the More Properties, but this will certainly delete any other properties that are defined (besides overlay and hide previous).

    The Window Properties are stored in the field WINPROP of UFORM (it is a Uniface list). If you would create your own routine that uses the meta dictionary then it certainly would be possible to do this. Please note that in Uniface 10 the attach property has been moved from WINPROP to a new field called ATTACHED. For details see Uniface 10: Repository Changes per Entity.

    It, however, might not be that straight forward to convert a modal into a non-modal component. If any code is defined after the edit statement in the Exec(ute) trigger/operation then with a modal form this will be executed after the user closes the form, but in case of a non-modal form the code will be executed right after the edit statement (without waiting). The runtime behavior will of course differ in case the code is executed at a different time. This is something you need to keep in mind and might need to change when converting the form(s) in question.

    Regarding part #2: this should be possible with the Global Updates in Uniface 9. You just have to keep in mind that global updates will overwrite any existing code in the Asynchronous trigger of the component. In Uniface 10 you would have to create your own routine that adds the code to the script container of the component (which is in the field USCRIPT.UFORM).

    In case you attempt to create your own update routine then make sure that you create a good backup of the existing components. When I need to do this then I usually do not commit any changes, but make first a backup of the unchanged component (using $ude "export"). I then modify the component and store the changes without a commit after which I make another export with the changes. In the end I do a rollback to get the original version of the component(s) back.

    I hope this helps.

    Daniel



    ------------------------------
    Daniel Iseli
    Principal Technical Support Engineer
    Uniface Services
    Rocket Software, Switzerland
    ------------------------------



  • 4.  RE: Updating large number of forms in batch?

    PARTNER
    Posted 02-14-2023 16:30

    I see that I forgot to mention that we are on Uniface 10.4



    ------------------------------
    DeTurk Joanne
    Software Manager
    Mirion Technologies (Canberra), Inc.
    ------------------------------



  • 5.  RE: Updating large number of forms in batch?

    Posted 02-10-2023 05:33

    part #2:

    Blasting code is easy using notepad ++

    Export to xml the reports you want

    do a search replace in notepad ++   

    it would be something like 

    find: trigger accept

    replace:  trigger async\n{code\n\ncode}\nend\n\ntrigger accept

    part #1: to literally change the modality... do the same 

    find CANRESIZE=T&uSEP;MODAL=T

    replace CANRESIZE=T&uSEP;MODAL=F

    ... and obviously fully backup and fully test



    ------------------------------
    Osman Shariff
    ------------------------------



  • 6.  RE: Updating large number of forms in batch?

    Posted 02-15-2023 09:57

    G'day Joanne,

    Having thought about what you're really trying to achieve - a way to break the execution of a report whilst running - 
    I'm not completely sure you could actually do it using the ASYNC trigger...

    If memory serves me right;

    The async trigger - when used - puts info into the keyboard buffer (structure editor) of the Uniface Application.
    That's the easy part.  You will not get to the structure editor until the current code stops executing - and that's
    the real problem.  When you're running a report, the code is just being executed until finished..  Then the ASYNC
    event 'bubbles' up...

    So, what can you do?

    In the past, I've implemented a process where the 'cancel' process writes to a table - and every 100/1000/x records
    processed in the report, I do a retrieve on the table (using component name and start time/userid).  If a record
    is indeed found, delete the record and terminate the report.

    I hope this helps.

    Regards,
    Knut



    ------------------------------
    Knut Dybendahl
    ------------------------------