Workflow is a popular technology recently. In fact, WF originated from the office automation field in the mid-S. Since its establishment in, WfMC (Workflow Management Alliance) formulated
Series of workflow standards. More and more scholars are paying attention to the workflow in the 21st century, and the technology is becoming more and more mature. Of course, I also have to keep up with the times, so I also joined the workflow army, hoping
Enough to keep up with our predecessors. Of course, I also hope that interested friends can join the workflow discussion group. Specific Group Number:120661978.
At present, we have made a sequent in the agileeas platform. The content of the interface designer + workflow, of course, the workflow is not very mature yet, and it is not convenient to release it. This article is just a reference, but alsoHope
You pay more attention to the content of workflows.
The activity nodes provided by the system can satisfy some simple flows, but some flows are composed of custom activities. At this time, we can use the codeactivity base class provided by the system, we rewrite
The attributes and methods are used to complete custom behaviors and customize the process. Let's take a look at the usage of custom activities.
1. Create a blank solution.
2. Assign the solution in the previous article to the same level folder of the solution.
3. Add an existing project:
4. Select a project file:
5. After opening, the corresponding file is loaded into the current solution, and the class and iteminfo are created.
6. Create a codeactivityCodeActivity:
7. After adding the node, add the following code to the active node:
8. Compile the solution after adding the package. Switch to the designer view and view the custom activity nodes in the toolbar. the nodes are automatically loaded to the toolbar on the left. The Group is based on the namespace.
9. Add a new activity, and then add an ordered control flow and two output activities and user-defined activities to the designer view of the activity:
10. Define two variables and design the process as follows:
11. After F5 is run, the output to the console is as follows:
For more applications and instructions, I believe that you will see more applications in the subsequent design process. Of course, due to my limited level, some content is generated, unclear or
If you do not understandPlease criticize and point out.
For the source code of the previous article, refer to the previous articleArticle《Workflow design step 4-Exception Handling (continued)-wf4.0Download
Next we will combine the exception handling in the previous article to trigger an exception through the codeactivity activity to see how to capture the exception information.
1. Add a custom codeactivity that generates an exception:
2. Compile the solution and add the activity to the designer. The specific process is as follows:
3. Modify the calling code in program:
4. Run F5 to see the specific results:
5. view the error message:
6. To continue running, the "unhandledexceptionaction" defined in programs will be executed. The specific content is as follows: