Questionnaire Application on Corda - corda

I am Just learning about Corda. I have seen a couple of tutorials(IOU). Now i was looking to built a simple Questionnaire Application on Corda. I am not able to figure it out where to start with.
Lets say there are 10 Users on the network. One user creates a Questionnaire with 3 questions and now this Questionnaire must be visible to all the other users in the network. Now only 5 users respond to that Questionnaire and submit there response. Now these responses are shared with the user who created that Questionnaire.
What should be the flow and how to write the contract ?
Please help me out here.
Thanks in advance !!

You could use sendAndReceive() (here the documentation and a Cordapp example on github) to send the Questionnaire and receive the answer from the participants. Remember that the SendAndReceive() expects an answer and if the responder does not reply, the node who started the flow will wait forever. So, the key here is to always send a response back. Up to you to design it as you prefer.

Related

Schedule a conditional email message with Akka.Net

I need to implement the following logic - I send a message to the user, and if he doesn't reply, I send it again after 12 hours.
I wonder what is the best way to do this? I was thinking about using Akka.NET - after a certain amount of time the actor would check if the user replied to my message and if not, would send it again.
Is there maybe an easier way? If not, there are some questions for Akka.NET
Do you know any good sources where I can see how this library should be used in ASP.NET Core? The documentation is not clear enough for me.
Where to keep the actors and the logic associated with them? In a separate project? Where can I create an actorSystem?
I'm new to this topic, thank you in advance for all the answers.
I theory you could just use standard actor system schedule a message order to resend an email after 12h, but this has natural problems with a fact, that if your process will crash, all of its in-memory state will be lost.
In practice you could use one of two existing plugins, which give you durable schedules:
Akka.Persistence.Reminders which works on top of Akka.Persistence, so you can use it on top of any akka.net persistence plugin.
Another way is to use Akka.Quartz.Actor which offers dedicated actors on top of Quartz.NET and makes use of Quartz's persistence capabilities.

Delay Queue for amount of time per session

I'd like to create a system that 'appends' mails to each other.
Situation: Everytime an entity is changed I'd like to send a mail to subscribers of that entity.
But when the entity is changed 10 times on a small time (like 5 / 10 minutes) the subscribers don't need to be spammed with emails.
So I was thinking of creating a 'Queue'. And to be more precise I was thinking about using the Azure Servicebus.
After searching some of the documentation. I found two interesting properties.
SessionId => Would be the entity of the Id
BatchFlushInterval (Client-side batching)
'If the client sends additional messages during this time period, it transmits the messages in a single batch'
This sounded perfect.
In this way I recieve all the 'changes of the entity' in a single batch. And could construct a single e-mail to send.
But I don't seem to find this option anymore in the new "Azure Service Bus NuGet".
Now that I searched for alternatives, I have a feeling this is not a 'normal' practice.
Does someone have some experience in this field?
I would like to avoid having to use a cron job. But if this is the best solution please let me know.
I know this a really broad question and more a 'need for information'. So commenting with links can already make me real happy.
Thanks in advance
Brecht
Don't think Message Sessions or BatchFlushInterval is the approach to take here. What you're looking for is to buffer messages to create a single notification rather than multiple ones. I'd personally go with receiving a batch from the Azure Service Bus and process the batch to "append" notifications.

Are groups classed as static data within SignalR?

I am looking over SignalR as a possible way to manage messaging between clients on a web application. The scenario would be that one person would create a session/room, and a few other people would join it. Then everyone within that room would send messages to each other. A lot like a chat room however they would be sending variable update messages etc.
Now I keep seeing it said that static variables should not be used, which I completely agree with, but if it creates a new Hub (I am planning to use a hub due to the different types of messages) each request, how does it store the group each client is in?
I suggest you review the project's source code here. This project has been very good as you wanted.
https://github.com/davidfowl/JabbR
https://github.com/davidfowl/JabbR/blob/master/JabbR/Hubs/Chat.cs
Also you can look at here the title "Calling methods on specific clients or groups".
https://github.com/SignalR/SignalR/wiki/Hubs

Pattern for long running tasks invoked through ASP.NET

I need to invoke a long running task from an ASP.NET page, and allow the user to view the tasks progress as it executes.
In my current case I want to import data from a series of data files into a database, but this involves a fair amount of processing. I would like the user to see how far through the files the task is, and any problems encountered along the way.
Due to limited processing resources I would like to queue the requests for this service.
I have recently looked at Windows Workflow and wondered if it might offer a solution?
I am thinking of a solution that might look like:
ASP.NET AJAX page -> WCF Service -> MSMQ -> Workflow Service *or* Windows Service
Does anyone have any ideas, experience or have done this sort of thing before?
I've got a book that covers explicitly how to integrate WF (WorkFlow) and WCF. It's too much to post here, obviously. I think your question deserves a longer answer than can readily be answered fully on this forum, but Microsoft offers some guidance.
And a Google search for "WCF and WF" turns up plenty of results.
I did have an app under development where we used a similar process using MSMQ. The idea was to deliver emergency messages to all of our stores in case of product recalls, or known issues that affect a large number of stores. It was developed and testing OK.
We ended up not using MSMQ because of a business requirement - we needed to know if a message was not received immediately so that we could call the store, rather than just letting the store get it when their PC was able to pick up the message from the queue. However, it did work very well.
The article I linked to above is a good place to start.
Our current design, the one that we went live with, does exactly what you asked about a Windows service.
We have a web page to enter messages and pick distribution lists. - these are saved in a database
we have a separate Windows service (We call it the AlertSender) that polls the database and checks for new messages.
The store level PCs have a Windows service that hosts a WCF client that listens for messages (the AlertListener)
When the AlertSender finds messages that need to go out, it sends them to the AlertListener, which is responsible for displaying the message to the stores and playing an alert sound.
As the messages are sent, the AlertSender updates the status of the message in the database.
As stores receive the message, a co-worker enters their employee # and clicks a button to acknowledge that they've received the message. (Critical business requirement for us because if all stores don't get the message we may need to physically call them to have them remove tainted product from shelves, etc.)
Finally, our administrative piece has a report (ASP.NET) tied to an AlertId that shows all of the pending messages, and their status.
You could have the back-end import process write status records to the database as it completes sections of the task, and the web-app could simply poll the database at arbitrary intervals, and update a progress-bar or otherwise tick off tasks as they're completed, whatever is appropriate in the UI.

How to check network connection type in Blackberry?

In Blackberry application I want to check what type of network connection is being used on particular phone, whether it is BES/MDS,BIS-B or Direct Tcp.
Is there any way to find out this?
Many applications like Jive,Opera and many more are doing this kind of check.
Please help.
The question is quite logical and I do agree with Richard as well. Though a better answer lies in the fact that there can be a logic developed which would involve Service Book parsing and making use of system listeners to check the current coverage status.
I had attempted to make one such logic once in my project which worked for me. I had shared my findings and understanding about the concept in more detail at my blog post. May be you would like to check once.
You can find my blog post here.
Your question springs from an incorrect assumption. A Blackberry could be communicating over any or all of those channels simultaneously. In fact any application may as well. At any particular time you can determine if coverage is sufficient for one of those channels, or register a listener for notification of changing status using net.rim.device.api.system.CoverageInfo.

Resources