本文整理汇总了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
};
}
示例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;
}
示例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)));
}
示例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)));
}
示例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());
}
示例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);
}