Miguel,
The subject of index-based subroutines is covered in the UniVerse System Description manual under the chapter for File Triggers for your reference.
The principal for you would be this
....
Create a dictionary on your file as below
MIG.TEST
0001 I
0002 SUBR("MIG.INDEX.SUB")
0003
0004
0005 10L
0006 S
>CREATE.INDEX MIG.FILE MIG.TEST NO.NULLS
The MIG.INDEX.SUB will look like this
SUBROUTINE MIG.INDEX.SUB(RTN.VAL)
COMMON /MIG.SIB/ MIG.INIT, ...
RTN.VAL = ""
IF NOT(MIG.INIT) THEN
*** Open Files to be used and stored in named common
....
MIG.INIT = 1
END
*** Your Code
....
RETURN
END
Regards,
Jonathan
------------------------------
Jonathan Smith
UniData ATS and Principal Engineer
Rocket Software
------------------------------
Original Message:
Sent: 04-16-2021 04:21
From: Miguel Esteban Rodriguez Gonzalez
Subject: Triggers Universe - DOS Command Execute
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
Original Message:
Sent: 04-16-2021 04:09
From: Jonathan Smith
Subject: Triggers Universe - DOS Command Execute
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
Original Message:
Sent: 04-16-2021 04:02
From: Miguel Esteban Rodriguez Gonzalez
Subject: Triggers Universe - DOS Command Execute
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
Original Message:
Sent: 04-15-2021 13:12
From: Henry Unger
Subject: Triggers Universe - DOS Command Execute
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
Original Message:
Sent: 04-15-2021 12:05
From: Miguel Esteban Rodriguez Gonzalez
Subject: Triggers Universe - DOS Command Execute
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
Original Message:
Sent: 04-15-2021 11:43
From: Henry Unger
Subject: Triggers Universe - DOS Command Execute
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
Original Message:
Sent: 04-15-2021 11:12
From: Miguel Esteban Rodriguez Gonzalez
Subject: 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
------------------------------