Entity Framework 6 triggers and notify app with db changes - .net-core

I am relatively new to EF and I was tasked with researching Triggers within EF (using the EntityFrameworkCore.Triggered).
The scenario is this: a person has a handheld device (i.e. scanner) and scans a product into inventory. This action inserts the data into the SQL Server table.
As soon as that happens, I want another application to receive the notification so that another user can do his/her assigned task(s).
I thought EF Triggers would be able to do this rather than using SQLTableDependency.
Any advice/pointers?

Related

Repopulate Dropdown when database changes in asp.net mvc

Customer table has two fields : FullName And Gender
Lets say , I have dropdown customers. Customers is populated by fetching data from the customer table.
Now Lets I say I have two tabs open in the browser
1)You can perform CRUD functions on Customer table
2)Contains the customers dropdown and some other relevant data.
Performing a Crud operation in tab1 should automatically update the dropdown in the second tab without a refresh page.
How can I achieve this in asp.net mvc or asp.net ?
Like is it possible to bind my dropdown to a table change in asp.net ?
You need to make use of Web Sockets. This protocol keeps a TCP connection open between the server and the client and changes to the customer table can be sent to the client.
The good news is that Microsoft provides an implementation of Web Socket protocol called SignalR and that simplifies things a lot.

Multiple Questions about meteor pub/sub

I'm new to Meteor. I intend to add a new document to collection(client+server) and let the server pick the change. Then when i need to update my template with the sum total of all the inserts/updates/removes on the collection, i publish the collection from server and subscribe to it on client.
Once we publish something, can we subscribe, stop subscription and then subscribe again? I intend to subscribe only when the 'add document' button on client is pressed. In the function that processes such a click, I intend to insert, then call the method on server to publish and then subscribe. Is that a proper way of going about this?
Is there a way to simplify this? like i put the insert or update of a document in to the client side collection and just let Meteor deal with updating the server side collection and then updating the client side template?
It appears to me, from what little I learnt, that for some use-cases that I have, need publishing at each click. I've done this to update the reactive table to list the current folder's contents each time a folder is selected. So a Publish on server checks for contents in the collection for that folder as parent and returns it. Each new select of a folder means new publish. Can something be done to simplify this?
You're overcomplicating one of the core concepts behind Meteor: reactivity. Here are some clarifications to your 3 questions though:
This isn't something you need to worry about. Once you publish a
collection, or subset of your collection, it's published to all
connected clients. When you're subscribed to said publication, any
updates that are made are reactively pulled down to all connected
clients with that subscription. So if I add a document to a
collection I'm subscribed to, say a task list, it's going to be
reactively sent down to any client that's subscribed to it,
including my own.
Meteor has something called latency compensation which immediately
updates the user interface, and as long as it matches what the
server says, the insert appears to happen instantaneously. This
behavior is what Meteor does by default if you insert to a
collection from the client, as long as your insert is approved (i.e.
as long as the client has permissions to insert to that collection).
You don't need to republish every time. As long as you're publishing
the documents in the collection you need, and you're subscribed on
the client, any new documents that meet the criteria of your Mongo
selectors and return statements on the client will be available to
you and your UI will be updated automatically.

IBM BPM routing based on attributes

How can I route a task based on user attributes in IBM BPM 8.5.6?
In my case I have a list of attributes assigned to each users. For example a user will have an attribute called Region and this can have multiple values. So what we do is keep it as a comma separated string. Like REG1,REG2,REG3. Now when a task is initiated there will be a region associated with it. So I want this task to be routed to only those users who have that region value set.
I've created a team filter service and filter out a list of users. This works fine but the problem here is if we add a new user with appropriate region or add new regions to existing users these tasks are not visible to them. Is there any way to dynamically update the user list?
PS: I can create one group per region or one team retrieval service per region as there will be 100s of regions.
IBM BPM won't update the user repository all the time, there are certain events that will trigger an update:
http://www-01.ibm.com/support/knowledgecenter/SSFPJS_8.5.6/com.ibm.wbpm.admin.doc/topics/sync_users_and_groups.html
Quoting the article (because IBM articles may vanish at some point):
IBM Business Process Manager implicitly synchronizes external users and groups based on the following triggers:
Upon startup of a cluster member or server, all available groups (without members) are synchronized, so that all external groups are available for IBM BPM modeling and execution.
When a user logs in to a IBM BPM web application, such as Process Portal, for the first time, that user is created in the IBM Business Process Manager database.
When a new or existing user logs in to a IBM BPM web application, such as Process Portal, that user's full name and group memberships are updated. The groups the user belongs to are queried from the external user registry, and the IBM Business Process Manager database content is updated to reflect the current state.
When a REST call is triggered because a user that was newly registered in a federated repository (using an LDAP server) is not yet known to IBM Business Process Manager, synchronization of external users and groups with IBM Business Process Manager takes place. This synchronization is done only once.
You can also trigger synchronization via the process admin console or manually with usersSync or usersFullSync commands

Display SQL data row change using Signal R

I'm new to Signal R, My situation is below
User inserts new record into table database
There is a new notification displaying on web form
However the old notification is kept, the latest notification will be changed by other background color(Facebook or gmail) is an example.
Tech used: Asp.net 4.5 Web form and SQL server 2012.
Thanks

What are the approaches to trigger ASP.NET Website server side push

We are implementing Signalr to provide real time updates to browser clients. But we are curretnly stuck as we need to make http server itself (IIS+ASP) detect the changes from database and external services or from any other source without polling?
I believe this should be a common problem with all real time websites (irrespective of what technology is used for server side push SignalR, Comet or WebSync). Please provide what are general approaches used in such situations?
If you can, raise an event in whatever code is updating your database. Use that event to trigger the message publication.
Ready to update database -> Update database
-> Publish to WebSync
If you can't control the code updating your database, use the SqlDependency class. It lets you define a SELECT statement and then notifies you whenever the results of that query change. Use the notification event to trigger the message publication.
Update database -> SqlDependency -> Publish to WebSync

Resources