Skip to content

Load workflow from json file #506

Answered by thiagoteles
thiagoteles asked this question in Q&A
Discussion options

You must be logged in to vote

Edit: I found a topic in gitter.

I`ll post here, maybe I can help someone.

  1. Create a class:
public class JsonWorkflowProvider : IWorkflowProvider
{
    private readonly IWorkflowSerializer _serializer;
    private readonly IConfiguration _configuration;

    public JsonWorkflowProvider(IWorkflowSerializer serializer, IConfiguration configuration)
    {
        _serializer = serializer;
        _configuration = configuration;
    }
    
    public async Task<IEnumerable<WorkflowDefinitionVersion>> GetWorkflowDefinitionsAsync(CancellationToken cancellationToken)
    {
        var workflowsDirectoryPath = _configuration["WorkflowPath"];
        var workflowFiles = Directory.GetFiles(workflo…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@thiagoteles
Comment options

Comment options

You must be logged in to vote
3 replies
@chandramohank
Comment options

@jdevillard
Comment options

@sfmskywalker
Comment options

Answer selected by thiagoteles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #506 on December 11, 2020 15:21.