本文整理汇总了C#中Process.GetCurrentNode方法的典型用法代码示例。如果您正苦于以下问题:C# Process.GetCurrentNode方法的具体用法?C# Process.GetCurrentNode怎么用?C# Process.GetCurrentNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Process
的用法示例。
在下文中一共展示了Process.GetCurrentNode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PerformGoto
//仅抽取ProcessService实现的Goto主体逻辑
internal static void PerformGoto(ProcessService processService
, ISchedulerService schedulerService
, ILog log
, Process process
, string activityName
, out string current
, out int currentNode
, out int targetNode)
{
var setting = process.ProcessType.GetActivitySetting(activityName);
if (setting == null)
throw new InvalidOperationException("没有找到指定节点“" + activityName + "”的定义");
if (setting.IsChildOfActivity)
throw new InvalidOperationException("不能跳转至子节点“" + activityName + "”");
currentNode = process.GetCurrentNode();
try { current = process.ProcessType.GetActivitySetting(currentNode).ActivityName; }
catch (Exception e)
{
current = "未找到定义";
log.Warn("查找流程当前节点设置信息时异常", e);
}
//0.更新currentnode指向目标节点
process.UpdateCurrentNode(targetNode = setting.FlowNodeIndex);
process.ChangeStatus(ProcessStatus.Running);
_repository.Update(process);
//1.取消所有相关信息
processService.CancelAllAbout(process);
//2.重新创建恢复请求
schedulerService.Add(new ProcessStartResumption(process));
}
示例2: InvalidOperationException
void IProcessService.Restart(Process process)
{
if (process.Status != ProcessStatus.Stopped)
throw new InvalidOperationException("指定的流程没有处于Stopped状态");
process.ChangeStatus(ProcessStatus.Running);
_repository.Update(process);
//创建恢复请求
this._schedulerService.Add(new ProcessStartResumption(process));
this._log.InfoFormat("流程实例“{0}”#{1}在节点索引#{2}处被重新启动"
, process.Title
, process.ID
, process.GetCurrentNode());
}
示例3: foreach
//获取当前节点的上一个节点实例
ActivityInstanceBase IProcessService.GetPreviousActivityInstance(Process process)
{
var current = process.GetCurrentNode();
//将会获取到所有节点实例,应按倒序获取当前运行中的
var all = _repository.FindAllActivityInstances(process).OrderByDescending(o => o.CreateTime);
//时间倒序查找第一个不等于当前节点的节点实例
foreach (var i in all)
if (i.FlowNodeIndex != current)
return i;
return null;
}
示例4:
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)));
}
示例5: GetCurrentActivityName
public static string GetCurrentActivityName(Process p)
{
return p.ProcessType.GetActivitySetting(p.GetCurrentNode()).ActivityName;
}
示例6: GetCurrentNode
//Process
public static int GetCurrentNode(Process p)
{
return p.GetCurrentNode();
}
示例7: 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());
}