本文整理汇总了C#中NativeActivityContext.CreateBookmark方法的典型用法代码示例。如果您正苦于以下问题:C# NativeActivityContext.CreateBookmark方法的具体用法?C# NativeActivityContext.CreateBookmark怎么用?C# NativeActivityContext.CreateBookmark使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NativeActivityContext
的用法示例。
在下文中一共展示了NativeActivityContext.CreateBookmark方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
protected override void Execute(NativeActivityContext context)
{
Bookmark bookmark = context.CreateBookmark(new BookmarkCallback(this.OnMainRootComplete), BookmarkOptions.NonBlocking);
context.RegisterMainRootCompleteCallback(bookmark);
CompensationExtension extension = context.GetExtension<CompensationExtension>();
extension.WorkflowCompensation = context.CreateBookmark(new BookmarkCallback(this.OnCompensate));
extension.WorkflowConfirmation = context.CreateBookmark(new BookmarkCallback(this.OnConfirm));
context.ResumeBookmark(extension.WorkflowCompensationScheduled, null);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:WorkflowCompensationBehavior.cs
示例2: Execute
protected override void Execute(NativeActivityContext context)
{
Bookmark mainRootCompleteBookmark = context.CreateBookmark(OnMainRootComplete, BookmarkOptions.NonBlocking);
context.RegisterMainRootCompleteCallback(mainRootCompleteBookmark);
CompensationExtension compensationExtension = context.GetExtension<CompensationExtension>();
Fx.Assert(compensationExtension != null, "CompensationExtension must be valid");
compensationExtension.WorkflowCompensation = context.CreateBookmark(new BookmarkCallback(OnCompensate));
compensationExtension.WorkflowConfirmation = context.CreateBookmark(new BookmarkCallback(OnConfirm));
Fx.Assert(compensationExtension.WorkflowCompensationScheduled != null, "compensationExtension.WorkflowCompensationScheduled bookmark must be setup by now");
context.ResumeBookmark(compensationExtension.WorkflowCompensationScheduled, null);
}
示例3: Execute
/// <summary>
/// The execute.
/// </summary>
/// <param name="context">
/// The context.
/// </param>
protected override void Execute(NativeActivityContext context)
{
context.CreateBookmark(
this.BookmarkName.Get(context),
(activityContext, bookmark, value) =>
activityContext.ResumeBookmark(new Bookmark(this.BookmarkName.Get(activityContext)), null));
}
示例4: Execute
protected override void Execute(NativeActivityContext context)
{
var model = Model.Get(context);
model.InstanceID = context.WorkflowInstanceId;
model.Owner = User.Get(context);
if (Role == UserRoleEnum.组长)
{
model.NextProcessAuthority = (int)UserService.LoadFartherRole(model.Owner).RoleEnum;
}
else
{
model.NextProcessAuthority = (int)Role;
}
model.Bookmark = Role.ToString();
if (model.ID > 0)
{
LeaveProcessService.Update(model);
}
else
{
LeaveProcessService.Create(model);
}
Model.Set(context, model);
InboxService.Create((UserRoleEnum)model.NextProcessAuthority, model.ID, RedirectType.请假流程处理, InboxService.NEED_TO_PROCESS_LEAVE, model.ID.ToString(), model.Owner.NickName);
InboxService.Create(model.Owner.ID, model.ID, RedirectType.请假流程查看, InboxService.WAIT_TO_PROCESS_LEAVE, model.ID.ToString(), ((UserRoleEnum)model.NextProcessAuthority).ToString());
context.CreateBookmark(Role.ToString(),
new BookmarkCallback(this.Continue));
}
示例5: Execute
protected override void Execute(NativeActivityContext context)
{
string name = this.BookmarkName.Get(context);
this.outputText.Set(context, "Please enter a value: ");
context.ScheduleActivity(output);
context.CreateBookmark(name, new BookmarkCallback(OnReadComplete));
}
示例6: ExecuteBody
protected override void ExecuteBody(NativeActivityContext context)
{
//创建子流程节点实例信息
context.GetExtension<SubProcessExtension>().AddSubProcess(context
, context.CreateBookmark(this.GenerateBookmarkName(context)
, this.OnBookmarkCallback)
, this.DisplayName
, this.FlowNodeIndex);
}
示例7: Execute
protected override void Execute(NativeActivityContext context)
{
var bookMarkName = Guid.NewGuid().ToString();
var content = new WfContent() { Path = ContentPath.Get(context) };
notificationId.Set(context, context.GetExtension<ContentWorkflowExtension>().RegisterWait(content, bookMarkName));
context.CreateBookmark(bookMarkName, new BookmarkCallback(Continue));
}
示例8: Execute
protected override void Execute(NativeActivityContext context)
{
CompensationExtension extension = context.GetExtension<CompensationExtension>();
CompensationToken token = this.Target.Get(context);
CompensationTokenData data = extension.Get(token.CompensationId);
data.BookmarkTable[CompensationBookmarkName.Compensated] = context.CreateBookmark(new BookmarkCallback(this.OnCompensated));
data.CompensationState = CompensationState.Compensating;
extension.NotifyMessage(context, data.CompensationId, CompensationBookmarkName.OnCompensation);
}
示例9: Execute
protected override void Execute(NativeActivityContext context)
{
TimeSpan delay = CalculateDelay(context);
if (delay < TimeSpan.Zero)
throw new ArgumentOutOfRangeException(nameof(delay), delay, "Delay is negative.");
if (delay > TimeSpan.Zero)
{
Bookmark bookmark = context.CreateBookmark();
context.GetTimerExtension().RegisterTimer(delay, bookmark);
timerExpiredBookmark.Set(context, bookmark);
}
}
示例10: Continue
private void Continue(NativeActivityContext context, Bookmark bookmark, object obj)
{
var eventArgs = obj as WorkflowNotificationEventArgs;
if (eventArgs.NotificationType != WorkflowNotificationObserver.CONTENTCHANGEDNOTIFICATIONTYPE)
return;
ReleaseWait(context, eventArgs.NodeId);
var count = counter.Get(context) - 1;
counter.Set(context, count);
if (count > 0)
context.CreateBookmark(bookmark.Name, new BookmarkCallback(Continue));
}
示例11: Execute
protected override void Execute(NativeActivityContext context)
{
var id = ID.Get(context);
var bookmark = UserRoleEnum.运营组成员.ToString();
var item = ProjectProcessService.GetById(id);
ProjectProcessService.LoadReference(item, i => i.Owner);
item.NextProcessAuthority = (int)UserRoleEnum.运营组成员;
item.Bookmark = bookmark;
item.ProjectProcessActivity = (int)ProjectProcessActivity.运营组设计;
ProjectProcessService.Save();
context.CreateBookmark(bookmark, new BookmarkCallback(this.Continue));
}
示例12: Execute
protected override void Execute(NativeActivityContext context)
{
string bookmarkName = BookmarkName.Get(context);
NoPersistHandle noPersistHandleToEnter = noPersistHandle.Get(context);
noPersistHandleToEnter.Enter(context);
Bookmark bookmark = context.CreateBookmark(bookmarkName,
(NativeActivityContext _callbackContext, Bookmark _bookmark, object _state) =>
{
NoPersistHandle noPersistHandleToExit = noPersistHandle.Get(_callbackContext);
noPersistHandleToExit.Exit(_callbackContext);
});
this.bookmark.Set(context, bookmark);
}
示例13: Execute
protected override void Execute(NativeActivityContext context)
{
string name = this.BookmarkName.Get(context);
if (name == null)
{
throw new Exception(
string.Format(
"ReadLine {0}: BookmarkName cannot be null",
this.DisplayName));
}
context.CreateBookmark(name, new BookmarkCallback(OnReadComplete));
}
示例14: Execute
protected override void Execute(NativeActivityContext context)
{
if (this.branchBodies.Count != 0)
{
PickState state = new PickState();
this.pickStateVariable.Set(context, state);
state.TriggerCompletionBookmark = context.CreateBookmark(new BookmarkCallback(this.OnTriggerComplete));
context.Properties.Add("System.Activities.Statements.Pick.PickState", state);
CompletionCallback onCompleted = new CompletionCallback(this.OnBranchComplete);
for (int i = this.branchBodies.Count - 1; i >= 0; i--)
{
context.ScheduleActivity(this.branchBodies[i], onCompleted);
}
}
}
示例15: Execute
protected override void Execute(NativeActivityContext context)
{
TimeSpan actualValue = this.Duration.Get(context);
if (actualValue < TimeSpan.Zero)
{
throw FxTrace.Exception.ArgumentOutOfRange("Duration", actualValue, System.Activities.SR.DurationIsNegative(base.DisplayName));
}
if (actualValue != TimeSpan.Zero)
{
TimerExtension timerExtension = this.GetTimerExtension(context);
Bookmark bookmark = context.CreateBookmark();
timerExtension.RegisterTimer(actualValue, bookmark);
this.timerBookmark.Set(context, bookmark);
}
}