public ChildWorkflowExecutionStartedEventAttributes Unmarshall(JsonUnmarshallerContext context)
        {
            context.Read();
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }
            ChildWorkflowExecutionStartedEventAttributes childWorkflowExecutionStartedEventAttributes = new ChildWorkflowExecutionStartedEventAttributes();


            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("workflowExecution", targetDepth))
                {
                    childWorkflowExecutionStartedEventAttributes.WorkflowExecution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("workflowType", targetDepth))
                {
                    childWorkflowExecutionStartedEventAttributes.WorkflowType = WorkflowTypeUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("initiatedEventId", targetDepth))
                {
                    childWorkflowExecutionStartedEventAttributes.InitiatedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }
            }

            return(childWorkflowExecutionStartedEventAttributes);
        }
Exemple #2
0
        public ActivityTask Unmarshall(JsonUnmarshallerContext context)
        {
            ActivityTask activityTask = new ActivityTask();

            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if ((context.IsKey) && (context.CurrentDepth == targetDepth))
                {
                    context.Read();
                    context.Read();

                    if (context.TestExpression("TaskToken", targetDepth))
                    {
                        activityTask.TaskToken = StringUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("ActivityId", targetDepth))
                    {
                        activityTask.ActivityId = StringUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("StartedEventId", targetDepth))
                    {
                        activityTask.StartedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("WorkflowExecution", targetDepth))
                    {
                        activityTask.WorkflowExecution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("ActivityType", targetDepth))
                    {
                        activityTask.ActivityType = ActivityTypeUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("Input", targetDepth))
                    {
                        activityTask.Input = StringUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth <= originalDepth)
                {
                    return(activityTask);
                }
            }


            return(activityTask);
        }
Exemple #3
0
 public static WorkflowExecutionUnmarshaller GetInstance()
 {
     if (instance == null)
     {
         instance = new WorkflowExecutionUnmarshaller();
     }
     return(instance);
 }
Exemple #4
0
        public ActivityTask Unmarshall(JsonUnmarshallerContext context)
        {
            context.Read();
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }
            ActivityTask activityTask = new ActivityTask();


            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("taskToken", targetDepth))
                {
                    activityTask.TaskToken = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("activityId", targetDepth))
                {
                    activityTask.ActivityId = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("startedEventId", targetDepth))
                {
                    activityTask.StartedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("workflowExecution", targetDepth))
                {
                    activityTask.WorkflowExecution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("activityType", targetDepth))
                {
                    activityTask.ActivityType = ActivityTypeUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("input", targetDepth))
                {
                    activityTask.Input = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }
            }

            return(activityTask);
        }
        public DecisionTask Unmarshall(JsonUnmarshallerContext context)
        {
            DecisionTask decisionTask = new DecisionTask();

            decisionTask.Events = null;

            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if ((context.IsKey) && (context.CurrentDepth == targetDepth))
                {
                    context.Read();
                    context.Read();

                    if (context.TestExpression("TaskToken", targetDepth))
                    {
                        decisionTask.TaskToken = StringUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("StartedEventId", targetDepth))
                    {
                        decisionTask.StartedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("WorkflowExecution", targetDepth))
                    {
                        decisionTask.WorkflowExecution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("WorkflowType", targetDepth))
                    {
                        decisionTask.WorkflowType = WorkflowTypeUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("Events", targetDepth))
                    {
                        decisionTask.Events = new List <HistoryEvent>();
                        HistoryEventUnmarshaller unmarshaller = HistoryEventUnmarshaller.GetInstance();
                        while (context.Read())
                        {
                            if ((context.IsArrayElement) && (context.CurrentDepth == targetDepth))
                            {
                                decisionTask.Events.Add(unmarshaller.Unmarshall(context));
                            }
                            else if (context.IsEndArray)
                            {
                                break;
                            }
                        }
                        continue;
                    }

                    if (context.TestExpression("NextPageToken", targetDepth))
                    {
                        decisionTask.NextPageToken = StringUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("PreviousStartedEventId", targetDepth))
                    {
                        decisionTask.PreviousStartedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth <= originalDepth)
                {
                    return(decisionTask);
                }
            }


            return(decisionTask);
        }
        public DecisionTask Unmarshall(JsonUnmarshallerContext context)
        {
            context.Read();
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }
            DecisionTask decisionTask = new DecisionTask();


            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("taskToken", targetDepth))
                {
                    decisionTask.TaskToken = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("startedEventId", targetDepth))
                {
                    decisionTask.StartedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("workflowExecution", targetDepth))
                {
                    decisionTask.WorkflowExecution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("workflowType", targetDepth))
                {
                    decisionTask.WorkflowType = WorkflowTypeUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("events", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <HistoryEvent, HistoryEventUnmarshaller>(
                        HistoryEventUnmarshaller.GetInstance());
                    decisionTask.Events = unmarshaller.Unmarshall(context);

                    continue;
                }

                if (context.TestExpression("nextPageToken", targetDepth))
                {
                    decisionTask.NextPageToken = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("previousStartedEventId", targetDepth))
                {
                    decisionTask.PreviousStartedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }
            }

            return(decisionTask);
        }
        public WorkflowExecutionInfo Unmarshall(JsonUnmarshallerContext context)
        {
            WorkflowExecutionInfo workflowExecutionInfo = new WorkflowExecutionInfo();

            workflowExecutionInfo.TagList = null;

            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if ((context.IsKey) && (context.CurrentDepth == targetDepth))
                {
                    context.Read();
                    context.Read();

                    if (context.TestExpression("Execution", targetDepth))
                    {
                        workflowExecutionInfo.Execution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("WorkflowType", targetDepth))
                    {
                        workflowExecutionInfo.WorkflowType = WorkflowTypeUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("StartTimestamp", targetDepth))
                    {
                        workflowExecutionInfo.StartTimestamp = DateTimeUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("CloseTimestamp", targetDepth))
                    {
                        workflowExecutionInfo.CloseTimestamp = DateTimeUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("ExecutionStatus", targetDepth))
                    {
                        workflowExecutionInfo.ExecutionStatus = StringUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("CloseStatus", targetDepth))
                    {
                        workflowExecutionInfo.CloseStatus = StringUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("Parent", targetDepth))
                    {
                        workflowExecutionInfo.Parent = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("TagList", targetDepth))
                    {
                        workflowExecutionInfo.TagList = new List <String>();
                        StringUnmarshaller unmarshaller = StringUnmarshaller.GetInstance();
                        while (context.Read())
                        {
                            if ((context.IsArrayElement) && (context.CurrentDepth == targetDepth))
                            {
                                workflowExecutionInfo.TagList.Add(unmarshaller.Unmarshall(context));
                            }
                            else if (context.IsEndArray)
                            {
                                break;
                            }
                        }
                        continue;
                    }

                    if (context.TestExpression("CancelRequested", targetDepth))
                    {
                        workflowExecutionInfo.CancelRequested = BoolUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth <= originalDepth)
                {
                    return(workflowExecutionInfo);
                }
            }
            return(workflowExecutionInfo);
        }
Exemple #8
0
        public WorkflowExecutionStartedEventAttributes Unmarshall(JsonUnmarshallerContext context)
        {
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }

            WorkflowExecutionStartedEventAttributes workflowExecutionStartedEventAttributes = new WorkflowExecutionStartedEventAttributes();



            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if (context.TestExpression("input", targetDepth))
                {
                    context.Read();
                    workflowExecutionStartedEventAttributes.Input = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("executionStartToCloseTimeout", targetDepth))
                {
                    context.Read();
                    workflowExecutionStartedEventAttributes.ExecutionStartToCloseTimeout = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("taskStartToCloseTimeout", targetDepth))
                {
                    context.Read();
                    workflowExecutionStartedEventAttributes.TaskStartToCloseTimeout = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("childPolicy", targetDepth))
                {
                    context.Read();
                    workflowExecutionStartedEventAttributes.ChildPolicy = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("taskList", targetDepth))
                {
                    context.Read();
                    workflowExecutionStartedEventAttributes.TaskList = TaskListUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("workflowType", targetDepth))
                {
                    context.Read();
                    workflowExecutionStartedEventAttributes.WorkflowType = WorkflowTypeUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("tagList", targetDepth))
                {
                    context.Read();
                    workflowExecutionStartedEventAttributes.TagList = new List <String>();
                    StringUnmarshaller unmarshaller = StringUnmarshaller.GetInstance();
                    while (context.Read())
                    {
                        JsonToken token = context.CurrentTokenType;
                        if (token == JsonToken.ArrayStart)
                        {
                            continue;
                        }
                        if (token == JsonToken.ArrayEnd)
                        {
                            break;
                        }
                        workflowExecutionStartedEventAttributes.TagList.Add(unmarshaller.Unmarshall(context));
                    }
                    continue;
                }

                if (context.TestExpression("continuedExecutionRunId", targetDepth))
                {
                    context.Read();
                    workflowExecutionStartedEventAttributes.ContinuedExecutionRunId = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("parentWorkflowExecution", targetDepth))
                {
                    context.Read();
                    workflowExecutionStartedEventAttributes.ParentWorkflowExecution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("parentInitiatedEventId", targetDepth))
                {
                    context.Read();
                    workflowExecutionStartedEventAttributes.ParentInitiatedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.CurrentDepth <= originalDepth)
                {
                    return(workflowExecutionStartedEventAttributes);
                }
            }


            return(workflowExecutionStartedEventAttributes);
        }
Exemple #9
0
        public ChildWorkflowExecutionFailedEventAttributes Unmarshall(JsonUnmarshallerContext context)
        {
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }

            ChildWorkflowExecutionFailedEventAttributes childWorkflowExecutionFailedEventAttributes = new ChildWorkflowExecutionFailedEventAttributes();



            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if (context.TestExpression("workflowExecution", targetDepth))
                {
                    context.Read();
                    childWorkflowExecutionFailedEventAttributes.WorkflowExecution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("workflowType", targetDepth))
                {
                    context.Read();
                    childWorkflowExecutionFailedEventAttributes.WorkflowType = WorkflowTypeUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("reason", targetDepth))
                {
                    context.Read();
                    childWorkflowExecutionFailedEventAttributes.Reason = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("details", targetDepth))
                {
                    context.Read();
                    childWorkflowExecutionFailedEventAttributes.Details = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("initiatedEventId", targetDepth))
                {
                    context.Read();
                    childWorkflowExecutionFailedEventAttributes.InitiatedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("startedEventId", targetDepth))
                {
                    context.Read();
                    childWorkflowExecutionFailedEventAttributes.StartedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.CurrentDepth <= originalDepth)
                {
                    return(childWorkflowExecutionFailedEventAttributes);
                }
            }


            return(childWorkflowExecutionFailedEventAttributes);
        }
        public ChildWorkflowExecutionStartedEventAttributes Unmarshall(JsonUnmarshallerContext context)
        {
            ChildWorkflowExecutionStartedEventAttributes childWorkflowExecutionStartedEventAttributes = new ChildWorkflowExecutionStartedEventAttributes();

            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if ((context.IsKey) && (context.CurrentDepth == targetDepth))
                {
                    context.Read();
                    context.Read();

                    if (context.TestExpression("WorkflowExecution", targetDepth))
                    {
                        childWorkflowExecutionStartedEventAttributes.WorkflowExecution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("WorkflowType", targetDepth))
                    {
                        childWorkflowExecutionStartedEventAttributes.WorkflowType = WorkflowTypeUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("InitiatedEventId", targetDepth))
                    {
                        childWorkflowExecutionStartedEventAttributes.InitiatedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth <= originalDepth)
                {
                    return(childWorkflowExecutionStartedEventAttributes);
                }
            }
            return(childWorkflowExecutionStartedEventAttributes);
        }
Exemple #11
0
        public WorkflowExecutionInfo Unmarshall(JsonUnmarshallerContext context)
        {
            context.Read();
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }
            WorkflowExecutionInfo workflowExecutionInfo = new WorkflowExecutionInfo();


            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("execution", targetDepth))
                {
                    workflowExecutionInfo.Execution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("workflowType", targetDepth))
                {
                    workflowExecutionInfo.WorkflowType = WorkflowTypeUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("startTimestamp", targetDepth))
                {
                    workflowExecutionInfo.StartTimestamp = DateTimeUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("closeTimestamp", targetDepth))
                {
                    workflowExecutionInfo.CloseTimestamp = DateTimeUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("executionStatus", targetDepth))
                {
                    workflowExecutionInfo.ExecutionStatus = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("closeStatus", targetDepth))
                {
                    workflowExecutionInfo.CloseStatus = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("parent", targetDepth))
                {
                    workflowExecutionInfo.Parent = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("tagList", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <String, StringUnmarshaller>(
                        StringUnmarshaller.GetInstance());
                    workflowExecutionInfo.TagList = unmarshaller.Unmarshall(context);

                    continue;
                }

                if (context.TestExpression("cancelRequested", targetDepth))
                {
                    workflowExecutionInfo.CancelRequested = BoolUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }
            }

            return(workflowExecutionInfo);
        }
        public DecisionTask Unmarshall(JsonUnmarshallerContext context)
        {
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }

            DecisionTask decisionTask = new DecisionTask();



            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if (context.TestExpression("taskToken", targetDepth))
                {
                    context.Read();
                    decisionTask.TaskToken = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("startedEventId", targetDepth))
                {
                    context.Read();
                    decisionTask.StartedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("workflowExecution", targetDepth))
                {
                    context.Read();
                    decisionTask.WorkflowExecution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("workflowType", targetDepth))
                {
                    context.Read();
                    decisionTask.WorkflowType = WorkflowTypeUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("events", targetDepth))
                {
                    context.Read();
                    decisionTask.Events = new List <HistoryEvent>();
                    HistoryEventUnmarshaller unmarshaller = HistoryEventUnmarshaller.GetInstance();
                    while (context.Read())
                    {
                        JsonToken token = context.CurrentTokenType;
                        if (token == JsonToken.ArrayStart)
                        {
                            continue;
                        }
                        if (token == JsonToken.ArrayEnd)
                        {
                            break;
                        }
                        decisionTask.Events.Add(unmarshaller.Unmarshall(context));
                    }
                    continue;
                }

                if (context.TestExpression("nextPageToken", targetDepth))
                {
                    context.Read();
                    decisionTask.NextPageToken = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("previousStartedEventId", targetDepth))
                {
                    context.Read();
                    decisionTask.PreviousStartedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.CurrentDepth <= originalDepth)
                {
                    return(decisionTask);
                }
            }


            return(decisionTask);
        }
Exemple #13
0
        public WorkflowExecutionInfo Unmarshall(JsonUnmarshallerContext context)
        {
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }

            WorkflowExecutionInfo workflowExecutionInfo = new WorkflowExecutionInfo();



            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if (context.TestExpression("execution", targetDepth))
                {
                    context.Read();
                    workflowExecutionInfo.Execution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("workflowType", targetDepth))
                {
                    context.Read();
                    workflowExecutionInfo.WorkflowType = WorkflowTypeUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("startTimestamp", targetDepth))
                {
                    context.Read();
                    workflowExecutionInfo.StartTimestamp = DateTimeUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("closeTimestamp", targetDepth))
                {
                    context.Read();
                    workflowExecutionInfo.CloseTimestamp = DateTimeUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("executionStatus", targetDepth))
                {
                    context.Read();
                    workflowExecutionInfo.ExecutionStatus = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("closeStatus", targetDepth))
                {
                    context.Read();
                    workflowExecutionInfo.CloseStatus = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("parent", targetDepth))
                {
                    context.Read();
                    workflowExecutionInfo.Parent = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("tagList", targetDepth))
                {
                    context.Read();
                    workflowExecutionInfo.TagList = new List <String>();
                    StringUnmarshaller unmarshaller = StringUnmarshaller.GetInstance();
                    while (context.Read())
                    {
                        JsonToken token = context.CurrentTokenType;
                        if (token == JsonToken.ArrayStart)
                        {
                            continue;
                        }
                        if (token == JsonToken.ArrayEnd)
                        {
                            break;
                        }
                        workflowExecutionInfo.TagList.Add(unmarshaller.Unmarshall(context));
                    }
                    continue;
                }

                if (context.TestExpression("cancelRequested", targetDepth))
                {
                    context.Read();
                    workflowExecutionInfo.CancelRequested = BoolUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.CurrentDepth <= originalDepth)
                {
                    return(workflowExecutionInfo);
                }
            }


            return(workflowExecutionInfo);
        }
        public WorkflowExecutionStartedEventAttributes Unmarshall(JsonUnmarshallerContext context)
        {
            WorkflowExecutionStartedEventAttributes workflowExecutionStartedEventAttributes = new WorkflowExecutionStartedEventAttributes();

            workflowExecutionStartedEventAttributes.TagList = null;

            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if ((context.IsKey) && (context.CurrentDepth == targetDepth))
                {
                    context.Read();
                    context.Read();

                    if (context.TestExpression("Input", targetDepth))
                    {
                        workflowExecutionStartedEventAttributes.Input = StringUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("ExecutionStartToCloseTimeout", targetDepth))
                    {
                        workflowExecutionStartedEventAttributes.ExecutionStartToCloseTimeout = StringUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("TaskStartToCloseTimeout", targetDepth))
                    {
                        workflowExecutionStartedEventAttributes.TaskStartToCloseTimeout = StringUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("ChildPolicy", targetDepth))
                    {
                        workflowExecutionStartedEventAttributes.ChildPolicy = StringUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("TaskList", targetDepth))
                    {
                        workflowExecutionStartedEventAttributes.TaskList = TaskListUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("WorkflowType", targetDepth))
                    {
                        workflowExecutionStartedEventAttributes.WorkflowType = WorkflowTypeUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("TagList", targetDepth))
                    {
                        workflowExecutionStartedEventAttributes.TagList = new List <String>();
                        StringUnmarshaller unmarshaller = StringUnmarshaller.GetInstance();
                        while (context.Read())
                        {
                            if ((context.IsArrayElement) && (context.CurrentDepth == targetDepth))
                            {
                                workflowExecutionStartedEventAttributes.TagList.Add(unmarshaller.Unmarshall(context));
                            }
                            else if (context.IsEndArray)
                            {
                                break;
                            }
                        }
                        continue;
                    }

                    if (context.TestExpression("ContinuedExecutionRunId", targetDepth))
                    {
                        workflowExecutionStartedEventAttributes.ContinuedExecutionRunId = StringUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("ParentWorkflowExecution", targetDepth))
                    {
                        workflowExecutionStartedEventAttributes.ParentWorkflowExecution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("ParentInitiatedEventId", targetDepth))
                    {
                        workflowExecutionStartedEventAttributes.ParentInitiatedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth <= originalDepth)
                {
                    return(workflowExecutionStartedEventAttributes);
                }
            }


            return(workflowExecutionStartedEventAttributes);
        }
Exemple #15
0
        public ExternalWorkflowExecutionSignaledEventAttributes Unmarshall(JsonUnmarshallerContext context)
        {
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }

            ExternalWorkflowExecutionSignaledEventAttributes externalWorkflowExecutionSignaledEventAttributes = new ExternalWorkflowExecutionSignaledEventAttributes();



            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if (context.TestExpression("workflowExecution", targetDepth))
                {
                    context.Read();
                    externalWorkflowExecutionSignaledEventAttributes.WorkflowExecution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("initiatedEventId", targetDepth))
                {
                    context.Read();
                    externalWorkflowExecutionSignaledEventAttributes.InitiatedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.CurrentDepth <= originalDepth)
                {
                    return(externalWorkflowExecutionSignaledEventAttributes);
                }
            }


            return(externalWorkflowExecutionSignaledEventAttributes);
        }
        public WorkflowExecutionSignaledEventAttributes Unmarshall(JsonUnmarshallerContext context)
        {
            context.Read();
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }
            WorkflowExecutionSignaledEventAttributes workflowExecutionSignaledEventAttributes = new WorkflowExecutionSignaledEventAttributes();


            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("signalName", targetDepth))
                {
                    workflowExecutionSignaledEventAttributes.SignalName = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("input", targetDepth))
                {
                    workflowExecutionSignaledEventAttributes.Input = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("externalWorkflowExecution", targetDepth))
                {
                    workflowExecutionSignaledEventAttributes.ExternalWorkflowExecution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("externalInitiatedEventId", targetDepth))
                {
                    workflowExecutionSignaledEventAttributes.ExternalInitiatedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }
            }

            return(workflowExecutionSignaledEventAttributes);
        }
        public WorkflowExecutionStartedEventAttributes Unmarshall(JsonUnmarshallerContext context)
        {
            context.Read();
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }
            WorkflowExecutionStartedEventAttributes workflowExecutionStartedEventAttributes = new WorkflowExecutionStartedEventAttributes();


            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("input", targetDepth))
                {
                    workflowExecutionStartedEventAttributes.Input = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("executionStartToCloseTimeout", targetDepth))
                {
                    workflowExecutionStartedEventAttributes.ExecutionStartToCloseTimeout = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("taskStartToCloseTimeout", targetDepth))
                {
                    workflowExecutionStartedEventAttributes.TaskStartToCloseTimeout = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("childPolicy", targetDepth))
                {
                    workflowExecutionStartedEventAttributes.ChildPolicy = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("taskList", targetDepth))
                {
                    workflowExecutionStartedEventAttributes.TaskList = TaskListUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("workflowType", targetDepth))
                {
                    workflowExecutionStartedEventAttributes.WorkflowType = WorkflowTypeUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("tagList", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <String, StringUnmarshaller>(
                        StringUnmarshaller.GetInstance());
                    workflowExecutionStartedEventAttributes.TagList = unmarshaller.Unmarshall(context);

                    continue;
                }

                if (context.TestExpression("continuedExecutionRunId", targetDepth))
                {
                    workflowExecutionStartedEventAttributes.ContinuedExecutionRunId = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("parentWorkflowExecution", targetDepth))
                {
                    workflowExecutionStartedEventAttributes.ParentWorkflowExecution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("parentInitiatedEventId", targetDepth))
                {
                    workflowExecutionStartedEventAttributes.ParentInitiatedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }
            }

            return(workflowExecutionStartedEventAttributes);
        }
Exemple #18
0
        public WorkflowExecutionCancelRequestedEventAttributes Unmarshall(JsonUnmarshallerContext context)
        {
            WorkflowExecutionCancelRequestedEventAttributes workflowExecutionCancelRequestedEventAttributes = new WorkflowExecutionCancelRequestedEventAttributes();

            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if ((context.IsKey) && (context.CurrentDepth == targetDepth))
                {
                    context.Read();
                    context.Read();

                    if (context.TestExpression("ExternalWorkflowExecution", targetDepth))
                    {
                        workflowExecutionCancelRequestedEventAttributes.ExternalWorkflowExecution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("ExternalInitiatedEventId", targetDepth))
                    {
                        workflowExecutionCancelRequestedEventAttributes.ExternalInitiatedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }

                    if (context.TestExpression("Cause", targetDepth))
                    {
                        workflowExecutionCancelRequestedEventAttributes.Cause = StringUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth <= originalDepth)
                {
                    return(workflowExecutionCancelRequestedEventAttributes);
                }
            }


            return(workflowExecutionCancelRequestedEventAttributes);
        }
Exemple #19
0
        public WorkflowExecutionCancelRequestedEventAttributes Unmarshall(JsonUnmarshallerContext context)
        {
            if (context.CurrentTokenType == JsonToken.Null)
            {
                return(null);
            }

            WorkflowExecutionCancelRequestedEventAttributes workflowExecutionCancelRequestedEventAttributes = new WorkflowExecutionCancelRequestedEventAttributes();



            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if (context.TestExpression("externalWorkflowExecution", targetDepth))
                {
                    context.Read();
                    workflowExecutionCancelRequestedEventAttributes.ExternalWorkflowExecution = WorkflowExecutionUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("externalInitiatedEventId", targetDepth))
                {
                    context.Read();
                    workflowExecutionCancelRequestedEventAttributes.ExternalInitiatedEventId = LongUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.TestExpression("cause", targetDepth))
                {
                    context.Read();
                    workflowExecutionCancelRequestedEventAttributes.Cause = StringUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.CurrentDepth <= originalDepth)
                {
                    return(workflowExecutionCancelRequestedEventAttributes);
                }
            }


            return(workflowExecutionCancelRequestedEventAttributes);
        }