Пример #1
0
 internal static WorkflowVariableBase ConvertContent(WorkflowVariable workflowVariable)
 {
     return((WorkflowVariableBase)JsonConvert.DeserializeObject(
                workflowVariable.Content,
                KeyBuilder.FromKey(workflowVariable.Type)
                ));
 }
Пример #2
0
        private void EnsureWorkflowVariables(Workflow workflow, TriggerParam param)
        {
            if (workflow.WorkflowVariables.Count == 0)
            {
                return;
            }

            foreach (var workflowVariable in workflow.WorkflowVariables)
            {
                var variable = JsonConvert.DeserializeObject(
                    workflowVariable.Content,
                    KeyBuilder.FromKey(workflowVariable.Type)
                    );
                if (variable is WorkflowVariableBase)
                {
                    var key = workflowVariable.Type;
                    if (param.Variables.ContainsKey(key))
                    {
                        #region Fix
                        //param.Variables[key] = variable as WorkflowVariableBase;
                        #endregion Fix
                    }
                    else
                    {
                        param.Variables.Add(key, variable as WorkflowVariableBase);
                    }
                }
            }
        }
Пример #3
0
 private void EnsureWorkflowVariables(Workflow workflow, TriggerParam param)
 {
     if (workflow.WorkflowVariables.Count > 0)
     {
         foreach (var workflowVariable in workflow.WorkflowVariables)
         {
             var type                 = KeyBuilder.FromKey(workflowVariable.Type);
             var variable             = JsonConvert.DeserializeObject(workflowVariable.Content, type);
             var workflowVariableBase = variable as WorkflowVariableBase;
             if (workflowVariableBase != null)
             {
                 var key = KeyBuilder.ToKey(type);
                 if (param.Variables.ContainsKey(key))
                 {
                     param.Variables[key] = variable as WorkflowVariableBase;
                 }
                 else
                 {
                     param.Variables.Add(key, variable as WorkflowVariableBase);
                 }
             }
         }
     }
 }