本文整理汇总了C#中Process.ChangeStatus方法的典型用法代码示例。如果您正苦于以下问题:C# Process.ChangeStatus方法的具体用法?C# Process.ChangeStatus怎么用?C# Process.ChangeStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Process
的用法示例。
在下文中一共展示了Process.ChangeStatus方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CancelAllAbout
private void CancelAllAbout(Process parent, Process sub, int depth)
{
//子流程删除只需要处于调度项安全即可
if (!this.IsSchedulingSafe(sub))
throw new InvalidOperationException(string.Format(
"流程“{0}”#{1}的子流程“{2}”#{3}处于{4}状态,无法将其撤销", parent.Title, parent.ID, sub.Title, sub.ID, sub.Status));
//删除子流程
sub.ChangeStatus(ProcessStatus.Deleted);
_repository.Update(sub);
this._log.InfoFormat("流程“{0}”#{1}的子流程“{2}”#{3}被置为删除状态", parent.Title, parent.ID, sub.Title, sub.ID);
this.CancelAllAbout(sub, depth);
}
示例2: 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));
}
示例3: 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());
}
示例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: ChangeProcessStatus
public static void ChangeProcessStatus(Process p, ProcessStatus status)
{
p.ChangeStatus(status);
}