Beispiel #1
0
        protected override void Execute(NativeActivityContext context)
        {
            Log.Debug("FinalActivity -> Start");

            // TODO. update any workflow Out properties
            var workflowStatus = context.GetExtension <WorkflowStateData>();

            using (var proxy = new Proxy.FlowTasksService())
            {
                proxy.CompleteWorkflow(new CompleteWorkflowRequest
                {
                    WorkflowId         = context.WorkflowInstanceId.ToString(),
                    WorkflowStatusType = WorkflowStatusType.Completed,
                    Result             = workflowStatus.Result
                });

                if (!string.IsNullOrWhiteSpace(CurrentRequest.Get(context).ParentWorkflowId) &&
                    CurrentRequest.Get(context).WaitForChild)
                {
                    proxy.WorkflowEvent(new WorkflowEventRequest
                    {
                        WorkflowId    = CurrentRequest.Get(context).ParentWorkflowId,
                        CurrentId     = context.WorkflowInstanceId.ToString(),
                        CorrelationId = CurrentRequest.Get(context).CorrelationId,
                        Result        = workflowStatus.Result,
                        Event         = "Completed"
                    });
                }
            }


            Log.Debug("FinalActivity -> End");
        }
Beispiel #2
0
        protected override void Execute(NativeActivityContext context)
        {
            Log.Debug("CreateResponseForTerminateWorkflow -> Start");

            var workflowStatus = context.GetExtension <WorkflowStateData>();

            workflowStatus.Result = WorkflowStatusType.Terminated.ToString();

            using (var proxy = new Proxy.FlowTasksService())
            {
                proxy.CompleteWorkflow(new CompleteWorkflowRequest
                {
                    WorkflowId         = context.WorkflowInstanceId.ToString(),
                    WorkflowStatusType = WorkflowStatusType.Terminated,
                    Result             = workflowStatus.Result,
                    Message            = Request.Get(context).Message
                });
            }

            Log.Debug("CreateResponseForTerminateWorkflow -> End");

            Result.Set(context, new TerminateWorkflowResponse
            {
                Ack = Library.Properties.Resources.SUCCESS_RESULT
            });
        }
Beispiel #3
0
        protected override void Execute(NativeActivityContext context)
        {
            Log.Debug("CatchActivity -> Start");

            var er = new StringBuilder();

            er.AppendLine(string.Format("Message: {0}", Request.Get(context).Message));
            er.AppendLine(string.Format("InnerException: {0}", Request.Get(context).InnerException));
            er.AppendLine(string.Format("StackTrace: {0}", Request.Get(context).StackTrace));

            var workflowStatus = context.GetExtension <WorkflowStateData>();

            workflowStatus.Result = WorkflowStatusType.Aborted.ToString();

            using (var proxy = new Proxy.FlowTasksService())
            {
                proxy.CompleteWorkflow(new CompleteWorkflowRequest
                {
                    WorkflowId         = context.WorkflowInstanceId.ToString(),
                    WorkflowStatusType = WorkflowStatusType.Aborted,
                    Result             = workflowStatus.Result,
                    Message            = er.ToString()
                });
            }

            Log.Debug(er);

            Log.Debug("CatchActivity -> End");
        }