コード例 #1
0
ファイル: WaitForData.cs プロジェクト: chakrabar/Solutions
 protected override void Execute(NativeActivityContext context)
 {
     //do other stuffs then prepare for pause
     context.CreateBookmark(
         BookmarkName.Get(context),
         new BookmarkCallback(DataArrived));
 }
コード例 #2
0
 protected override void Execute(NativeActivityContext context)
 {
     if (Action != null)
     {
         context.ScheduleAction(Action,
                                Prompt.Get(context), BookmarkName.Get(context));
     }
 }
コード例 #3
0
        protected override void Execute(NativeActivityContext context)
        {
            Trace.TraceInformation($"Activity : {nameof(WorkflowRestorePoint<TOut>)} creating bookmark : {BookmarkName.Get(context)}, " +
                                   $"on WorkflowInstanceId: {context.WorkflowInstanceId.ToString()}");

            // Create a Bookmark and wait for it to be resumed.
            context.CreateBookmark(BookmarkName.Get(context), new BookmarkCallback(OnResumeBookmark));
            Trace.Flush();
        }
コード例 #4
0
ファイル: ItServiceBookMark.cs プロジェクト: tlok666/WorkFlow
        protected override void Execute(NativeActivityContext context)
        {
            var customRecord = new CustomTrackingRecord("CurrentUserRecord");

            customRecord.Data.Add("CurrentUser", CurrentUser.Get(context));
            customRecord.Data.Add("Drafter", WorkFlowInParameters.Get(context).drafter);
            customRecord.Data.Add("OpinionField", OpinionField.Get(context) == null ? "" : OpinionField.Get(context));
            context.Track(customRecord);
            context.CreateBookmark(BookmarkName.Get(context), new BookmarkCallback(OnResumeBookmark));   //创建书签
        }
コード例 #5
0
        protected override void Execute(NativeActivityContext context)
        {
            // Send request to human
            Trace.TraceInformation("Request message : " + RequestMessage.Get(context));

            Trace.TraceInformation("Creating bookmark : " + BookmarkName.Get(context));

            // Create a Bookmark and wait for it to be resumed.
            context.CreateBookmark(BookmarkName.Get(context),
                                   new BookmarkCallback(OnResumeBookmark));
        }
コード例 #6
0
        protected override void Execute(NativeActivityContext context)
        {
            // Send request to human
            Trace.TraceInformation($"From : {nameof(RequestHumanInput<T>)}. CREATE TASK >> {RequestMessage.Get(context)}");

            Trace.TraceInformation($"From : {nameof(RequestHumanInput<T>)}. Creating bookmark : {BookmarkName.Get(context)}, " +
                                   $"on WorkflowInstanceId: {context.WorkflowInstanceId.ToString()}");

            // Create a Bookmark and wait for it to be resumed.
            context.CreateBookmark(BookmarkName.Get(context),
                                   new BookmarkCallback(OnResumeBookmark));
            Trace.Flush();
        }
コード例 #7
0
 private Activity GetImplementation()
 {
     return(new Sequence {
         Activities =
         {
             new WriteLine {
                 Text = new InArgument <string>(ctx => Text.Get(ctx))
             },
             new ReadInt   {
                 BookmarkName = new InArgument <string>(ctx => BookmarkName.Get(ctx)),
                 Result = new OutArgument <int>(ctx => Result.Get(ctx))
             }
         }
     });
 }
コード例 #8
0
            protected override void Execute(NativeActivityContext context)
            {
                // Enter a no persist zone to pin this activity to memory since we are setting up a delegate to receive a callback
                var handle = _noPersistHandle.Get(context);
                handle.Enter(context);

                // Get (which may create) the extension
                var waiterExtension = context.GetExtension<WaiterExtension>();

                // Add the callback
                waiterExtension.AddWaiterCallback(Waiter.Get(context), new Bookmark(BookmarkName.Get(context)));

                // Set a bookmark - the extension will resume when the Waiter is fired
                context.CreateBookmark(BookmarkName.Get(context), WaiterBookmarkCallback);
            }
コード例 #9
0
        protected override void Execute(NativeActivityContext context)
        {
            Trace.TraceInformation($"Executing {nameof(CreateTask)}");
            var taskId = Guid.NewGuid();

            TaskId.Set(context, taskId);

            Trace.TraceInformation($"<<<< CREATED TASK >>>> Asignee: {AsigneeEmail.Get(context)}, " +
                                   $"RequestMessage: {RequestMessage.Get(context)}. " +
                                   $"Task ID: {taskId.ToString()}");

            Trace.TraceInformation($"Activity : {nameof(WorkflowRestorePoint<TOut>)} creating bookmark : {BookmarkName.Get(context)}, " +
                                   $"on WorkflowInstanceId: {context.WorkflowInstanceId.ToString()}");

            // Create a Bookmark and wait for it to be resumed.
            context.CreateBookmark(BookmarkName.Get(context), new BookmarkCallback(OnResumeBookmark));
            Trace.Flush();
        }
コード例 #10
0
        /// <summary>
        /// Converts Hyperlink into DDL.
        /// </summary>
        internal override void Serialize(Serializer serializer)
        {
            serializer.Write("\\hyperlink");
            var str = "[";

            if (Type == HyperlinkType.ExternalBookmark || Type == HyperlinkType.File || Type == HyperlinkType.Url)
            {
                if (_filename.Value == string.Empty)
                {
                    throw new InvalidOperationException(DomSR.MissingObligatoryProperty("Filename", $"Hyperlink {Type.ToString()}"));
                }

                str += " Filename = \"" + Filename.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\"";
            }
            if (Type == HyperlinkType.ExternalBookmark || Type == HyperlinkType.Bookmark || Type == HyperlinkType.EmbeddedDocument)
            {
                if (_bookmarkName.Value == string.Empty)
                {
                    throw new InvalidOperationException(DomSR.MissingObligatoryProperty("BookmarkName", $"Hyperlink {Type.ToString()}"));
                }

                str += " BookmarkName = \"" + BookmarkName.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\"";
            }
            if (Type == HyperlinkType.ExternalBookmark || Type == HyperlinkType.EmbeddedDocument)
            {
                str += " NewWindow = " + NewWindow;
            }

            if (!_type.IsNull)
            {
                str += " Type = " + Type;
            }
            str += "]";
            serializer.Write(str);
            serializer.Write("{");
            if (_elements != null)
            {
                _elements.Serialize(serializer);
            }
            serializer.Write("}");
        }
コード例 #11
0
 /// <summary>
 /// Create a bookmark and wait for data to arrive on it
 /// </summary>
 /// <param name="context"></param>
 protected override void Execute(NativeActivityContext context)
 {
     context.CreateBookmark(BookmarkName.Get(context), new BookmarkCallback(OnDataArrived));
 }
コード例 #12
0
 protected override void Execute(NativeActivityContext context)
 {
     var bookmark  = context.CreateBookmark(BookmarkName.Get(context), BookmarkResumed);
     var extension = context.GetExtension <Helpers.WorkflowInstanceExtensionHelper>();
     //extension.WaitSome(bookmark);
 }