WF essence on reading experience 3 Execution

Source: Internet
Author: User
Schedule Scheduling

Scheduler:
Create a queue so that the work items (the delegate method in the activity, called the scheduler work item) are allocated to the target activity.
Use the invoke <t> method to send the continueat () work item to the scheduler queue, allocate work items, and execute the corresponding delegate method.
Scheduler work queue! = WF program queue,
The former is managed by runtime, and the work item is delegate such as continueat ().
The latter is managed by workflowqueueservice, where the instance of workflowqueue is placed

Active State Machine

Two enumerations
AES, activity execution status
Aer: execution result of the activity

The AEC implements the idispose interface, so the AEC cannot be cached. For example, the execute method and the AEC object are used as parameters. When the method is returned, the AEC object will be destroyed immediately.

Activity services:
In Main (), add the service: runtime. addservice (New service1 () in the WF runtime ());
Use context to obtain the service: context. getservice <service1> ();
---- The service is selected by the host based on the abstract class. For details, see chapter 5th.

Review bookmarks
One example: An activity delegates work to itself
Therefore, when the bookmarks are created, the bookmarks are restored without waiting for the. Execute method. Use the base. Invoke (continueat, systemargs. Empty) method.
At this time, the continueat method must end with context. closeactivity ();, so that the activity status changes to AES. Closed.
Invoke method definition: invoke <t> (eventhandler <t> handler, t e); e is the parameter entrusted by Handler

WF program execution:
First, workflowruntime. createworkflow () returns the WF program instance instence and prepares a scheduler and a work queue for it. At this time, all the activities in the WF program are in the initialized state.
Then instance. Start () runs the WF program instance and runs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.