Beispiel #1
0
        public async Task <IActionResult> Handle(string id, CancellationToken cancellationToken = default)
        {
            var workflowInstance = await _workflowInstanceStore.FindByIdAsync(id, cancellationToken);

            if (workflowInstance == null)
            {
                return(NotFound());
            }

            var tenantId = await _tenantAccessor.GetTenantIdAsync(cancellationToken);

            var workflowBlueprint = await _workflowRegistry.FindByDefinitionVersionIdAsync(workflowInstance.DefinitionVersionId, tenantId, cancellationToken);

            await _publisher.Publish(new RequestingWorkflowInstance(workflowInstance, workflowBlueprint !), cancellationToken);

            return(Json(workflowInstance, _contentSerializer.GetSettings()));
        }
Beispiel #2
0
        public async Task <IWorkflowBlueprint?> FindByDefinitionVersionIdAsync(string definitionVersionId, string?tenantId = default, CancellationToken cancellationToken = default)
        {
            var cacheKey = $"{RootKey}:definition-version:id:{definitionVersionId}:{tenantId}";

            return(await FindInternalAsync(cacheKey, () => _workflowRegistry.FindByDefinitionVersionIdAsync(definitionVersionId, tenantId, cancellationToken), cancellationToken));
        }