当前位置: 首页>>代码示例>>C#>>正文


C# Process.GetDataFields方法代码示例

本文整理汇总了C#中Process.GetDataFields方法的典型用法代码示例。如果您正苦于以下问题:C# Process.GetDataFields方法的具体用法?C# Process.GetDataFields怎么用?C# Process.GetDataFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Process的用法示例。


在下文中一共展示了Process.GetDataFields方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Parse

 private Client.Process Parse(Process process)
 {
     return new Client.Process()
     {
         CreateTime = process.CreateTime,
         DataFields = process.GetDataFields(),
         ID = process.ID,
         Originator = process.Originator.UserName,
         Priority = process.Priority,
         ProcessType = this.Parse(process.ProcessType),
         Status = (Client.ProcessStatus)(int)process.Status,
         Title = process.Title
     };
 }
开发者ID:jatinbhole,项目名称:NTFE-BPM,代码行数:14,代码来源:TFlowEngine.cs

示例2: Create

            public virtual Process Create(Process parent, string subProcessTypeName, Guid assignedSubProcessId)
            {
                var subProcessType = this._processTypeService.GetProcessType(subProcessTypeName);
                if (subProcessType == null)
                    throw new InvalidOperationException(string.Format("不存在名称为“{0}”的流程类型信息", subProcessTypeName));

                var subProcess = new Process(string.IsNullOrWhiteSpace(subProcessType.Description)
                    ? _defaultTitle
                    : subProcessType.Description
                    , subProcessType
                    //以系统账号身份发起子流程
                    , this._userService.GetUserWhatever(this._sysUserName)
                    , 10
                    //将父流程变量传递给子流程
                    , parent.GetDataFields()
                    , parent);
                this._processService.Create(subProcess, assignedSubProcessId);
                return subProcess;
            }
开发者ID:jatinbhole,项目名称:NTFE-BPM,代码行数:19,代码来源:SubProcessCreateResumption.cs

示例3:

        void IProcessService.Update(Process process)
        {
            _repository.Update(process);

            this._log.InfoFormat("更新流程实例“{0}”#{1},状态:{2},当前节点索引:{3}|参数:{4}"
               , process.Title
               , process.ID
               , process.Status
               , process.GetCurrentNode()
               , string.Join("$", process.GetDataFields().Select(o => o.Key + "=" + o.Value)));
        }
开发者ID:jatinbhole,项目名称:NTFE-BPM,代码行数:11,代码来源:ProcessService.cs

示例4: ProcessStartResumption

        void IProcessService.Create(Process process, Guid assignedId)
        {
            process.SetId(assignedId);
            process.ChangeStatus(ProcessStatus.Running);
            //HACK:【重要】创建流程时预先设置调度标识以此作为按流程串行调度依据
            process.SetChargingBy(this._schedulerService.GetChargingBy(assignedId));
            _repository.Add(process);
            //创建流程启动请求
            this._schedulerService.Add(new ProcessStartResumption(process));

            this._log.InfoFormat("用户{0}发起类型为“{1}”的流程“{2}”#{3},参数:{4}"
                , process.Originator.UserName
                , process.ProcessType.Name
                , process.Title
                , process.ID
                , string.Join("$", process.GetDataFields().Select(o => o.Key + "=" + o.Value)));
        }
开发者ID:jatinbhole,项目名称:NTFE-BPM,代码行数:17,代码来源:ProcessService.cs

示例5: CreateDataFieldExtension

 /// <summary>
 /// 创建数据字段扩展
 /// </summary>
 /// <param name="p"></param>
 /// <returns></returns>
 public static DataFieldExtension CreateDataFieldExtension(Process p)
 {
     return new DataFieldExtension(p.Originator.UserName, p.GetCurrentNode(), p.GetDataFields());
 }
开发者ID:jatinbhole,项目名称:NTFE-BPM,代码行数:9,代码来源:WorkflowBuilder.cs

示例6: RunParentProcess


//.........这里部分代码省略.........
            
            var flowEngine = DependencyResolver.Resolve<ITFlowEngine>();
            flowEngine.CreateProcessType("UnitTestTypeParentProcess"
                , Resource.UnitTestTypeParentProcess_Workflow
                , Resource.UnitTestTypeParentProcess_Settings
                , "ParentProcess"
                , "ParentProcess");
            var parentProcessType = this._processTypeService.GetProcessType("UnitTestTypeParentProcess");

            flowEngine.CreateProcessType("ClientTest1"
                , Resource.UnitTestTypeSubProcess_Workflow
                , Resource.UnitTestTypeSubProcess_Settings
                , "SubProcess"
                , "SubProcess");

            var subProcessType = this._processTypeService.GetProcessType("ClientTest1");

            WorkItem wi = null;

            var user = this._userService.GetUserWhatever("chong.xuc");

            // 创建父流程实例
            var parentProcess = new Process("From UnitTest at " + DateTime.Now,
                parentProcessType,
                user);
            this._processService.Create(parentProcess);

            // 记录父流程实例编号,以便后续使用
            Guid parentProcessId = parentProcess.ID;

            // 运行父流程实例
            this._scheduler.Run();
            Thread.Sleep(5000);

            // 父流程节点1
            using (var r = CodeSharp.Core.Castles.NHibernateRepositoryUtility.UnmanagedSession())
            {
                parentProcess = this._processService.GetProcess(parentProcessId);
                wi = _workItemService.GetWorkItems(user, parentProcess, null).First();
                Assert.AreEqual("节点1", wi.ActivityName);
                _workItemService.Execute(wi.ID, user, "同意", new Dictionary<string, string> { { "ParentVariable", "1" } });
                r.Flush();
            }
            Thread.Sleep(5000);

            Process subProcess = null;
            Guid subProcessId = Guid.Empty;

            // 父流程节点2
            using (var r = CodeSharp.Core.Castles.NHibernateRepositoryUtility.UnmanagedSession())
            {
                long subProcessCount = 0;
                IList<Process> subProcesses = this._processService.GetProcesses(
                    NHibernate.Criterion.DetachedCriteria.For<Process>().Add(
                    NHibernate.Criterion.Expression.Eq("ProcessType",subProcessType)), 0, 10, out subProcessCount)
                    .ToList();
                if (subProcessCount > 0)
                {
                    subProcess = subProcesses[0];
                    subProcessId = subProcess.ID;
                }

                user = this._userService.GetUserWhatever("wfservice");

                // 子流程节点1
                wi = _workItemService.GetWorkItems(user, subProcess, null).First();
                Assert.AreEqual("节点1", wi.ActivityName);
                _workItemService.Execute(wi.ID, user, "同意", null);
                r.Flush();
            }
            Thread.Sleep(5000);

            // 子流程节点2
            using (var r = CodeSharp.Core.Castles.NHibernateRepositoryUtility.UnmanagedSession())
            {
                subProcess = this._processService.GetProcess(subProcessId);
                wi = _workItemService.GetWorkItems(user, subProcess, null).First();
                Assert.AreEqual("节点2", wi.ActivityName);
                _workItemService.Execute(wi.ID, user, "同意", new Dictionary<string, string> { { "ParentVariable", "2" } });
                r.Flush();
            }
            Thread.Sleep(5000);

            user = this._userService.GetUserWhatever("chong.xuc");

            // 父流程节点3
            using (var r = CodeSharp.Core.Castles.NHibernateRepositoryUtility.UnmanagedSession())
            {
                parentProcess = this._processService.GetProcess(parentProcessId);
                wi = _workItemService.GetWorkItems(user, parentProcess, null).First();
                Assert.AreEqual("节点3", wi.ActivityName);
                Assert.AreEqual("2", parentProcess.GetDataFields().Where(p => p.Key == "ParentVariable").Select(o => o.Value).First());
                _workItemService.Execute(wi.ID, user, "同意", null);
                r.Flush();
            }
            Thread.Sleep(5000);

            this._scheduler.Stop();
            Thread.Sleep(1000);
        }
开发者ID:jatinbhole,项目名称:NTFE-BPM,代码行数:101,代码来源:SubProcessTest.cs


注:本文中的Process.GetDataFields方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。