private void AssignField(IDSFDataObject dataObject, int update, int innerCount, ActivityDTO t)
        {
            var assignValue      = new AssignValue(t.FieldName, t.FieldValue);
            var isCalcEvaluation = DataListUtil.IsCalcEvaluation(t.FieldValue, out string cleanExpression);

            if (isCalcEvaluation)
            {
                assignValue = new AssignValue(t.FieldName, cleanExpression);
            }
            DebugItem debugItem = null;

            if (dataObject.IsDebugMode())
            {
                debugItem = AddSingleInputDebugItem(dataObject.Environment, innerCount, assignValue, update);
            }
            if (isCalcEvaluation)
            {
                DoCalculation(dataObject.Environment, t.FieldName, t.FieldValue, update);
            }
            else
            {
                dataObject.Environment.AssignWithFrame(assignValue, update);
            }
            if (debugItem != null)
            {
                _debugInputs.Add(debugItem);
            }
            if (dataObject.IsDebugMode())
            {
                if (DataListUtil.IsValueRecordset(assignValue.Name) && DataListUtil.GetRecordsetIndexType(assignValue.Name) == enRecordsetIndexType.Blank && !assignValue.Name.Contains(DataListUtil.ObjectStartMarker))
                {
                    var length = dataObject.Environment.GetLength(DataListUtil.ExtractRecordsetNameFromValue(assignValue.Name));
                    assignValue = new AssignValue(DataListUtil.ReplaceRecordsetBlankWithIndex(assignValue.Name, length), assignValue.Value);
                }
                AddSingleDebugOutputItem(dataObject.Environment, innerCount, assignValue, update);
            }
        }
 ErrorResultTO TryExecuteField(IDSFDataObject dataObject, int update, int innerCount, ActivityDTO t, ErrorResultTO allErrors)
 {
     try
     {
         if (!string.IsNullOrEmpty(t.FieldName))
         {
             ExecuteField(dataObject, update, innerCount, t, allErrors);
         }
     }
     catch (Exception e)
     {
         Dev2Logger.Error(nameof(DsfMultiAssignActivity), e, GlobalConstants.WarewolfError);
         allErrors.AddError(e.Message);
     }
     return(allErrors);
 }
        private int TryExecute(IDSFDataObject dataObject, int update, ErrorResultTO allErrors, int innerCount, ActivityDTO t)
        {
            try
            {
                if (!string.IsNullOrEmpty(t.FieldName))
                {
                    AssignField(dataObject, update, innerCount, t);
                    innerCount++;
                }
            }
            catch (Exception e)
            {
                Dev2Logger.Error(e, GlobalConstants.WarewolfError);
                allErrors.AddError(e.Message);
            }

            return(innerCount);
        }
Example #4
0
        private int TryExecute(IDSFDataObject dataObject, int update, ErrorResultTO allErrors, int innerCount, ActivityDTO t)
        {
            try
            {
                if (!string.IsNullOrEmpty(t.FieldName))
                {
                    AssignField(dataObject, update, innerCount, t, allErrors);
                    innerCount++;
                }
            }
            catch (Exception e)
            {
                allErrors.AddError(e.Message + " " + t.FieldName + ":" + t.FieldValue);
            }

            return(innerCount);
        }