Slickflow.net Open Source Workflow Engine Basics Introduction (eight)--automatic task scheduling implementation

Source: Internet
Author: User

The approval process is common in manual type tasks, but there are also some automated tasks that require timed triggering. Therefore, the engine framework needs to solve two problems: Select the appropriate task scheduling framework, integration of new task scheduling module.

1. Task Scheduling Framework Selection

Hangfire is an open source. NET task scheduling framework, which currently supports. NET Core in the 1.6+ version.

Queue-based task processing (fire-and-forget jobs)
Deferred task execution (Delayed jobs)
Timed task Execution (recurring jobs)
Continuity task Execution (continuations)

Hangfire is an open source Ncrontab component that allows you to specify a very flexible timing task type through cron expression syntax.

1) Official website address

https://www.hangfire.io/
2) ASP Web site support
Http://docs.hangfire.io/en/latest/installation.html
Includes installation and deployment, database settings, and more.
Installation Step Description:
Http://docs.hangfire.io/en/latest/installation.html
3) database


During the Hangfire NuGet package installation process, the Hangfire database script automatically generates HANGFIREDB, or you can build the database manually.

2. Process Designer supports cron expression editing

Cron expression Edit Open source project address:

Https://github.com/LGX9/cron-expression-editor

3. Task Scheduler Module (slickflow.schedule)

3.1 Process Overdue automatic completion

1) Database fields

The Process instance table wfprocessinstance has the process instance " overdue time " and " overdue processing time " field information, which is used to record task scheduling data.

2) Logical Description

When the process is started or in an intermediate state, the overdue time of the process instance is updated so that the background Timer Job task detects that there are no overdue process instances in the process instance table, and if so, automatically sets the process instance to the finalization state.

3) Task queue add

3.2 Process Timing Start

1) Database fields

The field in the Process definition table (wfprocess) table contains " Do you want to start regularly?" and the scheduled start cron expression field. Used to define timed task trigger information.

2) timed Start process node

3) Join the scheduled task queue

4. Task Scheduler Monitor Panel (Dashboard)

5. Summary

The Integrated hangfire task scheduling framework enables Slickflow engine products to support automatic processing of node task types, and also enhances the process's task automation capability, while Hangfire component robustness and cross-platform Can meet the business requirements of most enterprise-level customers and large-scale job scheduling requests.

Slickflow.net Open Source Workflow Engine Basics Introduction (eight)--automatic task scheduling implementation

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.