public DecisionResponse(Decision decision)
        {
            Variables = new List<PythonVariableResponse>();

            Id = decision.Id;
            Condition = decision.Condition;
            decision.Variables.ForEach(v=> Variables.Add(new PythonVariableResponse(v)));
        }
        public UpdateDecisionRequest(Decision decision)
        {
            Method =  Method.POST;
            RestUrl = string.Format("workflowdecision/{0}", decision.Id);

            Variables = new List<PythonVariableResponse>();

            Condition = decision.Condition;
            NextWorkflowItemOnTrue = decision.NextItemTrue;
            decision.Variables.ForEach(v => Variables.Add(new PythonVariableResponse(v)));
        }
Пример #3
0
        /// <summary>
        /// Parsed ein Schnittstellen-Modell in eine Decision
        /// </summary>
        /// <param name="response">Das Modell der Schnittstelle.</param>
        /// <returns>Ein Decision Objekt</returns>
        public static Decision Parse(DecisionResponse response)
        {
            var decision = new Decision();
            decision.Id = response.Id;
            decision.Condition = response.Condition;
            if (response.NextWorkflowItemOnTrue != null)
            {
                decision.NextItemTrue = (int) response.NextWorkflowItemOnTrue;
            }
            else
            {
                decision.NextItemTrue = -1;
            }

            response.Variables.ForEach(v => decision.Variables.Add(PythonVariable.Parse(v)));

            return decision;
        }
        public override void SaveDetails()
        {
            var client = ClientSession.Instance.RelaxoClient;
            var decision = new Decision();
            decision.Id = Id;
            decision.Condition = Condition;
            decision.NextItemTrue = NextItemTrue;            
            decision.Variables.AddRange(from variable
                                        in DecisionVariable
                                        select new PythonVariable { Name = variable.Name,                                                                      
                                                                      TaskComponentId = variable.TaskComponentId,
                                                                      TaskId = variable.TaskId});

            client.UpdateDecision(decision);
        }
        public DecisionViewModel(Decision decision)
            :base(decision)
        {
            Image = "decision.png";
            Width = 90;
            Height = 90;

            DecisionVariable = new ObservableCollection<PythonVariableViewModel>();
            AllTasks = new ObservableCollection<Task>();
            ComponentsFromTask = new ObservableCollection<TaskComponent>();
        }