Exemplo n.º 1
0
 public void CreateObjectInputs(IExecutionEnvironment outerEnvironment, IEnumerable <IDev2Definition> inputObjectList, IExecutionEnvironment env, int update)
 {
     foreach (var dev2Definition in inputObjectList)
     {
         if (!string.IsNullOrEmpty(dev2Definition.RawValue))
         {
             if (DataListUtil.RemoveLanguageBrackets(dev2Definition.RawValue).StartsWith("@"))
             {
                 var jVal = outerEnvironment.EvalJContainer(dev2Definition.RawValue);
                 env.AddToJsonObjects(DataListUtil.AddBracketsToValueIfNotExist(dev2Definition.Name), jVal);
             }
             else
             {
                 var result = outerEnvironment.Eval(dev2Definition.RawValue, update);
                 if (result.IsWarewolfAtomListresult)
                 {
                     var data = result as CommonFunctions.WarewolfEvalResult.WarewolfAtomListresult;
                     if (data != null && data.Item.Any())
                     {
                         env.AssignWithFrame(new AssignValue(DataListUtil.AddBracketsToValueIfNotExist(dev2Definition.Name), ExecutionEnvironment.WarewolfAtomToString(data.Item.Last())), 0);
                     }
                 }
                 else
                 {
                     var data = result as CommonFunctions.WarewolfEvalResult.WarewolfAtomResult;
                     if (data != null)
                     {
                         env.AssignWithFrame(new AssignValue(DataListUtil.AddBracketsToValueIfNotExist(dev2Definition.Name), ExecutionEnvironment.WarewolfAtomToString(data.Item)), 0);
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 static void CreateObjectInputs(IExecutionEnvironment outerEnvironment, IDev2Definition dev2Definition, IExecutionEnvironment env, int update)
 {
     if (DataListUtil.RemoveLanguageBrackets(dev2Definition.RawValue).StartsWith("@"))
     {
         var jVal = outerEnvironment.EvalJContainer(dev2Definition.RawValue);
         env.AddToJsonObjects(DataListUtil.AddBracketsToValueIfNotExist(dev2Definition.Name), jVal);
     }
     else
     {
         var result = outerEnvironment.Eval(dev2Definition.RawValue, update);
         if (result.IsWarewolfAtomListresult)
         {
             if (result is CommonFunctions.WarewolfEvalResult.WarewolfAtomListresult data && data.Item.Any())
             {
                 env.AssignWithFrame(new AssignValue(DataListUtil.AddBracketsToValueIfNotExist(dev2Definition.Name), ExecutionEnvironment.WarewolfAtomToString(data.Item.Last())), 0);
             }
         }
         else
         {
             if (result is CommonFunctions.WarewolfEvalResult.WarewolfAtomResult data)
             {
                 env.AssignWithFrame(new AssignValue(DataListUtil.AddBracketsToValueIfNotExist(dev2Definition.Name), ExecutionEnvironment.WarewolfAtomToString(data.Item)), 0);
             }
         }
     }
 }
Exemplo n.º 3
0
        static void AddObjectsToOutput(IExecutionEnvironment environment, string objName, JObject outputObj)
        {
            var evalResult = environment.EvalJContainer("[[@" + objName + "]]");

            if (evalResult != null)
            {
                outputObj.Add(objName, evalResult);
            }
        }
        static void EvalAssignComplexObjects(IExecutionEnvironment innerEnvironment, IExecutionEnvironment environment, IDev2Definition dev2Definition)
        {
            var warewolfEvalResult = innerEnvironment.EvalJContainer(DataListUtil.AddBracketsToValueIfNotExist(dev2Definition.Name));

            if (warewolfEvalResult != null)
            {
                environment.AddToJsonObjects(DataListUtil.AddBracketsToValueIfNotExist(dev2Definition.Value), warewolfEvalResult);
            }
        }
 private static void EvalAssignComplexObjects(IExecutionEnvironment innerEnvironment, IExecutionEnvironment environment, IEnumerable <IDev2Definition> outputComplexObjectList)
 {
     foreach (var dev2Definition in outputComplexObjectList)
     {
         if (dev2Definition.IsObject)
         {
             var warewolfEvalResult = innerEnvironment.EvalJContainer(DataListUtil.AddBracketsToValueIfNotExist(dev2Definition.Name));
             if (warewolfEvalResult != null)
             {
                 environment.AddToJsonObjects(DataListUtil.AddBracketsToValueIfNotExist(dev2Definition.Value), warewolfEvalResult);
             }
         }
     }
 }
Exemplo n.º 6
0
 public JContainer EvalJContainer(string exp) => _inner.EvalJContainer(exp);
Exemplo n.º 7
0
 public JContainer EvalJContainer(string exp)
 {
     return(_inner.EvalJContainer(exp));
 }