Пример #1
0
 public virtual void Initialize(RulesInitializationContext context)
 {
     foreach (var workflowRulesResolver in _options.WorkflowRulesResolvers)
     {
         workflowRulesResolver.Initialize(context);
     }
 }
Пример #2
0
        public override void Initialize(RulesInitializationContext context)
        {
            Initialize(context.ServiceProvider);

            RulesCache     = context.ServiceProvider.GetRequiredService <IMemoryCache>();
            JsonSerializer = context.ServiceProvider.GetRequiredService <IJsonSerializer>();

            FileProvider = BuildFileProvider(context);
        }
 protected override IFileProvider BuildFileProvider(RulesInitializationContext context)
 {
     // 未指定路径不启用
     if (!_fileResolveOptions.PhysicalPath.IsNullOrWhiteSpace() &&
         Directory.Exists(_fileResolveOptions.PhysicalPath))
     {
         return(new PhysicalFileProvider(_fileResolveOptions.PhysicalPath));
     }
     return(null);
 }
Пример #4
0
 protected abstract IFileProvider BuildFileProvider(RulesInitializationContext context);
 public virtual void Initialize(RulesInitializationContext context)
 {
 }
 public override void Initialize(RulesInitializationContext context)
 {
     _store = context.ServiceProvider.GetRequiredService <IWorkflowRuleStore>();
 }
Пример #7
0
        public override void Initialize(RulesInitializationContext context)
        {
            _ruleEngine = CreateRulesEngine();

            _workflowRulesResolver.Initialize(context);
        }
Пример #8
0
 public override void Initialize(RulesInitializationContext context)
 {
     context.GetRequiredService <RuleRepository>()
     .Load(loader => loader.From(_options.DefinitionRules));
 }