Handling simultaneous action - wicket

I have a GUI screen which consist of 2 buttons, Check Balance and Create Saving. Once any user enters the customer ID and click on 'Check Balance' , details of the customer including their balance will be shown and simultaneously 'Create Saving' button will be enabled(after clicking on 'Check Balance' button as initially it will be disabled).
I have an scenario which i will try to explain with an example :
There are 2 users X & Y, who have logged in at the same time, and have clicked the "Check Balance" at the same time for a customer Id say 12345. Both see customer balance including some more details about customer and the "Create Saving" button is enabled for both of them.
User X decides to take a break, and does not create a Saving, but User Y creates a Saving.
User X comes back and click on the "Create Saving" button. **Now the question is how the X should be allowed to see updated value ? (OR) a Check Balance should be forced to X (OR) a warning message should be shown for X to check Balance ? **
every time a saving is created, technically "Check Balance" are always invoked, thus always refreshed values are considered before creating a saving in the back end. In the above scenario, though the User X sees outdated value in the screen, the saving is always created considering the saving created by User Y.
Any suggestion will be much appreciated.Thanks.

when you click on "Create Saving" you could send the outdated amount or a timestamp indicating when it was retrieved. Then on server side when "Check Balance" is invoked you could check if the actual amount has changed and if so, you might redirect user to an intermediate page informing him/her and asking if the saving operation should be aborted or not.
Hope this could help.

Related

Can Google Workspace Alert Center be used with Email Log Search?

Is there a way to create an Alert Center notification based on criteria returned in the Google Workspace Email Log Search?
For example..
If an email address sends a message to 1000+ recipients or sends 1000 messages to 1000 recipients...
We already see the System Defined alert center actions if say... someone flags a message as phishing, but we want to create a triggered alert rule based on the count of messages.
Thanks in advance.
This can be done using the Investigation tool found at ‘Security’ > ‘Investigation Tool’ Be advised this is a feature available for these editions: Enterprise; Education Standard and Plus as documented here
Basically what you are looking to do is build a query like this:
Data Source = Gmail Log Events
With Conditions Below:
Event Is User spam classification
AND
Spam classification Is Phishing
Like this
Then:
Click on the three dots at the top right, next to the bin icon.
Click on ‘Create activity rule’
Add a name + description. Click on ‘Next: View conditions’
Click on ‘Next: Add Actions’
Select the time window: 24hrs o 1hr
Scroll down and set the threshold desired and configure it (basically after how many incidents this will be triggered)
Add a desired action, eg. Send to quarantine, etc.
Select the severity of this rule
Check the box to ‘Send to alert center’
10.Configure Email Notifications.
11.Click on ‘Next: Review’ and make sure it is set to ‘Active’
12.Finally click on ‘Create Rule’
Keep in mind this may take some propagation time of up to 48hrs. For more information on the Investigation Tool see here
Unfortunately the way the Alert Center works would not allow an integration with the Email log search.
They both work on a different way, the Alert center has his own set of parameters to determine the severity, while the Email log search works like a direct tool to audit the data manually.
I believe the best available option to create rules and get notifications an alerts while using the Alert Center dat, is the Investigation tool which is only available with certain versions, check it!

How can we get an alert when Designer workflow is suspended or terminated

I need to create an alert(preferably configured mail) whenever my SharePoint designer workflow(2013) is suspended due to some error.
Thanks in advance.
Navigate to the Workflow History list in your site (it may be hidden from the Site Contents view, but you can always type in the URL directly <<yourbasesiteurl>>/lists/Workflow%20History/).
Create a view on this list filtered where the Status column is not equal to "In progress", and is not equal to "Completed"
Subscribe to alerts on this View

Using same id (not active one)

I've got an issue with a button.
I've got clients, and these all have a number ( Clients:: ClientID). Now I want to make a button in another form and send the active clientID to another application which will use this clientID to display information in that application about that client.
Now I've made a button with the open URL which contains following code snippet:
"http://localhost:12345/showClientFile?clientid=" & Clients::ClientID
When I click the button in viewlayout, the application always (no matter which record I'm in) the same clientID and not the clientID from the record that I'm in. When I check the URL in the browser, it is also that same id constantly. Am I missing something?
If you're on a layout that isn't linked to the Clients table occurrence, then there must be a relationship from whichever TO your layout is linked to to the Clients table. Otherwise you wouldn't see any value for Clients::ClientID.
You say you want to send the "active clientID". How do you, or the system, know what the active clientID is? Is it stored in a global variable, as in $$_ACTIVE_CLIENT_ID, or perhaps a global field, Clients::g_active_client_id? When you can say to yourself, "When I want to know what the active client ID is, I look here," then you know what will need to be done to edit the URL calculation.
"http://localhost:12345/showClientFile?clientid=" & $$_ACTIVE_CLIENT_ID

GWT panel fields data refresh delay on slow internet

I am using GWT 2.5.1.
In my GWT web app I have a ComplexPanel object which contains a set of fields(widgets). There are a suggested field (on panel) which gives me the opportunity to find object and info about it. Fields (10-15 of them) contain info about that object.
The problem is when user (client side) has a slow internet connection, fields on form are updated with a delay. And if in moment of delay user click 'Save' button (AsyncCallback), old data (which is not updated) posted to the server.
How it works:
1. Server receive callback from the form and start to processing the data.
2. Server refresh all the fields with new data and end the works.
3. Javascript updating the data on form using about 10 requests.
But: internet is slow and one part of data is refreshed and other no.
4. User click SAVE and mixed data goes to the server.
I need to know (from server side) when all the field are refreshed on client side and server can proceed with a next post request.
Thanks in any advice.
Perform a validation check on click of the save button. There are several things you can do as per your requirement. I have listed one way to validate it.
Set a flag before making the async call as false. For instance, isLoaded = false
Once you have all the fields just update it to true, i.e. isLoaded = true
On save button handler check for isLoaded flag. If false, prompt a message, else save.
Update:
You can count the number of response received. You know that you will get 10 response. So for every response received increment a counter. Activate save only if you have all 10 response recieved.
For a clean way to do this, use gwt-async-future.

a coupon (unique code) for a like clicked. what is the best way

The unique code is given to whoever clicked like (only the first time he clicks)
in order to make sure that he is not going to have a unique code again. I have to have his fb id in my database, but I read that it is impossible to know the fb id of someone who clicks like. Is there a solution?
If the like button will be on my fun page, is it possible then?
I have already all the process of generating the unique code, and checking in my db if the code was used or know, I only have to keep in my db also the fb id to make sure he will not get more then once.
Create fangate (differentiate likers non-likers).
Is is_liker get user id with basic permissions.
On return after accepting the permission request check if user already got code.
If user never got code give him. Else display error message.