/// <inheritdoc/>
        public virtual async Task <GrpcApiResult <byte[]> > ArchiveWorkflowInstanceAsync(string id, CallContext context = default)
        {
            var result = await this.Mediator.ExecuteAsync(new Application.Commands.WorkflowInstances.V1ArchiveWorkflowInstanceCommand(id), context.CancellationToken);

            OperationResult <byte[]> toReturn;

            if (result.Succeeded)
            {
                toReturn = new(((MemoryStream)result.Data !).ToArray());
            }
            else
            {
                toReturn = new(result.Code, result.Errors?.ToArray());
            }
            return(GrpcApiResult.CreateFor(toReturn));
        }
Example #2
0
 /// <inheritdoc/>
 public virtual async Task <GrpcApiResult <V1WorkflowInstance> > SetOutputAsync(V1SetWorkflowInstanceOutputCommand command, CallContext context = default)
 {
     return(GrpcApiResult.CreateFor(await this.Mediator.ExecuteAsync(Mapper.Map <Application.Commands.WorkflowInstances.V1SetWorkflowInstanceOutputCommand>(command), context.CancellationToken)));
 }
Example #3
0
 /// <inheritdoc/>
 public virtual async Task <GrpcApiResult <V1WorkflowInstance> > CancelAsync(string workflowInstanceId, CallContext context = default)
 {
     return(GrpcApiResult.CreateFor(await this.Mediator.ExecuteAsync(new Application.Commands.WorkflowInstances.V1MarkWorkflowInstanceAsCancelledCommand(workflowInstanceId), context.CancellationToken)));
 }
Example #4
0
 /// <inheritdoc/>
 public virtual async Task <GrpcApiResult <Dynamic> > GetActivityStateDataAsync(string activityId, CallContext context = default)
 {
     return(GrpcApiResult.CreateFor(await this.Mediator.ExecuteAsync(new Application.Queries.WorkflowActivities.V1GetActivityParentStateDataQuery(activityId), context.CancellationToken)));
 }
Example #5
0
 /// <inheritdoc/>
 public virtual async Task <GrpcApiResult <V1WorkflowActivity> > CancelActivityAsync(string activityId, CallContext context = default)
 {
     return(GrpcApiResult.CreateFor(await this.Mediator.ExecuteAsync(new Application.Commands.WorkflowActivities.V1CancelWorkflowActivityCommand(activityId), context.CancellationToken)));
 }
Example #6
0
 /// <inheritdoc/>
 public virtual async Task <GrpcApiResult <V1WorkflowActivity> > FaultActivityAsync(V1FaultWorkflowActivityCommand command, CallContext context = default)
 {
     return(GrpcApiResult.CreateFor(await this.Mediator.ExecuteAsync(Mapper.Map <Application.Commands.WorkflowActivities.V1FaultWorkflowActivityCommand>(command), context.CancellationToken)));
 }
Example #7
0
 /// <inheritdoc/>
 public virtual async Task <GrpcApiResult <List <V1WorkflowActivity> > > GetActivitiesAsync(Integration.Queries.WorkflowActivities.V1GetWorkflowActivitiesQuery query, CallContext context = default)
 {
     return(GrpcApiResult.CreateFor(await this.Mediator.ExecuteAsync(Mapper.Map <Application.Queries.WorkflowActivities.V1GetWorkflowActivitiesQuery>(query), context.CancellationToken)));
 }
Example #8
0
 /// <inheritdoc/>
 public virtual async Task <GrpcApiResult <V1Event?> > ConsumeOrBeginCorrelateEventAsync(V1ConsumeWorkflowInstancePendingEventCommand command, CallContext context = default)
 {
     return(GrpcApiResult.CreateFor(await this.Mediator.ExecuteAsync(Mapper.Map <Application.Commands.WorkflowInstances.V1ConsumeOrBeginCorrelateEventCommand>(command), context.CancellationToken)));
 }
 /// <inheritdoc/>
 public virtual async Task <GrpcApiResult <List <V1Workflow> > > GetWorkflowsAsync(string?query = null, CallContext context = default)
 {
     return(GrpcApiResult.CreateFor(await this.Mediator.ExecuteAsync(new V1FilterQuery <V1Workflow>(this.QueryOptionsParser.Parse <V1Workflow>(query)), context.CancellationToken)));
 }
 /// <inheritdoc/>
 public virtual async Task <GrpcApiResult <V1Workflow> > GetWorkflowByIdAsync(string id, CallContext context = default)
 {
     return(GrpcApiResult.CreateFor(await this.Mediator.ExecuteAsync(new V1FindByIdQuery <V1Workflow, string>(id), context.CancellationToken)));
 }
 /// <inheritdoc/>
 public virtual async Task <GrpcApiResult <V1Workflow> > CreateWorkflowAsync(Integration.Commands.Workflows.V1CreateWorkflowCommand command, CallContext context = default)
 {
     return(GrpcApiResult.CreateFor(await this.Mediator.ExecuteAsync(this.Mapper.Map <Application.Commands.Workflows.V1CreateWorkflowCommand>(command), context.CancellationToken)));
 }
 /// <inheritdoc/>
 public virtual async Task <GrpcApiResult <V1OperationalReport> > GetOperationalReportAsync(GrpcApiRequest <DateTime> request, CallContext context = default)
 {
     return(GrpcApiResult.CreateFor(await this.Mediator.ExecuteAsync(new V1FindByIdQuery <V1OperationalReport, string>(V1OperationalReport.GetIdFor(request.Data)), context.CancellationToken)));
 }
 /// <inheritdoc/>
 public virtual async Task <GrpcApiResult> DeleteCorrelationAsync(string id, CallContext context = default)
 {
     return(GrpcApiResult.CreateFor(await this.Mediator.ExecuteAsync(new V1DeleteCommand <V1Correlation, string>(id), context.CancellationToken)));
 }
 /// <inheritdoc/>
 public virtual async Task <GrpcApiResult <string> > GetWorkflowInstanceLogsAsync(string id, CallContext context = default)
 {
     return(GrpcApiResult.CreateFor(await this.Mediator.ExecuteAsync(new Application.Queries.WorkflowInstances.V1GetWorkflowInstanceLogsQuery(id), context.CancellationToken)));
 }
 /// <inheritdoc/>
 public virtual async Task <GrpcApiResult> DeleteWorkflowInstanceAsync(string id, CallContext context = default)
 {
     return(GrpcApiResult.CreateFor(await this.Mediator.ExecuteAsync(new Application.Commands.WorkflowInstances.V1DeleteWorkflowInstanceCommand(id), context.CancellationToken)));
 }