Scheduled tasks concept - scheduled-tasks

I am new to the scheduling.
I created a website with two buttons.
One for import data from text file to database.
Another one for joining data in excel and database.
Now what I want to do is
as every week, a new text file will be uploaded, I want to schedule so that my application import data to database every week.
How do I do it? I just need the concept.
What I think now is to schedule the server to make web request every week. Is this correct? Is there other better ways?

Related

SAPUI5 multiple users working on one table entry

I'm currently developing an application in the SAP BTP for multiple users. In the application you have one table where all responsibilities of a specific task are written down. These responsibilities may overlap between the users, which means that for one responsibility multiple users are mentioned.
In the application the users should click on either accept or reject if they still are responsible for this task. After they have given their feedback, they can click on a save button to write everything via a batch submit to the hana db. If they are not responsible anymore their name should be removed from the tasks and they should not see this task anymore.
The problem I am facing is that currently everything is stored in one database table and if one user gives feedback to some entries while another user works on the same entries, the user who saves his entries last will override the first one.
I have tried searching for a delta insert into the database or to live update after each user input or to lock the data when another user is currently working. But none of these seem to work fine, because users would still be able to override each others entries or they may lock some entries forever.
My question therefore is, what is the usual approach to manage multiple user inputs on a single table or is using a single table a bad practise at first?
My second question would be if sapui5 supports this approach or if I can handle this in another way?
You need to do server-side validation, before the save action.
UI5 does not support this directly, you can handle it by yourself.
Because we are stateless with ui5 / data you could use the draft concept
https://experience.sap.com/fiori-design-web/draft-handling/
Or something like already said backend logic with checks before safe.

How to deal with large ICS files?

My application (php/laravel, but irrelevant here) holds calendar entries for its users (comparable to a car logbook), and some users want to sync those events to their calendar app of choice. I started looking into the ics standard (RFC 5545 etc.) and created an endpoint that generates those files.
Problem: The files are getting huge. Some users have their entire driving history with hundreds and thousands of entries in the application, generating and transfering those MBs of ICS files will take ages (using php, anyways), let alone doing that everytime the calendar app tries to sync.
Question(s): What is the preferred way of dealing with huge ICS documents? HTTP headers and caching is one thing, but how do other people solve this problem? Just send events of the last year? Is there a (pagination?) spec that I haven't found yet?
This is historical data, so it is not going to change. You could offer batches by time period and cache the historical batches. Last years, or anything before the last 4 weeks, never gets updated for example. They do a one-off import of each historical batch into a separate 'driving history' calendar. No more subscribing? Or maybe they can only subscribe for the last month say?
One cannot import & subscribe into the same calendar, so it does mean they would have at least 2 calendars - 1 historical calendar used for imports, and 1 'current' that will update with yesterday's ride. Of course there is then manual effort for anyone who wants to always have the old data as when events fall off the 'current' calendar, at some point they'd have to go import the latest 'old' events.

Schedule refresh Tableau desktop 10.4 and schedule refresh at a particular day/time

I have couple of questions-
I have one workbook with 2 dashboards published on Tableau server-
One dashboard has Excel sheet as data source, which is located in the local system and other dashboard has an oracle DB as data source.
Questions-
1- If I schedule a full extract refresh at Midnight when my system is off, will the refresh be successful?
I understand irrespective of my system being ON/OFF the Data Base based refresh will not be a problem. what will happen to the overall dashboard refresh?
2- This is based on the Tableau desktop-
Below is the screen shot of Tableau desktop 10.4, how do I schedule the refresh on a particular date of the month? (For an example, I want to schedule a refresh on every 5th of the month at 4:00 am)
Similarly, i see the same on my Tableau Server as well.
As far as I remember until beginning of 2018, even Tableau 10.3 had a provision to schedule extract refresh in a customized manner, like select any date/day/time.
Please advise
I think this needs some clarification but if your Tableau instance is shutdown then extracts will not refresh. I am pretty sure they will not be queued up to run upon system boot up either. Server needs to be running at the time of the scheduled task for that task to run.
You can create this type of schedule as a site or server admin. The image you are showing will include the schedule you want but only after it has been setup.
go to schedules/new schedule:
Now when you go back to the schedule list you posted, you will see the new schedule under the name you give it in the setup screen.

Scheduled instance of report sending stale data

I have a scheduled instance emailing to a user. The instance works fine and user gets email. But the data in the report attached to the email is stale. It is missing item codes that do show up in the report if you go view it directly in web browser at BO server.
If I create a new instance scheduled to send to me - data looks up to date and good to go. If I add myself on the instance sending stale report and re-run the instance, I also get the stale version.
I'm worried about how whatever this is could be impacting other reports/users in the company without our knowledge. And also want to fix this one instance.
Is there some caching or other options that could be causing this? Why is the instance sending stale data?
Thanks!!
I figured this out. Turns out someone added record select formulas to the base report but did not re-create the scheduled instance. I looked at meta data from CI_INFOOBJECTS etc to see the record select formula on the instance. It does not match the updated record select on the base report.
This highlights a great best practice to keep in mind in this environment. KEEP YOUR FILTERS OUT OF CRYSTAL REPORTS! Keep your record selection and data transform logic inside SQL server in stored procs or views. That way you can update your report filter criterias without have to re create every scheduled report instance after every little report change :)

Core Data syncronization procedure with Web service

I'm developing an application that needs to be syncronized with remote database. The database is connected to the a web-based application that user able to modify some records on the web page.(add/remove/modify) User also able to modify the same records in mobile application. So each side (server - client) must be keep the SAME latest records when an user press the sync button in mobile app. Communication between server and client is provided by Web Serives.(SOAP) and i am not able to change it because of it is strict requirements. (i know this is the worst way that can be used). And another requirement is the clients are not able to delete the server records.
I already be familiar with communicating web service (NSURLConnection), receiving data (NSData) and parsing it. But i could not figure out how the syncronization procedure should be. I have already read this answer which about how i can modify server and client sides with some extra attributes (last_updated_date and is_sync)
Then i could imagine to solve the issue like:
As a first step, client keeps try to modify the server records with sending unsyncronized ones. New recoords are directly added into DB but modified records shoud be compared depending on last_updated_date. At the end of this step, server has the latest data.
But the problem is how can manage to modify the records in mobile app. I thought it in a two way:
is the dummiest way that create a new MOC, download all records into this and change with existing one.
is the getting all modified records which are not in client side, import them into a new MOC and combine these two. But in this point i have some concerns like
There could be two items which are replicated (old version - updated version)
Deleted items could be still located in the main MOCs.
I have to connect multiple relationships among the MOCs. (the new record could have more than 4 relationships with old records)
So i guess you guys can help me to have another ideas which is the best ??
Syncing data is a non-trivial task.
There are several levels of synchronization. Based on your question I am guessing you just need to push changes back to a server. In that case I would suggest catching it during the -save: of the NSManagedObjectContext. Just before the -save: you can query the NSManagedObjectContext and ask it for what objects have been created, updated and deleted. From there you can build a query to post back to your web service.
Dealing with merges, however, is far more complicated and I suggest you deal with them on the server.
As for your relationship question; I suggest you open a second question for that so that there is no confusion.
Update
Once the server has finished the merge it pushes the new "truth" to the client. The client should take these updated records and merge them into its own changes. This merge is fairly simple:
Look for an existing record using a uniqueID.
If the record exists then update it.
If the record does not exist then create it.
Ignoring performance for the moment, this is fairly straight forward:
Set up a loop over the new data coming in.
Set up a NSPredicate to identify the record to be updated/created.
Run your fetch request.
If the record exists update it.
If it doesn't then create it.
Once you get this working with a full round trip then you can start looking at performance, etc. Step one is to get it to work :)