Ejemplo n.º 1
0
        public void LoadXml(XElement data)
        {
            TeardownWorkflowDefinition();

            var definition = new FunctionDefinition();

            definition.LoadXml(data);

            if (data != null)
            {
                definition.BeginInit();

                var activities = data.Element("Activities").Elements();
                foreach (var activity in activities.Select(ParseActivity).Where(a => a != null))
                {
                    definition.AddItem(activity);
                }

                var links = data.Element("References").Elements();
                foreach (var link in links.Select(ParseLink).Where(l => l != null))
                {
                    definition.AddItem(link);
                }

                definition.EndInit();
            }

            Workflow = definition;
            InitializeWorkflowDefinition();
        }