Пример #1
0
        public BPMObArg getArg(ProcessInstance pi)
        {
            var arg = new BPMObArg()
            {
                ProcessID   = pi.ID,
                TaskID      = this.ID,
                TaskName    = this.Name,
                TaskUser    = "******",
                TaskModelID = this.SourceID,
                CreateUser  = pi.CreateUser,
                ProcessData = pi.InputData,
            };

            var nextTo = pi.Sequences[this.To].To;

            if (pi.Gateways.ContainsKey(nextTo) &&
                pi.Gateways[nextTo].Type == GatewayType.Exclusive)
            {
                arg.ArgName = pi.Sequences[pi.Gateways[nextTo].Default].Condition;
            }

            if (IsDone)
            {
                arg.TaskUser = "";
                arg.IsBack   = true;
            }

            return(arg);
        }
Пример #2
0
        public BPMObArg getArg(ProcessInstance pi)
        {
            var arg = new BPMObArg()
            {
                ProcessID   = pi.ID,
                TaskID      = this.ID,
                TaskName    = this.Name,
                TaskUser    = "******",
                TaskModelID = this.SourceID,
                CreateUser  = pi.CreateUser,
                ProcessData = pi.InputData,
            };

            var nextTo = pi.Sequences[this.To].To;

            if (pi.Gateways.ContainsKey(nextTo) &&
                pi.Gateways[nextTo].Type == GatewayType.Exclusive)
            {
                arg.ArgName = pi.Sequences[pi.Gateways[nextTo].Default].Condition;
            }

            if (IsDone)
            {
                arg.TaskUser = this.UserID.ToString();
                arg.IsBack   = true;
            }
            else if (this.Owner != null && !string.IsNullOrEmpty(this.Owner.Name))
            {
                if (this.UserID > 0)
                {
                    arg.TaskUser = this.UserID.ToString();
                }
                else if (pi.InputData.ContainsKey(this.Owner.Name))
                {
                    arg.TaskUser = pi.InputData[this.Owner.Name].ToString();
                }
                else if (pi.ProcessResouces[this.Owner.Name].Users.Count > 0)
                {
                    arg.TaskUser = pi.ProcessResouces[this.Owner.Name].Users.First().Key;
                }
            }

            return(arg);
        }