Title
I have been studying WF for a while, and I feel that he is really great and has made some achievements. Next I will introduce some precautions for developing WF!
When I first started to study WF, I always had a question about me. When I looked at another painting process, I followed the painting process. I was blind and did not understand the parameter configuration, and its mysteries.
At that time, there was a question that had been entangled with me, that is, how I used my process in the application. How to control my instance in the process, when to destroy it, and if a pause is in the memory,
My process is meaningless. Destroys the pull in the memory. How to get it, these problems have plagued me for a long time. In fact, it is very simple that the problem of persistence is passive. Now let's look at the figure.
The above two figures show my process approval interface, 1 Figure submit information interface, 2 Figure solve the problem Interface
As shown in the figure above, you must first create a workflowruntime environment.
Register some events and pay attention to a workflowdled event. When the process instance is not used, immediately destroy the resources occupied in the memory.
Externaldataexchangeservice is a service extension,
Use him to pick up external events.
Sqlworkflowpersistenceservice,
The above is very important. This is required for passivation ..
This is the simplest parameter to pass in a workflow.
Type = typeof (workflowhelpcenterdemo. workflow1); this is our process engine and obtains its type.
Then, you can use theworkflowruntime. createworkflow (type, parameters) to obtain an instance of the process.
Also, you need to pay attention to passing parameters to the process. When workflow1 is used, the process must have corresponding attributes to meet its parameters. If it is not burned, an error is returned.
The above figure of KK is used to obtain the deactivated process instance, obtain this strength, and then perform operations.
Flowchart
Event activation and function call
.
This is the event of the previously registered workflowruntime instance Destruction, through which the occupied resources are destroyed
.
The following is the specific destruction process, which should be noted in some details ..
The above is just a simple description. The specific code is released the day after tomorrow, without a VM or code.
The process should be clear ..
Submit the problem =========== passivation ============= solve the problem
I hope you can learn some simple tips about WF ..
The code will be uploaded the day after tomorrow...
========================================================== ====================== AA