Ejemplo n.º 1
0
 /// <exclude />
 public void UpdateTasksWithFlowToken(FlowToken flowToken)
 {
     foreach (Task task in _tasks)
     {
         task.FlowToken = flowToken.Serialize();
     }
 }
Ejemplo n.º 2
0
        public TaskContainer RuntTasks(FlowToken flowToken, TaskManagerEvent taskManagerEvent)
        {
            string serializedFlowToken = flowToken.Serialize();

            List<Task> tasks;
            lock (_lock)
            {
                tasks = _tasks.Where(f => f.FlowToken == serializedFlowToken).ToList();
            }

            return new TaskContainer(tasks, taskManagerEvent);
        }
Ejemplo n.º 3
0
        /// <exclude />
        public override string ToString()
        {
            if (_serializedData == null)
            {
                StringBuilder sb = new StringBuilder();
                StringConversionServices.SerializeKeyValuePair(sb, "_flowTokenType_", TypeManager.SerializeType(_flowToken.GetType()));
                StringConversionServices.SerializeKeyValuePair(sb, "_flowToken_", _flowToken.Serialize());

                _serializedData = sb.ToString();
            }

            return(_serializedData);
        }
Ejemplo n.º 4
0
        public void CompleteTasks(FlowToken flowToken)
        {
            string serializedFlowToken = flowToken.Serialize();

            lock (_lock)
            {
                List<Task> tasks = _tasks.Where(f => f.FlowToken == serializedFlowToken).ToList();
                foreach (Task task in tasks)
                {
                    task.TaskManager.OnCompleted(task.Id, null);
                    _tasks.Remove(task);

                    DataFacade.Delete<ITaskItem>(f => f.TaskId == task.Id);
                }
            }
        }
Ejemplo n.º 5
0
        public static string Serialize(FlowToken flowToken, bool includeHashValue)
        {
            if (flowToken == null) throw new ArgumentNullException("flowToken");

            StringBuilder sb = new StringBuilder();

            StringConversionServices.SerializeKeyValuePair(sb, "flowTokenType", TypeManager.SerializeType(flowToken.GetType()));

            string serializedFlowToken = flowToken.Serialize();
            StringConversionServices.SerializeKeyValuePair(sb, "flowToken", serializedFlowToken);

            if (includeHashValue)
            {
                StringConversionServices.SerializeKeyValuePair(sb, "flowTokenHash", HashSigner.GetSignedHash(serializedFlowToken).Serialize());
            }

            return sb.ToString();
        }
Ejemplo n.º 6
0
        public static string Serialize(FlowToken flowToken, bool includeHashValue)
        {
            if (flowToken == null)
            {
                throw new ArgumentNullException("flowToken");
            }

            StringBuilder sb = new StringBuilder();

            StringConversionServices.SerializeKeyValuePair(sb, "flowTokenType", TypeManager.SerializeType(flowToken.GetType()));

            string serializedFlowToken = flowToken.Serialize();

            StringConversionServices.SerializeKeyValuePair(sb, "flowToken", serializedFlowToken);

            if (includeHashValue)
            {
                StringConversionServices.SerializeKeyValuePair(sb, "flowTokenHash", HashSigner.GetSignedHash(serializedFlowToken).Serialize());
            }

            return(sb.ToString());
        }