I have previously raised questions about dual-engine or multi-engine. Many friends ask what the purpose of the multi-engine is. Here, I will give a few simple examples.
The following example is just a reference. Do not lock your mind with the following examples.
1. Use multiple engines for business expansion flexibility
The WF engine can run multiple instances of multiple workflow templates at the same time,
This is an ideal mode, but the following problems may occur in actual development:
1. different workflows have the same requirements for persistence services and listener services.
2. different workflows have different control requirements for processes. For example, CallExternalMethodActivity and HandleExternalEventActivity have more complex interaction operations than the host. Different state machine workflows have their own business state operations.
3. After the system is released, you need to add a new workflow template.
And many other single-engine models that require use, the code will be very confusing, and it is not easy to expand
In this case, you can use the following method (of course, this is only an example, and the encapsulation granularity can be adjusted at will in specific development)
2. Use a dedicated engine for special nodes
There are many examples of using independent engines for special nodes. Here I just give a simple
In some development scenarios, a node of a workflow may need to interact with external calls and backups, such as switching the same electrical gate.
. NET supports multithreading, and WF can also run parallel instances. However, our switch X does not support multithreading.
We do not want both A process instance and B Process instance to start the power switch X at the same time, nor do we want the two instances of A or B process to start the power switch X at the same time,
In this case, you can use a dual-engine. When the first engine runs all the instances normally, the instance is handed over to a serial engine (ManualWorkflowSchedulerService) when the [operation gate X] node is reached ), the serial engine completes the [operation gate X] node of each instance one by one. Of course, you can also manage resource calling optimization, priority setting, and switch gate status sharing in this serial engine. I won't discuss it in important words.
3. Physical dual-engine
The purpose is very clear. Server Load balancer and Failover are the same as SQL Server writing. We will not repeat them here ,:
4. Memory-based Engine
This is one of my previous ideas, but it is not easy to implement on other workflow platforms, but it is really nice in WF.
The technical features are as follows:
1. Use the Smart Client mode for development
2. All clients install net 3.0 or use the Vista operating system.
3. encapsulate the user UI for business operations in the client program.
4. A workflow involving multiple users. After a user's client has completed the user's business operations, the instance will be uploaded to a (TCP, WebService, or email) to the next user to participate in the process.
I have done a similar job in the past, but the client's business logic is pushed in the Code. Strictly speaking, it cannot be regarded as a workflow,
MS needs to pre-install WF on each computer, which is really good and can implement many features that were hard to be developed before.