Example #1
0
        public static WorkflowInstance ToInstance(PersistedWorkflow instance)
        {
            var result = new WorkflowInstance()
            {
                Id                   = instance.id,
                CompleteTime         = instance.CompleteTime,
                CreateTime           = instance.CreateTime,
                Description          = instance.Description,
                NextExecution        = instance.NextExecution,
                Reference            = instance.Reference,
                Status               = instance.Status,
                Version              = instance.Version,
                WorkflowDefinitionId = instance.WorkflowDefinitionId,
                Data                 = JsonConvert.DeserializeObject(instance.Data, SerializerSettings),
                ExecutionPointers    = JsonConvert.DeserializeObject <ExecutionPointerCollection>(instance.ExecutionPointers, SerializerSettings),
            };

            return(result);
        }
Example #2
0
        public static PersistedWorkflow FromInstance(WorkflowInstance instance)
        {
            var result = new PersistedWorkflow()
            {
                id                   = instance.Id,
                CompleteTime         = instance.CompleteTime,
                CreateTime           = instance.CreateTime,
                Description          = instance.Description,
                NextExecution        = instance.NextExecution,
                Reference            = instance.Reference,
                Status               = instance.Status,
                Version              = instance.Version,
                WorkflowDefinitionId = instance.WorkflowDefinitionId,
                Data                 = JsonConvert.SerializeObject(instance.Data, SerializerSettings),
                ExecutionPointers    = JsonConvert.SerializeObject(instance.ExecutionPointers, SerializerSettings),
            };

            return(result);
        }