Exemplo n.º 1
0
        public static WorkflowTransitionDto FromDomain(WorkflowTransition transition)
        {
            var result = new WorkflowTransitionDto {
                Expression = transition.Expression, Roles = transition.Roles?.ToArray()
            };

            return(result);
        }
Exemplo n.º 2
0
        public static WorkflowStepDto?FromWorkflowStep(WorkflowStep step)
        {
            if (step == null)
            {
                return(null);
            }

            return(SimpleMapper.Map(step, new WorkflowStepDto
            {
                Transitions = step.Transitions.ToDictionary(
                    y => y.Key,
                    y => WorkflowTransitionDto.FromWorkflowTransition(y.Value) !)
            }));
Exemplo n.º 3
0
        public static WorkflowStepDto FromWorkflowStep(WorkflowStep step)
        {
            var response = SimpleMapper.Map(step, new WorkflowStepDto
            {
                Transitions = step.Transitions.ToDictionary(
                    y => y.Key,
                    y => WorkflowTransitionDto.FromWorkflowTransition(y.Value))
            });

            if (step.NoUpdate != null)
            {
                response.NoUpdate           = true;
                response.NoUpdateExpression = step.NoUpdate.Expression;
                response.NoUpdateRoles      = step.NoUpdate.Roles?.ToArray();
            }

            return(response);
        }