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); }); }
public AbpElsaOptions() { DefinitionProviders = new TypeList <IWorkflowProvider>(); ActivityDefinitions = new ActivityDefinitionList(); }