示例#1
0
        private static void AutoAddWorkFlowDefinitions(IServiceCollection services)
        {
            var activityDefinitionList = new ActivityDefinitionList();
            var definitionProviders    = new List <Type>();

            services.OnRegistred(context =>
            {
                if (typeof(IActivity).IsAssignableFrom(context.ImplementationType))
                {
                    activityDefinitionList.Add(ActivityDescriber.Describe(context.ImplementationType));
                }

                if (typeof(IWorkflowProvider).IsAssignableFrom(context.ImplementationType))
                {
                    definitionProviders.Add(context.ImplementationType);
                }
            });
            services.Configure <AbpElsaOptions>(options =>
            {
                options.ActivityDefinitions = activityDefinitionList;
                options.DefinitionProviders.AddIfNotContains(definitionProviders);
            });
        }
示例#2
0
 public AbpElsaOptions()
 {
     DefinitionProviders = new TypeList <IWorkflowProvider>();
     ActivityDefinitions = new ActivityDefinitionList();
 }