Пример #1
0
        public Guid CreateData(Guid flowID, string pkValue)
        {
            WorkFlowInstalled workFlowRunModel = new WorkFlow().GetWorkFlowRunModel(flowID);

            if (workFlowRunModel == null)
            {
                return(Guid.Empty);
            }
            IEnumerable <DataBases> dataBases = workFlowRunModel.DataBases;

            if (dataBases.Count() == 0)
            {
                return(Guid.Empty);
            }
            DataBases    dataBases2   = dataBases.First();
            WorkFlowData workFlowData = new WorkFlowData();

            RoadFlow.Data.Model.WorkFlowData workFlowData2 = new RoadFlow.Data.Model.WorkFlowData
            {
                ID         = Guid.NewGuid(),
                InstanceID = Guid.NewGuid(),
                LinkID     = dataBases2.LinkID,
                TableName  = dataBases2.Table,
                FieldName  = dataBases2.PrimaryKey,
                Value      = pkValue
            };
            workFlowData.Add(workFlowData2);
            return(workFlowData2.InstanceID);
        }
Пример #2
0
        /// <summary>
        /// 创建流程单个实例数据
        /// </summary>
        /// <param name="flowID"></param>
        /// <param name="pkValue"></param>
        /// <returns>实例ID</returns>
        public Guid CreateData(Guid flowID, string pkValue)
        {
            var wfi = new WorkFlow().GetWorkFlowRunModel(flowID);

            if (wfi == null)
            {
                return(Guid.Empty);
            }
            var dbs = wfi.DataBases;

            if (dbs.Count() == 0)
            {
                return(Guid.Empty);
            }
            var          db     = dbs.First();
            WorkFlowData wfData = new WorkFlowData();

            RoadFlow.Data.Model.WorkFlowData wfdata = new RoadFlow.Data.Model.WorkFlowData();
            wfdata.ID         = Guid.NewGuid();
            wfdata.InstanceID = Guid.NewGuid();
            wfdata.LinkID     = db.LinkID;
            wfdata.TableName  = db.Table;
            wfdata.FieldName  = db.PrimaryKey;
            wfdata.Value      = pkValue;
            wfData.Add(wfdata);
            return(wfdata.InstanceID);
        }
Пример #3
0
        public Guid CreateData(Guid flowID, string pkValue)
        {
            WorkFlowInstalled workFlowRunModel = new WorkFlow().GetWorkFlowRunModel(flowID, true);

            if (workFlowRunModel == null)
            {
                return(Guid.Empty);
            }
            IEnumerable <DataBases> dataBases1 = workFlowRunModel.DataBases;

            if (dataBases1.Count <DataBases>() == 0)
            {
                return(Guid.Empty);
            }
            DataBases    dataBases2    = dataBases1.First <DataBases>();
            WorkFlowData workFlowData1 = new WorkFlowData();

            RoadFlow.Data.Model.WorkFlowData workFlowData2 = new RoadFlow.Data.Model.WorkFlowData();
            workFlowData2.ID         = Guid.NewGuid();
            workFlowData2.InstanceID = Guid.NewGuid();
            workFlowData2.LinkID     = dataBases2.LinkID;
            workFlowData2.TableName  = dataBases2.Table;
            workFlowData2.FieldName  = dataBases2.PrimaryKey;
            workFlowData2.Value      = pkValue;
            RoadFlow.Data.Model.WorkFlowData model = workFlowData2;
            workFlowData1.Add(model);
            return(workFlowData2.InstanceID);
        }