1. Add fields to WfProcess table

It is necessary to add startup type and startup job expression fields: StartType, StartExpression.


  1. Define scheduled start nodes in the flow chart

       The method instance (CronExpression expression setting) of the scheduled startup process is stored in the HangFire job. The code example is as follows:

///<summary>

/// Start the job on time

///</summary>

private void AddJobOfTriggerTimingStartupProcess()

{

var schedulerService = new SchedulerService ();

List <ProcessEntity> processList = schedulerService.GetStartupTimingProcessList().ToList();


foreach ( var entity in processList)

{

if (entity.IsStartupByTimer == 1 && ! String .IsNullOrEmpty(entity.StartupCronExpression))

{

RecurringJob .AddOrUpdate< SchedulerService >(entity.ProcessGUID,

s => s.TriggerTimingStartupProcess(entity),

entity.StartupCronExpression,

TimeZoneInfo .Local);


}

}

}

Find the regularly started process record from the process definition table (WfProcess), determine whether there is a Cron expression, and then add it to the job queue.