コード例 #1
0
 public WorkflowInstanceAppService(IWorkflowInvoker workflowInvoker, IWorkflowDefinitionVersionRepository workflowDefinitionVersionRepository, IWorkflowInstanceRepository workflowInstanceRepository, IWorkflowInstanceStore workflowInstanceStore)
 {
     _workflowInvoker = workflowInvoker;
     _workflowDefinitionVersionRepository = workflowDefinitionVersionRepository;
     _workflowInstanceRepository          = workflowInstanceRepository;
     _workflowInstanceStore = workflowInstanceStore;
 }
コード例 #2
0
 public WorkflowTriggerInterruptor(IWorkflowRunner workflowRunner, IWorkflowRegistry workflowRegistry, IWorkflowInstanceStore workflowInstanceStore, IBookmarkFinder bookmarkFinder)
 {
     _workflowRunner        = workflowRunner;
     _workflowRegistry      = workflowRegistry;
     _workflowInstanceStore = workflowInstanceStore;
     _bookmarkFinder        = bookmarkFinder;
 }
コード例 #3
0
 public WorkflowInstanceExecutor(IResumesWorkflow workflowRunner, IWorkflowInstanceStore workflowInstanceStore, IWorkflowStorageService workflowStorageService, ILogger <WorkflowInstanceExecutor> logger)
 {
     _workflowRunner         = workflowRunner;
     _workflowStorageService = workflowStorageService;
     WorkflowInstanceStore   = workflowInstanceStore;
     _logger = logger;
 }
コード例 #4
0
 public CleanupJob(IWorkflowInstanceStore workflowInstanceStore, IClock clock, IOptions <CleanupOptions> options, ILogger <CleanupJob> logger)
 {
     _workflowInstanceStore = workflowInstanceStore;
     _clock   = clock;
     _options = options.Value;
     _logger  = logger;
 }
コード例 #5
0
 public WorkflowLaunchpad(
     IWorkflowInstanceStore workflowInstanceStore,
     IWorkflowFactory workflowFactory,
     IBookmarkFinder bookmarkFinder,
     ITriggerFinder triggerFinder,
     IDistributedLockProvider distributedLockProvider,
     IWorkflowInstanceDispatcher workflowInstanceDispatcher,
     IWorkflowInstanceExecutor workflowInstanceExecutor,
     IWorkflowRunner workflowRunner,
     IWorkflowRegistry workflowRegistry,
     IGetsStartActivities getsStartActivities,
     ElsaOptions elsaOptions,
     ILogger <WorkflowLaunchpad> logger)
 {
     _workflowInstanceStore      = workflowInstanceStore;
     _bookmarkFinder             = bookmarkFinder;
     _triggerFinder              = triggerFinder;
     _distributedLockProvider    = distributedLockProvider;
     _workflowInstanceDispatcher = workflowInstanceDispatcher;
     _elsaOptions              = elsaOptions;
     _logger                   = logger;
     _getsStartActivities      = getsStartActivities;
     _workflowRegistry         = workflowRegistry;
     _workflowRunner           = workflowRunner;
     _workflowInstanceExecutor = workflowInstanceExecutor;
     _workflowFactory          = workflowFactory;
 }
コード例 #6
0
ファイル: Cron.cs プロジェクト: omid-tansaz/elsa-core
 public Cron(IWorkflowInstanceStore workflowInstanceStore, IWorkflowInstanceScheduler workflowScheduler, ICrontabParser crontabParser, IClock clock)
 {
     _clock = clock;
     _workflowInstanceStore = workflowInstanceStore;
     _workflowScheduler     = workflowScheduler;
     _crontabParser         = crontabParser;
 }
コード例 #7
0
        public async Task ThenTheWorkflowInstanceWithIdShouldContainContextItems(string instanceId, Table expectedContextItems)
        {
            ITenantedWorkflowInstanceStoreFactory instanceStoreFactory = ContainerBindings.GetServiceProvider(this.featureContext)
                                                                         .GetService <ITenantedWorkflowInstanceStoreFactory>();

            ITenantProvider tenantProvider = ContainerBindings.GetServiceProvider(this.featureContext)
                                             .GetService <ITenantProvider>();

            IWorkflowInstanceStore instanceStore = await instanceStoreFactory.GetWorkflowInstanceStoreForTenantAsync(tenantProvider.Root).ConfigureAwait(false);

            WorkflowInstance instance = await WorkflowRetryHelper.ExecuteWithStandardTestRetryRulesAsync(
                () => instanceStore.GetWorkflowInstanceAsync(instanceId)).ConfigureAwait(false);

            Assert.AreEqual(
                expectedContextItems.Rows.Count,
                instance.Context.Count,
                "The number of context items in the workflow instance is different to the number of items in the specified list");

            foreach (TableRow current in expectedContextItems.Rows)
            {
                Assert.IsTrue(
                    instance.Context.TryGetValue(current[0], out string actualValue),
                    $"The instance context does not contain expected item with key '{current[0]}'");

                Assert.AreEqual(current[1], actualValue, $"The instance context does not contain the expected value for key '{current[0]}'");
            }
        }
コード例 #8
0
ファイル: List.cs プロジェクト: mhymhygi/elsa-core
 public List(IWorkflowInstanceStore workflowInstanceStore, IMapper mapper, ILogger <List> logger)
 {
     _workflowInstanceStore = workflowInstanceStore;
     _mapper    = mapper;
     _logger    = logger;
     _stopwatch = new Stopwatch();
 }
コード例 #9
0
 public CachingWorkflowRegistry(IWorkflowRegistry workflowRegistry, IMemoryCache memoryCache, ICacheSignal cacheSignal, IWorkflowInstanceStore workflowInstanceStore)
 {
     _workflowRegistry      = workflowRegistry;
     _memoryCache           = memoryCache;
     _cacheSignal           = cacheSignal;
     _workflowInstanceStore = workflowInstanceStore;
 }
コード例 #10
0
 public HangfireWorkflowDispatcher(IBackgroundJobClient jobClient, IWorkflowInstanceStore workflowInstanceStore, IWorkflowRegistry workflowRegistry, ElsaOptions elsaOptions, ILogger <HangfireWorkflowDispatcher> logger)
 {
     _jobClient              = jobClient;
     _workflowInstanceStore  = workflowInstanceStore;
     _workflowRegistry       = workflowRegistry;
     _workflowChannelOptions = elsaOptions.WorkflowChannelOptions;
     _logger = logger;
 }
コード例 #11
0
 public StartController(IWorkflowRunner workflowInvoker, IWorkflowRegistry workflowRegistry, IWorkflowFactory workflowFactory, IWorkflowInstanceStore workflowInstanceStore, IWorkflowInstanceDispatcher workflowInstanceDispatcher)
 {
     this.workflowInvoker            = workflowInvoker;
     this.workflowRegistry           = workflowRegistry;
     this.workflowFactory            = workflowFactory;
     this.workflowInstanceStore      = workflowInstanceStore;
     this.workflowInstanceDispatcher = workflowInstanceDispatcher;
 }
コード例 #12
0
ファイル: Get.cs プロジェクト: jruckert/elsa-core
 public Get(IWorkflowInstanceStore workflowInstanceStore, IContentSerializer contentSerializer, IWorkflowRegistry workflowRegistry, ITenantAccessor tenantAccessor, IPublisher publisher)
 {
     _workflowInstanceStore = workflowInstanceStore;
     _contentSerializer     = contentSerializer;
     _workflowRegistry      = workflowRegistry;
     _tenantAccessor        = tenantAccessor;
     _publisher             = publisher;
 }
コード例 #13
0
ファイル: WorkflowResumer.cs プロジェクト: plusxp/elsa-core
 public WorkflowResumer(IWorkflowRegistry workflowRegistry, IBookmarkFinder bookmarkFinder, IWorkflowInstanceStore workflowInstanceStore, Func <IWorkflowBuilder> workflowBuilderFactory, IWorkflowRunner workflowRunner)
 {
     _workflowRegistry       = workflowRegistry;
     _bookmarkFinder         = bookmarkFinder;
     _workflowInstanceStore  = workflowInstanceStore;
     _workflowBuilderFactory = workflowBuilderFactory;
     _workflowRunner         = workflowRunner;
 }
コード例 #14
0
 public QueuingWorkflowDispatcher(ICommandSender commandSender, IWorkflowInstanceStore workflowInstanceStore, IWorkflowRegistry workflowRegistry, ElsaOptions elsaOptions, ILogger <QueuingWorkflowDispatcher> logger)
 {
     _commandSender          = commandSender;
     _workflowInstanceStore  = workflowInstanceStore;
     _workflowRegistry       = workflowRegistry;
     _workflowChannelOptions = elsaOptions.WorkflowChannelOptions;
     _logger = logger;
 }
コード例 #15
0
ファイル: WorkflowPublisher.cs プロジェクト: tle5/elsa-core
 public WorkflowPublisher(IWorkflowDefinitionStore workflowDefinitionStore, IWorkflowInstanceStore workflowInstanceStore, IIdGenerator idGenerator, ICloner cloner, IMediator mediator)
 {
     _workflowDefinitionStore = workflowDefinitionStore;
     _workflowInstanceStore   = workflowInstanceStore;
     _idGenerator             = idGenerator;
     _cloner   = cloner;
     _mediator = mediator;
 }
コード例 #16
0
 public WorkflowStarter(ITriggerFinder triggerFinder, IWorkflowFactory workflowFactory, Func <IWorkflowBuilder> workflowBuilderFactory, IWorkflowRunner workflowRunner, IWorkflowInstanceStore workflowInstanceStore)
 {
     _triggerFinder          = triggerFinder;
     _workflowFactory        = workflowFactory;
     _workflowBuilderFactory = workflowBuilderFactory;
     _workflowRunner         = workflowRunner;
     _workflowInstanceStore  = workflowInstanceStore;
 }
コード例 #17
0
 public List(IWorkflowInstanceStore workflowInstanceStore, IMapper mapper, IContentSerializer contentSerializer, ILogger <List> logger, ITenantAccessor tenantAccessor)
 {
     _workflowInstanceStore = workflowInstanceStore;
     _mapper            = mapper;
     _contentSerializer = contentSerializer;
     _logger            = logger;
     _stopwatch         = new Stopwatch();
     _tenantAccessor    = tenantAccessor;
 }
コード例 #18
0
        public async Task ThenThereShouldBeANewWorkflowInstanceInTheWorkflowInstanceStore(int expected)
        {
            ITenantedWorkflowInstanceStoreFactory storeFactory = this.serviceProvider.GetRequiredService <ITenantedWorkflowInstanceStoreFactory>();
            IWorkflowInstanceStore store = await storeFactory.GetWorkflowInstanceStoreForTenantAsync(this.transientTenantManager.PrimaryTransientClient).ConfigureAwait(false);

            IEnumerable <string> instances = await store.GetMatchingWorkflowInstanceIdsForSubjectsAsync(Array.Empty <string>(), int.MaxValue, 0).ConfigureAwait(false);

            Assert.AreEqual(expected, instances.Count());
        }
コード例 #19
0
 public HttpWorkflowsController(
     ITokenService tokenService,
     IWorkflowInvoker workflowInvoker,
     IWorkflowInstanceStore workflowInstanceStore)
 {
     this.tokenService          = tokenService;
     this.workflowInvoker       = workflowInvoker;
     this.workflowInstanceStore = workflowInstanceStore;
 }
コード例 #20
0
 public IndexModel(ILogger <IndexModel> logger, IWorkflowInvoker WorkflowInvoker, ElsaContextEx db,
                   IWorkflowDefinitionStore workflowDefinitionStore,
                   IWorkflowInstanceStore workflowInstanceStore)
 {
     _logger         = logger;
     workflowInvoker = WorkflowInvoker;
     this.workflowDefinitionStore = workflowDefinitionStore;
     this.workflowInstanceStore   = workflowInstanceStore;
     this.db = db;
 }
コード例 #21
0
        public async Task <ActionResult <bool> > ResumeAsync(
            [FromServices] IWorkflowInstanceStore wfStore,
            [FromServices] IWorkflowInvoker wfInvoker,
            string name,
            string correlationId,
            CancellationToken cancellationToken)
        {
            await wfInvoker.TriggerSignalAsync(name, correlationId : correlationId, cancellationToken : cancellationToken); // .ResumeAsync(wf, cancellationToken: cancellationToken);

            return(Ok(true));
        }
コード例 #22
0
 public ContinueRunningWorkflows(
     IWorkflowInstanceStore workflowInstanceStore,
     IWorkflowInstanceDispatcher workflowInstanceDispatcher,
     IDistributedLockProvider distributedLockProvider,
     ILogger <ContinueRunningWorkflows> logger)
 {
     _workflowInstanceStore      = workflowInstanceStore;
     _workflowInstanceDispatcher = workflowInstanceDispatcher;
     _distributedLockProvider    = distributedLockProvider;
     _logger = logger;
 }
コード例 #23
0
 public WorkflowInstanceController(
     IWorkflowInstanceStore workflowInstanceStore,
     IWorkflowDefinitionStore workflowDefinitionStore,
     IOptions <ElsaDashboardOptions> options,
     INotifier notifier)
 {
     this.workflowInstanceStore   = workflowInstanceStore;
     this.workflowDefinitionStore = workflowDefinitionStore;
     this.options  = options;
     this.notifier = notifier;
 }
コード例 #24
0
 public WorkflowTestLaunchpad(
     IWorkflowRegistry workflowRegistry,
     IWorkflowInstanceStore workflowInstanceStore,
     IWorkflowFactory workflowFactory,
     IWorkflowRunner workflowRunner)
 {
     _workflowRegistry      = workflowRegistry;
     _workflowInstanceStore = workflowInstanceStore;
     _workflowFactory       = workflowFactory;
     _workflowRunner        = workflowRunner;
 }
コード例 #25
0
        public async Task TheWorkflowInstanceStoreIsEmpty()
        {
            ITenantedWorkflowInstanceStoreFactory storeFactory = this.serviceProvider.GetRequiredService <ITenantedWorkflowInstanceStoreFactory>();
            IWorkflowInstanceStore store = await storeFactory.GetWorkflowInstanceStoreForTenantAsync(this.transientTenantManager.PrimaryTransientClient).ConfigureAwait(false);

            IEnumerable <string> instanceIds = await store.GetMatchingWorkflowInstanceIdsForSubjectsAsync(Array.Empty <string>(), int.MaxValue, 0).ConfigureAwait(false);

            foreach (string current in instanceIds)
            {
                await store.DeleteWorkflowInstanceAsync(current).ConfigureAwait(false);
            }
        }
コード例 #26
0
        public async Task <int> RunAction(
            [ActivityTrigger] IDurableActivityContext context)
        {
            WorkflowMessageEnvelope envelope =
                context.GetInputWithCustomSerializationSettings <WorkflowMessageEnvelope>(this.serializerSettingsProvider.Instance);

            ITenant tenant = await this.tenantProvider.GetTenantAsync(envelope.TenantId);

            IWorkflowInstanceStore instanceStore = await this.workflowInstanceStoreFactory.GetWorkflowInstanceStoreForTenantAsync(tenant);

            return(await instanceStore.GetMatchingWorkflowInstanceCountForSubjectsAsync(envelope.Trigger.GetSubjects()));
        }
コード例 #27
0
 public TriggerRequestHandler(
     IHttpContextAccessor httpContext,
     IWorkflowInvoker workflowInvoker,
     IWorkflowRegistry registry,
     IWorkflowInstanceStore workflowInstanceStore)
 {
     this.httpContext           = httpContext.HttpContext;
     this.workflowInvoker       = workflowInvoker;
     this.registry              = registry;
     this.workflowInstanceStore = workflowInstanceStore;
     cancellationToken          = httpContext.HttpContext.RequestAborted;
 }
コード例 #28
0
 public CleanupJob(
     IWorkflowInstanceStore workflowInstanceStore,
     IClock clock,
     IRetentionFilterPipeline retentionFilterPipeline,
     IOptions <CleanupOptions> options,
     ILogger <CleanupJob> logger)
 {
     _workflowInstanceStore = workflowInstanceStore;
     _clock = clock;
     _retentionFilterPipeline = retentionFilterPipeline;
     _options = options.Value;
     _logger  = logger;
 }
コード例 #29
0
 public LockingWorkflowInstanceExecutor(
     IWorkflowInstanceExecutor workflowInstanceExecutor,
     IWorkflowInstanceStore workflowInstanceStore,
     IDistributedLockProvider distributedLockProvider,
     ElsaOptions elsaOptions,
     ILogger <LockingWorkflowInstanceExecutor> logger)
 {
     _workflowInstanceExecutor = workflowInstanceExecutor;
     _workflowInstanceStore    = workflowInstanceStore;
     _distributedLockProvider  = distributedLockProvider;
     _elsaOptions = elsaOptions;
     _logger      = logger;
 }
コード例 #30
0
ファイル: WorkflowReviver.cs プロジェクト: tle5/elsa-core
 public WorkflowReviver(
     IResumesWorkflow resumesWorkflow,
     IWorkflowInstanceDispatcher workflowInstanceDispatcher,
     IWorkflowRegistry workflowRegistry,
     IWorkflowInstanceStore workflowInstanceStore,
     IGetsStartActivitiesForCompositeActivityBlueprint startingActivitiesProvider)
 {
     _resumesWorkflow            = resumesWorkflow;
     _workflowInstanceDispatcher = workflowInstanceDispatcher;
     _workflowRegistry           = workflowRegistry;
     _workflowInstanceStore      = workflowInstanceStore;
     _startingActivitiesProvider = startingActivitiesProvider ?? throw new ArgumentNullException(nameof(startingActivitiesProvider));
 }