public async Task CreateAsync(WorkflowDefinitionCreateDto input)
        {
            var workflow = new WorkflowDefinitionVersion(
                GuidGenerator.Create().ToString(),
                input.Name,
                input.Description,
                input.IsSingleton,
                input.IsDisabled);

            workflow.Activities = input.Activities
                                  .Select(x => new ActivityDefinition(x.Id, x.Type,
                                                                      x.State,
                                                                      x.Left, x.Top))
                                  .ToList();
            workflow.Connections = input.Connections.Select(
                x => new ConnectionDefinition(GuidGenerator.Create().ToString(), x.SourceActivityId, x.DestinationActivityId, x.Outcome)).ToList();
            workflow.IsLatest = true;
            await _workflowDefinitionVersionRepository.InsertAsync(workflow);
        }
 private ElsaWorkflowDefinitionVersion Map(WorkflowDefinitionVersion source) => ObjectMapper.Map <WorkflowDefinitionVersion, ElsaWorkflowDefinitionVersion>(source);
Exemple #3
0
 private global::Elsa.Models.WorkflowDefinitionVersion Map(WorkflowDefinitionVersion source) => _objectMapper.Map <WorkflowDefinitionVersion, global::Elsa.Models.WorkflowDefinitionVersion>(source);