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
------------------------------
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
------------------------------
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
------------------------------
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 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
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
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?
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.
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
------------------------------
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.
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
------------------------------
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
------------------------------
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
------------------------------
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
------------------------------
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
------------------------------
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
------------------------------
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
------------------------------
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
------------------------------
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
------------------------------
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
------------------------------
I had read the manual a thousand times and had not paid any attention to this point.
This solution is great for me to do what I have in mind, since David's solution is very good too, but I have to have a phantom to launch the process every so often.
Kind regards,
------------------------------
Miguel Esteban Rodriguez Gonzalez
DataDealer Software España
------------------------------
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
------------------------------
The UniVerse fast trigger is a great solution.
It is too bad that submitRequest did not work for you.
Regarding cURL, there are things it can do that submitRequest cannot, so we developed a GCI library that links in libcurl so that all of its functionality is available to our applications.
Henry
------------------------------
Henry Unger
President
Pulsiam
Encino CA United States
------------------------------
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
------------------------------
------------------------------
DEAN ARMBRUSTER
Ferguson Enterprises, LLC
------------------------------
------------------------------
DEAN ARMBRUSTER
Ferguson Enterprises, LLC
------------------------------
I don't think those instructions are for UV.
Anyway, after testing the fast triggers through the indexed subroutine, it works perfectly for what I was looking for.
Thanks for the info.
Best Regards.
------------------------------
Miguel Esteban Rodriguez Gonzalez
INTERNATIONAL CONSULTANTS AND ASSOC
------------------------------
------------------------------
DEAN ARMBRUSTER
Ferguson Enterprises, LLC
------------------------------
Dean, that's genius!
I will have to add that to my list of tools! I did use PAUSE/WAKE once because I had to wait for phantom process to finish before I could continue. So I share my PID with the phantom and put myself into PAUSE mode. Then the phantom wakes me when it has finished processing.
David Green
The UniVerse fast trigger is a great solution.
It is too bad that submitRequest did not work for you.
Regarding cURL, there are things it can do that submitRequest cannot, so we developed a GCI library that links in libcurl so that all of its functionality is available to our applications.
Henry
------------------------------
Henry Unger
President
Pulsiam
Encino CA United States
------------------------------
hello Henri,
I read your company develop GCI library that links libcurl .
Are you authorized to share your experience ? Please write me on private.
with kind regards.
------------------------------
Manu Fernandes
------------------------------
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.