Example #1
0
        public Initiate()
        {
            this.Implementation = () =>
            {
                var workflowInstanceId = new Variable <string>("workflowInstanceId");

                var readWorkflowInstanceId = new ReadWorkflowInstanceId
                {
                    Result = new OutArgument <string>(workflowInstanceId),
                };

                var receive = new Receive
                {
                    CanCreateInstance   = true,
                    OperationName       = "Initiate",
                    ServiceContractName = this.ServiceContractName,
                    Content             = new ReceiveParametersContent(),
                    SerializerOption    = SerializerOption.DataContractSerializer,
                };

                var reply = new SendReply
                {
                    Request = receive,
                    Content = new SendParametersContent
                    {
                        Parameters =
                        {
                            { "instanceId", new InArgument <string>(workflowInstanceId) },
                        },
                    },
                };

                var performTransactedReceive = new TransactedReceiveScope
                {
                    Request = receive,
                    Body    = reply
                };

                return(new Sequence
                {
                    Variables = { workflowInstanceId, },
                    Activities =
                    {
                        readWorkflowInstanceId,
                        performTransactedReceive,
                    },
                });
            };
        }
 public QueueItem(System.Activities.Activity element, TransactedReceiveScope parent, TransactedReceiveScope rootTransactedReceiveScope)
 {
     this.activity = element;
     this.parent = parent;
     this.rootTransactedReceiveScope = rootTransactedReceiveScope;
 }