Hey,

I have a requirement to implement that requests me to add a 3 new columns to the database, and then set the values of them automatically. 

I can not use the default values as there is business rules to them. I could use a sql script, but i don't have access to the database. so i willing to create a timer, and set its schedule to run on publish or something like that, but then i will end up with garbage on my application.

Is there any way automatically disable the timer after it has run, without further logic to check if it has run, just disable it? 

(Ideally it would be like run then disappear from the code :p ) 

Best Regards.


Solution

Hi Domingues, 

As you have all the info about the timers in system tables, like Meta_Cyclic_Job, yes, you can disable it. 

Just not sure this is the best way of doing it. 

Probably I would not schedule the timer and include the timer run in the deployment process, to be executed manually. 

Anyway, this will probably cause problems if the application becomes immediately available after deployment, as the timer may not execute or finish before the application is used. 

Also, if the business values are "default" as in they will not change based on other values, you can setup the new attributes default values to them, avoiding the need to fix data. 

Cheers 

Solution

Hi, 

Do you use external database?

I do this when add column to external db:

1. add the columns in database editor

2. integrate the external table using outsystems database integration studio

3. refresh the dependency to that external entity in each module


The best application is a result of team work, developer, db admin, nw admin, etc. 

You cannot have good application if work selfishly.

regards

Eduardo Jauch wrote:

Hi Domingues, 

As you have all the info about the timers in system tables, like Meta_Cyclic_Job, yes, you can disable it. 

Just not sure this is the best way of doing it. 

Probably I would not schedule the timer and include the timer run in the deployment process, to be executed manually. 

Anyway, this will probably cause problems if the application becomes immediately available after deployment, as the timer may not execute or finish before the application is used. 

Also, if the business values are "default" as in they will not change based on other values, you can setup the new attributes default values to them, avoiding the need to fix data. 

Cheers 

I Can not use the default value, because the starting values are depending on business rules, meaning that for each record. That's why i opted for the timer. 

I have 2 concern:
           1 is to assure that the values are settled before users start to using the application, since there are calculations based on these new values, and i don't want user to user wrong values on those calculations, and that would be a mess (That's why i was thinking about the use of the on publish schedule).

           2 is to assure that the timer only run once, i don't want to  have values reset accidentally by running the timer again. And i didn't wanted to rely on human intervention just because people forget. :) 


I guess i was just hopping for a Timer_disable, like a timer_wake, do not feel that comfortable to dive into the system tables. i've done it on the past, and it work, but is a lot trouble to go, for the use case i need.

Br

Hi, 

Related to 1, you may choose to do the deply in two steps: first you add the attributes and execute the logic to fill the values. 2 you deploy the code that will use the new information. 

The alternative is to keep the app offline while updating database. 

For 2, you may check if there is any API that allows you to disable a timer. It is possible, but I don't know by head. The documentation page has references to the APIs available to be used. You can also run the timer manually, maybe from a different module and remove it later. But I don't think this will be possible without human intervention. To avoid problems the module where the timer is should really be removed. 

Cheers