Business workflow platform design (6)

Source: Internet
Author: User
Custom Activity ( 3. ) Lock Processing

PreviousArticleAs I have already said, the collection of user data is separated from the workflow instance. Data storage may also be separated. This data separation requires us to do more work:

L Maintain the relationship between artifacts (such as manuscripts and tasks) and workflow instances. We use WF Built-in Sqlworkflowpersistenceservice To store workflow instances. Then the workpiece, workpiece, and WF The relationship between instances and related handling conditions should be handed over to the application system for maintenance. For more information, see the "workflow workpiece maintenance framework ".

L preserve artifacts and WF the instance status is consistent. This part of the solution is followed by the topic about "State consistency.

L exclusive processing. This is the focus of this section.

Exclusive processing, in fact, the processing process is very simple, that is, to lock the data during processing, just like locking the door in the toilet :). Here we will not talk about how to lock, but about what data to lock and when to lock.

Let's take a look at the data to be processed to complete a review.

L edit and save the artifacts

L record the workpiece review

L Save after running WF instance status

In fact, we only need to lock two pieces of data: artifacts and WF Instance. Exit if the workpiece fails to be locked. WF For how to stop the running of an instance, read the subsequent articles. If the lock is successful WF The instance will be unlocked after persistence. Note that although WF Of Sqlworkflowpersistenceservice It has the lock function, but it still has to wait WF The instance persists before unlocking the workpiece.

There is one thing to note here. The workpiece may not be modified during the review process. If the lock starts from the moment the workpiece is opened, the occupation time will be greatly increased! Remember. We can lock the first modified event of the workpiece to minimize the Occupied time.

At this point, careful people may find that the workpiece may not be modified during the processing process, that is, no lock information is generated. If we run WF Instance, the situation is dangerous. We are running WF Check whether the workpiece is locked. If the workpiece is not locked, lock it and run it again. WF Instance.

here, some people may think that I write too little, I can only say sorry, I still have a lot of work to do. To be continued.

Related Article

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.