Skip to main content
Miguel Esteban Rodriguez Go
Participating Frequently
Apr 15, 2021 11:12 AM UTC

Triggers Universe - DOS Command Execute

Hi there,

I've been looking for a long time, how to execute the 'DOS' command in a trigger in Universe.
I have seen in some forum, that they indicated to add an 'H' in attribute 4, in the VOC DOS of the UV account.
I have tried this and it does not work, since when firing the trigger and executing the DOS command in the subroutine, I get this message:

Program "ED": pc = 744C, Verb "DOS" illegal when a transaction is active.
Program "ED": pc = 744C, Error performing trigger for "XXXXXXXX".
Failed to file "20451390" in file "XXXXXXXX". STATUS = 2

Has anyone had the same problem of being able to run Verb on triggers?

Thanks and best regards

------------------------------
Miguel Esteban Rodriguez Gonzalez
DataDealer Software España
------------------------------

    17 replies

    Henry Unger
    Participating Frequently
    Apr 15, 2021 11:44 AM UTC
    Hi there,

    I've been looking for a long time, how to execute the 'DOS' command in a trigger in Universe.
    I have seen in some forum, that they indicated to add an 'H' in attribute 4, in the VOC DOS of the UV account.
    I have tried this and it does not work, since when firing the trigger and executing the DOS command in the subroutine, I get this message:

    Program "ED": pc = 744C, Verb "DOS" illegal when a transaction is active.
    Program "ED": pc = 744C, Error performing trigger for "XXXXXXXX".
    Failed to file "20451390" in file "XXXXXXXX". STATUS = 2

    Has anyone had the same problem of being able to run Verb on triggers?

    Thanks and best regards

    ------------------------------
    Miguel Esteban Rodriguez Gonzalez
    DataDealer Software España
    ------------------------------

    Hi Miguel,

    As you have seen, UniVerse does not permit you to invoke the operating system shell from within a UniVerse trigger, which is what executing "DOS" will do. I can think of a lot of reasons why that is the case, including what would happen to the transaction if the command being invoked crashes or otherwise aborts.

    What are you trying to do in the trigger that cannot be done in BASIC?

    Henry



    ------------------------------
    Henry Unger
    President
    Pulsiam
    Encino CA United States
    ------------------------------
    Miguel Esteban Rodriguez Go
    Participating Frequently
    Apr 15, 2021 12:06 PM UTC

    Hi Miguel,

    As you have seen, UniVerse does not permit you to invoke the operating system shell from within a UniVerse trigger, which is what executing "DOS" will do. I can think of a lot of reasons why that is the case, including what would happen to the transaction if the command being invoked crashes or otherwise aborts.

    What are you trying to do in the trigger that cannot be done in BASIC?

    Henry



    ------------------------------
    Henry Unger
    President
    Pulsiam
    Encino CA United States
    ------------------------------
    Hi Henry,

    I am trying is to execute a request to send a json to a WebService.

    With the DOS command, I invoke the cURL to make the request, from a .bat.

    This works correctly from a subroutine that is not associated with a triggers, but I no longer have the process running in a single instance and I would have to link it to each affected screen of the application, so I would have to be replicating the code.

    I was convinced that the transactions in the triggers or in certain commands could be deactivated by modifying attribute 4 of the VOC in the UV account, but I see that it cannot.

    Miguel.


    ------------------------------
    Miguel Esteban Rodriguez Gonzalez
    DataDealer Software España
    ------------------------------
    David Green
    Inspiring
    Apr 15, 2021 12:25 PM UTC
    Hi Henry,

    I am trying is to execute a request to send a json to a WebService.

    With the DOS command, I invoke the cURL to make the request, from a .bat.

    This works correctly from a subroutine that is not associated with a triggers, but I no longer have the process running in a single instance and I would have to link it to each affected screen of the application, so I would have to be replicating the code.

    I was convinced that the transactions in the triggers or in certain commands could be deactivated by modifying attribute 4 of the VOC in the UV account, but I see that it cannot.

    Miguel.


    ------------------------------
    Miguel Esteban Rodriguez Gonzalez
    DataDealer Software España
    ------------------------------

    I have found the best practice with triggers is to write out your commands to a tickler file.  Then phantom process can go through the tickler file and execute the commands.

     

     

    David A. Green

    DAG Consulting

     

     


    Miguel Esteban Rodriguez Go
    Participating Frequently
    Apr 15, 2021 12:48 PM UTC

    I have found the best practice with triggers is to write out your commands to a tickler file.  Then phantom process can go through the tickler file and execute the commands.

     

     

    David A. Green

    DAG Consulting

     

     


    Hi David,

    A tickler file?
    You mean one of the bat type?
    I honestly don't know what the tickler files are.



    ------------------------------
    Miguel Esteban Rodriguez Gonzalez
    DataDealer Software España
    ------------------------------
    David Green
    Inspiring
    Apr 15, 2021 1:01 PM UTC
    Hi David,

    A tickler file?
    You mean one of the bat type?
    I honestly don't know what the tickler files are.



    ------------------------------
    Miguel Esteban Rodriguez Gonzalez
    DataDealer Software España
    ------------------------------

    A tickler file is just a UV file.  One that holds your commands.  The id is usually code.date.time so that this file can be used by many processes.  Then your phantom would select the file based on code sorted by date and time in order to execute your commands in the same order in which they were written to the UV file.

     


    Henry Unger
    Participating Frequently
    Apr 15, 2021 1:13 PM UTC
    Hi Henry,

    I am trying is to execute a request to send a json to a WebService.

    With the DOS command, I invoke the cURL to make the request, from a .bat.

    This works correctly from a subroutine that is not associated with a triggers, but I no longer have the process running in a single instance and I would have to link it to each affected screen of the application, so I would have to be replicating the code.

    I was convinced that the transactions in the triggers or in certain commands could be deactivated by modifying attribute 4 of the VOC in the UV account, but I see that it cannot.

    Miguel.


    ------------------------------
    Miguel Esteban Rodriguez Gonzalez
    DataDealer Software España
    ------------------------------

    Hi Miguel,

    Have you considered using submitRequest to send the JSON to a web service? I haven't tried it from a trigger but we do use submitRequest to send JSONs all the time.

    Henry



    ------------------------------
    Henry Unger
    President
    Pulsiam
    Encino CA United States
    ------------------------------
    Miguel Esteban Rodriguez Go
    Participating Frequently
    Apr 16, 2021 3:49 AM UTC

    A tickler file is just a UV file.  One that holds your commands.  The id is usually code.date.time so that this file can be used by many processes.  Then your phantom would select the file based on code sorted by date and time in order to execute your commands in the same order in which they were written to the UV file.

     


    Hi David,

    I had not thought about it, but it is a great idea, since although the request has to be done in real time, I can leave the phantom scheduled to run in short intervals of time.

    Thanks David for clarifying a lot for me an alternative solution to the problem that triggers represent in UV.


    ------------------------------
    Miguel Esteban Rodriguez Gonzalez
    DataDealer Software España
    ------------------------------
    Miguel Esteban Rodriguez Go
    Participating Frequently
    Apr 16, 2021 4:03 AM UTC

    Hi Miguel,

    Have you considered using submitRequest to send the JSON to a web service? I haven't tried it from a trigger but we do use submitRequest to send JSONs all the time.

    Henry



    ------------------------------
    Henry Unger
    President
    Pulsiam
    Encino CA United States
    ------------------------------
    Hi Henry,

    The problem is that submitrequest in UV does not communicate correctly with many of the webservices that I have to invoke.

    In many of them, the communication returns in 3 or in other cases, it does not return the response from the webservice.

    For this reason, it has been more than two years since we have changed the communication engine in our application by invoking the cURL, with satisfactory results in 100% of the cases.

    It is a pending task for Rocket Software to improve the behavior of triggers, since they offer a high potential for the execution of processes that affect specific files.

    Thanks anyway for your comment.


    ------------------------------
    Miguel Esteban Rodriguez Gonzalez
    DataDealer Software España
    ------------------------------
    Jonathan Smith
    Rocketeer
    Apr 16, 2021 4:09 AM UTC
    Hi Henry,

    The problem is that submitrequest in UV does not communicate correctly with many of the webservices that I have to invoke.

    In many of them, the communication returns in 3 or in other cases, it does not return the response from the webservice.

    For this reason, it has been more than two years since we have changed the communication engine in our application by invoking the cURL, with satisfactory results in 100% of the cases.

    It is a pending task for Rocket Software to improve the behavior of triggers, since they offer a high potential for the execution of processes that affect specific files.

    Thanks anyway for your comment.


    ------------------------------
    Miguel Esteban Rodriguez Gonzalez
    DataDealer Software España
    ------------------------------
    Miguel,

    Have you tried using an indexed subroutine (aka fast triggers) to do this ?

    You can create an index on the file with the NO.NULLS option and then use the indexed subroutine to run your code and then set the index value to null which means no index update actually takes place but the code in the indexed subroutine is run.

    If you need more details on the indexed subroutines let us know.

    Thanks,
    Jonathan

    ------------------------------
    Jonathan Smith
    UniData ATS and Principal Engineer
    Rocket Software
    ------------------------------
    Rocket Software - Senior Principal Technical Support Engineer - UniData ATS
    Miguel Esteban Rodriguez Go
    Participating Frequently
    Apr 16, 2021 4:21 AM UTC
    Miguel,

    Have you tried using an indexed subroutine (aka fast triggers) to do this ?

    You can create an index on the file with the NO.NULLS option and then use the indexed subroutine to run your code and then set the index value to null which means no index update actually takes place but the code in the indexed subroutine is run.

    If you need more details on the indexed subroutines let us know.

    Thanks,
    Jonathan

    ------------------------------
    Jonathan Smith
    UniData ATS and Principal Engineer
    Rocket Software
    ------------------------------
    Hi Jonathan,

    The truth is that I did not know about the existence of these indexed subroutines or aka fast triggers.

    If you can give me more information to know its functionality, I would be very grateful.

    Kind Regards,


    ------------------------------
    Miguel Esteban Rodriguez Gonzalez
    DataDealer Software España
    ------------------------------