Does Workflow 4.5 require SQL Server for persisting state? - workflow

I'm reading "Pro WF 4.5" published by APress, which seems to say unequivocally that in order to persist state in a long-running workflow after a server crash/shutdown (anything that'd clear memory), a SQL Server back-end is required for persistence.
A lot of the MSDN stuff I see online seems to contradict this. For example, the article linked below.
https://msdn.microsoft.com/en-us/library/dd851337.aspx
What is the real scoop, from someone actually using WF? TIA.

There is a built in Instance Store for SQL Server (https://msdn.microsoft.com/en-us/library/system.activities.durableinstancing.sqlworkflowinstancestore(v=vs.110).aspx) but there is nothing stopping you creating your own - https://msdn.microsoft.com/en-us/library/ee829481(v=vs.110).aspx
That way you could use any persistence you like.

Implementing your own implementation for durable instance on WF can be done. My experience is that it is difficult to do. I ended up with a provider created by Devart. They created a provider for Oracle databases. You can find more information here https://www.devart.com/dotconnect/oracle/docs/WorkflowInstanceStore.html

Related

c#/.net service bus using sql server

I know there are mature frameworks out there like nservicebus, but I would like a queue that utilizes sql server and not msmq/rabbit.
Is there one out there?
Thanks in advance.
Have you looked at SQL Server Service Broker ?
I realise that an instance of SQL server running in some central location will never be a service bus. However, it's difficult to recommend anything without knowing what you're trying to use it for.
Because of my interest in DDD, CQRS and Event Sourcing y studied the CQRS Journey from Microsoft Patterns and Practices. Please, check the link. You will find an entire "tutorial" if you download the RI (Reference Implementation, which is basically the Demo App) and read along the articles, which is a book in reality.
They implemented in Windows Azure, but, fortunately, they also included a version of the app with a custom Sql Server Bus. The implementation is very cool, even if they say that it should no be used in production I did it. And is working flawlessly. Hope this helps.
You should look at ReBus. I have used it with SQL Server and worked fine.
https://github.com/rebus-org/Rebus

Advice needed on workflow

We are currently trying to decide how to implement workflow into our enterprise application. We must support very complex workflow scenarios and we must also handle approx 10000 concurrent users. The application domain is healthcare. The client is a WPF application talking to an IIS backend using WCF. The question is: Does anybody have any experience with Windows workflow foundation in such a large enterprise application? From the requirements is seems like WWF fits the bill, but I am worried about performance and scalability. Should I continue to investigate into WWF or is WWF just not suitable for this kind of applications? We also need to let our consultants have the ability to alter workflows and re-hosting the WWF designer certainly sounds tempting. What do you think. Is WWF the way to go? 
You can create a workflow that is directly hosted by IIS. You can use the "Receive" activity to setup the WF to handle requests. You can then attach a "Send" activity to reply back to the client with a response, and even have the workflow continue processing in the background that activity. Hope that provides some direction to get you started. You can achieve this with either the .NET Framework 3.5 or 4.x versions, but .NET 4.0 is much easier to setup.
The performance will rely on the hardware.
Anyway, workflow services are perfectly scalables in IIS. You will be able to set up a server farm that will serve all the request.
Regarding the requirement of altering workflows, always is possible to alter the workflow in a way that future requests will create instances of the new altered workflow. Old and already initiated workflows can not take any variation. So,if I have not understood wrongly, WWF does not fit this requirement.

Creating a Custom Entity Framework for Unsupported System

I could be totally misunderstanding Entity Framework here. I want to use that in my latest project (how else do you learn?) The problem is that the IBM i driver doesn't have support for that built in. Is is possible to create that framework from scratch? It is worth it?
It sounds like you'd be writing your own ADO.NET data provider to connect to IBM DB2 for i. Microsoft provides documentation for creating your own provider and a sample.
The data provider would be responsible for communicating with the database, so I'm not sure how you'd accomplish that. Either you'd be implementing your own connection to the database server running on the i (maybe you can port the SQL piece of JTOpen), or you'd be delegating your calls to the IBM-provided data provider (if that's even possible) or other data access method.
I couldn't decide whether I thought this was (1) a huge pain in the butt or (2) an opportunity for an open source project. (I guess it could be both.) It seems like it'd be easier to lobby IBM to make this part of their stock provider. You might complain about it on MIDRANGE-L and see if people will take up the cause.
Disclaimer: I am a newbie in the .NET world, so maybe there's an easier way to accomplish what you're trying to do.

Drools 5 exposing it to web application and webservices(SOAP) using jaxb

We have reqmt. where we need to expose drools 5 with ESB and similteniously with the web application.Although i have figured out ways to run drools with eclipse,however finding it difficult to configure Drools 5 with same web-app at the moment and shift it esb in future.
Guvnor and Drool-Server are not just sufficient to help me out neither does googling it helps
,even spring support is also not available.
Any help will be highly appreciated...Thanks
At what level do you need to "expose" Drools within the ESB? I use Drools in an Enterprise solution that uses asynchronous web services; many of my workflows are extremely long running (2 weeks to a month). The key is to temporarily persist the StatefulKnowledgeSession between calls. There is a JPAStatefulKnowledgeSession that serializes the session and stores it as a blob in a relational database. I decided not to use this solution because many of my asynchronous tasks finish within a second of being called. The performance cost of persisting the process in a RDBMS was too much for my needs. My solution was to store the session in an in-memory cache. Infinispan was ridiculously simple to configure and use, and I haven't had a single issue with the framework.
Do you need to have the ESB and Web Application use the same KnowledgeSession? Does it have to be a StatefulKnowledgeSession? If you need to maintain state, you should consider a queue-based system and fireAllRules() at some interval. If your actions are command based (insert object, start process, etc), I believe Drools already has an API for the pattern (I believe this is what Drools Server does under the hood). You could also make the KnowledgeSession a singleton; but consider using a ReentrantLock to prevent concurrent calls on the object. If you are isolating sessions, creating your own repository works best. Infinispan's Cache implements the ConcurrentHashMap, so you could use the ID of the session as the key and KnowledgeSession as the value.

Windows Workflow Foundation in ASP.NET 3.5 Web Application - Best Approach

What is the best way to use Windows Workflow Foundation in ASP.NET 3.5 Web Application.
In my case there are several workflows(sequential) which includes numerous steps, user has the privilege to save and exit at any of these steps; the state must be persisted, possibly in SQL Server.
Exposing workflows as web service is good idea? I have very little idea about workflows and only tried out wf console applications.
Please guide me in right direction, also I would like to know is there any specific and established architecture to use wf in ASP.NET Web Apps. We have layered architecture for our web apps (BLL, DAL, Services etc) and I would like to know where we can incorporate workflows in current architecture.
Many thanks in advance.
Update: thank you Rubens Farias for helping me out in first place.
We are still unsure which approach will be the best.
Please provide any example frameworks or sample webapplication which use workflow
So far...
1. Is it good idea to use Page Flow Application Block
2. There are lots of changes in WF4, should I wait for that?
3. Or use WF as Rubes Farias suggested
Please guide me friends, am desperate :(
You definitely must read this document: Foundations: Workflow Services
You can to add an out-of-box persistence service, so your workflows get persisted into a SQL Server database, and to expose them as WCF services (RESTfull approaches is also available).