Ejemplo n.º 1
0
 public static Task <IEnumerable <BookmarkFinderResult> > FindBookmarksAsync <T>(
     this IBookmarkFinder bookmarkFinder,
     IEnumerable <IBookmark> bookmarks,
     string?correlationId = default,
     string?tenantId      = default,
     int skip             = 0,
     int take             = int.MaxValue,
     CancellationToken cancellationToken = default) where T : IActivity =>
 bookmarkFinder.FindBookmarksAsync(typeof(T).GetSimpleAssemblyQualifiedName(), bookmarks, correlationId, tenantId, skip, take, cancellationToken);
Ejemplo n.º 2
0
 public static Task <IEnumerable <BookmarkFinderResult> > FindBookmarksAsync(
     this IBookmarkFinder bookmarkFinder,
     string activityType,
     IBookmark bookmark,
     string?correlationId = default,
     string?tenantId      = default,
     int skip             = 0,
     int take             = int.MaxValue,
     CancellationToken cancellationToken = default) =>
 bookmarkFinder.FindBookmarksAsync(activityType, new[] { bookmark }, correlationId, tenantId, skip, take, cancellationToken);
Ejemplo n.º 3
0
        public StartJobs(IBookmarkFinder bookmarkFinder, IWorkflowInstanceScheduler workflowScheduler, IDistributedLockProvider distributedLockProvider, ILogger <StartJobs> logger)
        {
            _bookmarkFinder          = bookmarkFinder;
            _workflowScheduler       = workflowScheduler;
            _distributedLockProvider = distributedLockProvider;
            _logger = logger;

            _retryPolicy = Policy
                           .Handle <Exception>()
                           .WaitAndRetryForeverAsync(retryAttempt =>
                                                     TimeSpan.FromSeconds(5)
                                                     );
        }
Ejemplo n.º 4
0
 public WorkflowResumer(
     IWorkflowRegistry workflowRegistry,
     IBookmarkFinder bookmarkFinder,
     IWorkflowInstanceStore workflowInstanceStore,
     IWorkflowStorageService workflowStorageService,
     Func <IWorkflowBuilder> workflowBuilderFactory,
     IWorkflowRunner workflowRunner)
 {
     _workflowRegistry       = workflowRegistry;
     _bookmarkFinder         = bookmarkFinder;
     _workflowInstanceStore  = workflowInstanceStore;
     _workflowStorageService = workflowStorageService;
     _workflowBuilderFactory = workflowBuilderFactory;
     _workflowRunner         = workflowRunner;
 }
Ejemplo n.º 5
0
 public TriggerWorkflows(
     IWorkflowInstanceStore workflowInstanceStore,
     IBookmarkFinder bookmarkFinder,
     ITriggerFinder triggerFinder,
     IDistributedLockProvider distributedLockProvider,
     IMediator mediator,
     ElsaOptions elsaOptions,
     ILogger <TriggerWorkflows> logger)
 {
     _workflowInstanceStore   = workflowInstanceStore;
     _bookmarkFinder          = bookmarkFinder;
     _triggerFinder           = triggerFinder;
     _distributedLockProvider = distributedLockProvider;
     _mediator    = mediator;
     _elsaOptions = elsaOptions;
     _logger      = logger;
 }
Ejemplo n.º 6
0
        public StartJobs(
            IBookmarkFinder bookmarkFinder,
            ITriggerFinder triggerFinder,
            IDistributedLockProvider distributedLockProvider,
            ICommandSender commandSender,
            ILogger <StartJobs> logger)
        {
            _bookmarkFinder          = bookmarkFinder;
            _triggerFinder           = triggerFinder;
            _distributedLockProvider = distributedLockProvider;
            _commandSender           = commandSender;
            _logger = logger;

            _retryPolicy = Policy
                           .Handle <Exception>()
                           .WaitAndRetryForeverAsync(_ => TimeSpan.FromSeconds(5)
                                                     );
        }
Ejemplo n.º 7
0
 public StartJobs(IBookmarkFinder bookmarkFinder, IWorkflowScheduler workflowScheduler)
 {
     _bookmarkFinder    = bookmarkFinder;
     _workflowScheduler = workflowScheduler;
 }
Ejemplo n.º 8
0
 public WorkflowTriggerInterruptor(IWorkflowRunner workflowRunner, IWorkflowRegistry workflowRegistry, IWorkflowInstanceStore workflowInstanceStore, IBookmarkFinder bookmarkFinder)
 {
     _workflowRunner        = workflowRunner;
     _workflowRegistry      = workflowRegistry;
     _workflowInstanceStore = workflowInstanceStore;
     _bookmarkFinder        = bookmarkFinder;
 }
 public static Task <IEnumerable <BookmarkFinderResult> > FindBookmarksAsync <T>(
     this IBookmarkFinder bookmarkFinder,
     string?correlationId = default,
     string?tenantId      = default,
     CancellationToken cancellationToken = default) where T : IActivity =>
 bookmarkFinder.FindBookmarksAsync(typeof(T).Name, Enumerable.Empty <IBookmark>(), correlationId, tenantId, cancellationToken);
Ejemplo n.º 10
0
 public static Task <IEnumerable <BookmarkFinderResult> > FindBookmarksAsync <T>(
     this IBookmarkFinder bookmarkFinder,
     IBookmark bookmark,
     string?tenantId,
     CancellationToken cancellationToken = default) where T : IActivity =>
 bookmarkFinder.FindBookmarksAsync(typeof(T).Name, new[] { bookmark }, tenantId, cancellationToken);