Example #1
0
        public WFState(XmlNode node, WFSrc wfsrc, WFTarget wftarget, string assemblycache)
        {
            this.State = new KRSrcWorkflow.WFState(string.Empty);
            this.Target = null;
            this.Mappings = new List<WFMapping>();

            if (node == null)
                throw new Exception("Input node is null");

            XmlNode value = node.Attributes.GetNamedItem("value");
            if((value == null) || (value.Value == string.Empty))
                throw new Exception("No value attribute in node");
            this.State.Value = value.Value;

            XmlNode target = node.Attributes.GetNamedItem("target");
            if ((wftarget == null) && ((value == null) || (value.Value == string.Empty)))
                throw new Exception("No target attribute in node");

            if (target != null)
            {
                try
                {
                    wftarget = new WFTarget(target.Value, assemblycache);
                }
                catch (Exception ex)
                {
                    throw new Exception("Create WFTarget failed.", ex);
                }
                this.Target = wftarget;
            }
            foreach (XmlNode mappingnode in node.SelectNodes("mapping"))
                this.Mappings.Add(new WFMapping(mappingnode, wfsrc.AssemblyType, wftarget.AssemblyType));
        }
Example #2
0
        public WFState(XmlNode node, WFSrc wfsrc, WFTarget wftarget, string assemblycache)
        {
            this.State    = new KRSrcWorkflow.WFState(string.Empty);
            this.Target   = null;
            this.Mappings = new List <WFMapping>();

            if (node == null)
            {
                throw new Exception("Input node is null");
            }

            XmlNode value = node.Attributes.GetNamedItem("value");

            if ((value == null) || (value.Value == string.Empty))
            {
                throw new Exception("No value attribute in node");
            }
            this.State.Value = value.Value;

            XmlNode target = node.Attributes.GetNamedItem("target");

            if ((wftarget == null) && ((value == null) || (value.Value == string.Empty)))
            {
                throw new Exception("No target attribute in node");
            }

            if (target != null)
            {
                try
                {
                    wftarget = new WFTarget(target.Value, assemblycache);
                }
                catch (Exception ex)
                {
                    throw new Exception("Create WFTarget failed.", ex);
                }
                this.Target = wftarget;
            }
            foreach (XmlNode mappingnode in node.SelectNodes("mapping"))
            {
                this.Mappings.Add(new WFMapping(mappingnode, wfsrc.AssemblyType, wftarget.AssemblyType));
            }
        }
Example #3
0
 public WFState(XmlNode node, WFSrc wfsrc, WFTarget wftarget)
     : this(node, wfsrc, wftarget, string.Empty)
 {
 }
Example #4
0
 public WFState(XmlNode node, WFSrc wfsrc)
     : this(node, wfsrc, null)
 {
 }
Example #5
0
 public WFState(XmlNode node, WFSrc wfsrc, WFTarget wftarget)
     : this(node, wfsrc, wftarget, string.Empty)
 {
 }
Example #6
0
 public WFState(XmlNode node, WFSrc wfsrc) : this(node, wfsrc, null)
 {
 }