Exemple #1
0
        public static ICamundaWorkerBuilder AddHandler <T>(this ICamundaWorkerBuilder builder)
            where T : class, IExternalTaskHandler
        {
            Guard.NotNull(builder, nameof(builder));

            var metadata = CollectMetadataFromAttributes(typeof(T));

            return(builder.AddHandler <T>(metadata));
        }
Exemple #2
0
        public static ICamundaWorkerBuilder AddHandler(this ICamundaWorkerBuilder builder,
                                                       ExternalTaskDelegate handlerDelegate,
                                                       HandlerMetadata metadata)
        {
            Guard.NotNull(builder, nameof(builder));
            Guard.NotNull(handlerDelegate, nameof(handlerDelegate));
            Guard.NotNull(metadata, nameof(metadata));

            var handlerDescriptor = new HandlerDescriptor(handlerDelegate, metadata);

            return(builder.AddHandlerDescriptor(handlerDescriptor));
        }
Exemple #3
0
        public static ICamundaWorkerBuilder AddHandler <T>(this ICamundaWorkerBuilder builder, HandlerMetadata metadata)
            where T : class, IExternalTaskHandler
        {
            Guard.NotNull(builder, nameof(builder));
            Guard.NotNull(metadata, nameof(metadata));

            var services = builder.Services;

            services.AddScoped <T>();

            return(builder.AddHandler(HandlerDelegate <T>, metadata));
        }