Example #1
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="elemName">元素名</param>
        /// <param name="xml">字符串参数</param>
        /// <param name="isXmlFile">是否是xml文件</param>
        public ActionURL(string elemName, ConfigureElement parent, XElement xElem)
            : base(parent, elemName, xElem)
        {
            if (xElem == null) return;

            ManualProcess = new CustomAction("manualProcess", this, xElem.Element("manualProcess"));
        }
Example #2
0
        /// 创建Activity对象
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="typeName"></param>
        /// <returns></returns>
        public static Activity CreateActivity(ConfigureElement parent, string typeName)
        {
            if (parent == null) return null;

            string activityName = typeName;
            if (!activityName.StartsWith("AgileEAP.Workflow.Definition"))
                activityName = string.Format("AgileEAP.Workflow.Definition.{0}", activityName);

            Activity activity = null;
            try
            {
                Type type = Type.GetType(activityName);
                activity = Activator.CreateInstance(type, new object[] { parent, null }) as Activity;
                activity.ActivityType = typeName.Cast<ActivityType>(ActivityType.ManualActivity);
                activity.Name = RemarkAttribute.GetTypeRemark(type);
                activity.ID = typeName + Guid.NewGuid().ToString();
                ((ProcessDefine)parent).Activities.SafeAdd(activity);
            }
            catch (Exception ex)
            {
                log.Error(ex);
            }

            return activity;
        }
Example #3
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="xml">字符串参数</param>
        /// <param name="isXmlFile">是否是xml文件</param>
        public ManualActivity(ConfigureElement parent, XElement xElem)
            : base(parent, xElem)
        {
            if (xElem == null)
            {
                Initilize();
                return;
            }

            ActivateRule = new ActivateRule(this, xElem.Element("activateRule"));
            XElement manualElem = xElem.Element("manualActivity");

            if (manualElem != null)
            {
                CustomURL = new ActionURL("customURL", this, manualElem.Element("customURL"));
                ResetURL = new ActionURL("resetURL", this, manualElem.Element("resetURL"));
                Participant = new Participant(this, manualElem.Element("participant"));

                TimeLimit = new TimeLimit(this, manualElem.Element("timeLimit"));
                MultiWorkItem = new MultiWorkItem(this, manualElem.Element("multiWorkItem"));

                var triggerEvents = manualElem.Element("triggerEvents");
                if (triggerEvents != null)
                {
                    var triggerEventlist = triggerEvents.Elements("triggerEvent");
                    if (triggerEventlist != null)
                        TriggerEvents = triggerEventlist.Select(o => new TriggerEvent(this, o)).ToList();
                }
                RollBack = new CustomAction("rollBack", this, manualElem.Element("rollBack"));
                FreeFlowRule = new FreeFlowRule(this, manualElem.Element("freeFlowRule"));
            }
        }
Example #4
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public CustomAction(ConfigureElement parent, XElement xElem)
     : base(parent, "customAction", xElem)
 {
     xElem.Elements().Where(e => e.Elements().Count() == 0)
             .ForEach(e => Properties.SafeAdd(e.Name.LocalName, e.Value));
     Parameters = xElem.Element("parameters").Elements().Select(e => new Parameter(this, e)).ToList();
 }
Example #5
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public StartActivity(ConfigureElement parent, XElement xElem)
     : base(parent, xElem)
 {
     if (xElem == null)
     {
         Initilize();
         return;
     }
 }
Example #6
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="xml">字符串参数</param>
        /// <param name="isXmlFile">是否是xml文件</param>
        public RouterActivity(ConfigureElement parent, XElement xElem)
            : base(parent, xElem)
        {
            XElement elem = xElem.Element("routerActivity");

            if (elem != null)
            {
                CustomURL = new ActionURL("customURL", this, elem.Element("customURL"));
            }
        }
Example #7
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public TimeLimit(ConfigureElement parent, XElement xElem)
     : base(parent, "timeLimit", xElem)
 {
     if (xElem != null)
     {
         CalendarSet = new CalendarSet(this, xElem.Element("calendar"));
         TimeLimitInfo = new TimeLimitInfo(this, xElem.Element("timeLimitInfo"));
         RemindInfo = new RemindInfo(this, xElem.Element("remindInfo"));
     }
 }
Example #8
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="xml">字符串参数</param>
        /// <param name="isXmlFile">是否是xml文件</param>
        public Participant(ConfigureElement parent, XElement xElem)
            : base(parent, "participant", xElem)
        {
            if (xElem == null)
            {
                Initilize();
                return;
            }

            Participantors = xElem.Element("participantors").Elements().Select(e => new Participantor(this, e)).ToList();
        }
Example #9
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="xml">字符串参数</param>
        /// <param name="isXmlFile">是否是xml文件</param>
        public EndActivity(ConfigureElement parent, XElement xElem)
            : base(parent, xElem)
        {
            if (xElem == null)
            {
                Initilize();
                return;
            }

            ActivateRule = new ActivateRule(this, xElem.Element("activateRule"));
        }
Example #10
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="xml">字符串参数</param>
        /// <param name="isXmlFile">是否是xml文件</param>
        public Form(ConfigureElement parent, XElement xElem)
            : base(parent, "form", xElem)
        {
            if (xElem == null)
            {
                Initilize();
                return;
            }

            if (xElem.Elements("field") != null)
                Fields = xElem.Elements("field").Select(o => new FormField(this, o)).ToList();
        }
Example #11
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="xml">字符串参数</param>
        /// <param name="isXmlFile">是否是xml文件</param>
        public AutoActivity(ConfigureElement parent, XElement xElem)
            : base(parent, xElem)
        {
            if (xElem == null) return;

            ActivateRule = new ActivateRule(this, xElem.Element("activateRule"));
            XElement elem = xElem.Element("autoActivity");
            if (elem != null)
            {
                TimeLimit = new TimeLimit(this, elem.Element("timeLimit"));
                TriggerEvents = elem.Element("triggerEvents").Elements("triggerEvent").Select(o => new TriggerEvent(this, o)).ToList();
                RollBack = new CustomAction("rollBack", this, elem.Element("rollBack"));
            }
        }
Example #12
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="nodeName"></param>
        /// <param name="nodeValue"></param>
        /// <param name="xElem"></param>
        public ConfigureElement(ConfigureElement parent, string nodeName, string nodeValue, XElement xElem)
        {
            Parent = parent;
            ElementName = nodeName;
            ElementValue = nodeValue;

            Attibutes = new Dictionary<string, object>();
            Properties = new Dictionary<string, object>();

            if (xElem == null) return;

            Current = (xElem.Name.LocalName == nodeName) ? xElem : xElem.Element(nodeName) ?? xElem.Descendants(nodeName).FirstOrDefault();
            Initilize(Current);
        }
Example #13
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="xml">字符串参数</param>
        /// <param name="isXmlFile">是否是xml文件</param>
        public Transition(ConfigureElement parent, XElement xElem)
            : base(parent, "transition", xElem)
        {
            XElement sourceElem = xElem.Element("source");
            XElement sinkElem = xElem.Element("sink");

            SourceOrientation = sourceElem.ChildElementValue("orientation");
            SinkOrientation = sinkElem.ChildElementValue("orientation");
            SourcePoint = new Point3D() { X = sourceElem.ChildElementValue("x").ToDouble(), Y = sourceElem.ChildElementValue("y").ToDouble() };
            SinkPoint = new Point3D() { X = sinkElem.ChildElementValue("x").ToDouble(), Y = sinkElem.ChildElementValue("y").ToDouble() };
            BendPoints = xElem.Element("bendPoints").Elements("bendPoint").Select(e => new BendPoint(this, e)).ToList();

            ProcessDefine wd = parent as ProcessDefine;
            SrcActivity = sourceElem.ChildElementValue("activityID");
            DestActivity = sinkElem.ChildElementValue("activityID");
        }
Example #14
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="xml">字符串参数</param>
        /// <param name="isXmlFile">是否是xml文件</param>
        public ActivateRule(ConfigureElement parent, XElement xElem)
            : base(parent, "activateRule", xElem)
        {
            if (xElem == null)
            {
                Parameters = new List<Parameter>();
                return;
            }

            ActivateRuleType = xElem.ChildElementValue("activateRuleType").Cast<ActivateRuleType>(ActivateRuleType.DirectRunning);
            XElement elem = xElem.Element("customAction");

            if (elem == null) return;

            elem.Elements().Where(e => e.Elements().Count() == 0)
                    .ForEach(e => Properties.SafeAdd(e.Name.LocalName, e.Value));
            Parameters = elem.Element("parameters").Elements().Select(e => new Parameter(this, e)).ToList();
        }
Example #15
0
        /// <summary>
        /// 创建Activity对象
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="xElem"></param>
        /// <returns></returns>
        public static Activity CreateActivity(ConfigureElement parent, XElement xElem)
        {
            if (xElem == null) return null;

            Activity activity = null;
            try
            {
                string typeName = xElem.Element("activityType").Value;
                if (!typeName.StartsWith("AgileEAP.Workflow.Definition"))
                    typeName = string.Format("AgileEAP.Workflow.Definition.{0}", typeName);
                Type type = Type.GetType(typeName);
                activity = Activator.CreateInstance(type, new object[] { parent, xElem }) as Activity;
            }
            catch (Exception ex)
            {
                log.Error(ex);
            }

            return activity;
        }
Example #16
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="xml">字符串参数</param>
        /// <param name="isXmlFile">是否是xml文件</param>
        public SubflowActivity(ConfigureElement parent, XElement xElem)
            : base(parent, xElem)
        {
            if (xElem == null)
            {
                Initilize();
                return;
            }

            ActivateRule = new ActivateRule(this, xElem.Element("activateRule"));
            XElement subElem = xElem.Element("subflowActivity");

            if (subElem != null)
            {
                if (subElem.Element("subProcess") != null)
                    SubProcess = subElem.Element("subProcess").Value;

                if (subElem.Element("InvokePattern") != null)
                    InvokePattern = subElem.Element("InvokePattern").Value.Cast<InvokePattern>(InvokePattern.Synchronous);

                if (subElem.Element("isMultiSubProcess") != null)
                    IsMultiSubProcess = subElem.Element("isMultiSubProcess").Value.Cast<bool>(false);

                if (subElem.Element("iterationRelevantData") != null)
                    IterationRelevantData = subElem.Element("iterationRelevantData").Value;

                if (subElem.Element("iterationVariableName") != null)
                    IterationVariableName = subElem.Element("iterationVariableName").Value;

                if (subElem.Element("triggerEvents") != null && subElem.Element("triggerEvents").Elements("triggerEvent") != null)
                    TriggerEvents = subElem.Element("triggerEvents").Elements("triggerEvent")
                                   .Select(e => new TriggerEvent(this, e)).ToList();
            }

            RollBack = new CustomAction("rollBack", this, xElem.Element("rollBack"));
        }
Example #17
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public DefaultIdea(ConfigureElement parent, XElement xElem)
     : base(parent, "defaultIdea", xElem)
 {
     Ideas = xElem.Elements("row").Select(o => new FormRow(this, o)).ToList();
 }
Example #18
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public Parameter(ConfigureElement parent, XElement xElem)
     : base(parent, "parameter", xElem)
 {
 }
Example #19
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public FormField(ConfigureElement parent, XElement xElem)
     : base(parent, "field", xElem)
 {
     if (xElem.Element("list") != null)
         ListItems = xElem.Element("list").Elements("listItem").Select(o => new ListItem(this, o)).ToList();
 }
Example #20
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public CustomAction(string elemName, ConfigureElement parent, XElement xElem)
     : base(parent, elemName, xElem)
 {
 }
Example #21
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public BizVariable(ConfigureElement parent, XElement xElem)
     : base(parent, "bizVariable", xElem)
 {
 }
Example #22
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public FreeFlowRule(ConfigureElement parent, XElement xElem)
     : base(parent, "freeFlowRule", xElem)
 {
 }
Example #23
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public RemindInfo(ConfigureElement parent, XElement xElem)
     : base(parent, "remindInfo", xElem)
 {
 }
Example #24
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public ProcessActivity(ConfigureElement parent, XElement xElem)
     : base(parent, xElem)
 {
 }
Example #25
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public FormColumn(ConfigureElement parent, XElement xElem)
     : base(parent, "column", xElem)
 {
 }
Example #26
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public Style(ConfigureElement parent, XElement xElem)
     : base(parent, "style", xElem)
 {
 }
Example #27
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public CalendarSet(ConfigureElement parent, XElement xElem)
     : base(parent, "calendar", xElem)
 {
 }
Example #28
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public Note(ConfigureElement parent, XElement xElem)
     : base(parent, "note", xElem)
 {
     Title = xElem.ChildElementValue("title");
     Content = xElem.ChildElementValue("content");
 }
Example #29
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public BendPoint(ConfigureElement parent, XElement xElem)
     : base(parent, "bendPoint", xElem)
 {
 }
Example #30
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="xml">字符串参数</param>
 /// <param name="isXmlFile">是否是xml文件</param>
 public Participantor(ConfigureElement parent, XElement xElem)
     : base(parent, "participantor", xElem)
 {
 }