Exemple #1
0
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.IO.Path.GetFileName(
                    scope.GetValue <System.String>(InPinPath));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in System_IOPathGetFileName_String: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.Enum.GetUnderlyingType(
                    scope.GetValue <System.Type>(InPinEnumType));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in SystemEnumGetUnderlyingType_Type: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.Convert.ToSByte(
                    scope.GetValue <System.UInt32>(InPinValue));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in SystemConvertToSByte_UInt32: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
Exemple #4
0
 public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
 {
     try
     {
         System.Array.Copy(
             scope.GetValue <System.Array>(InPinSourceArray),
             scope.GetValue <System.Array>(InPinDestinationArray),
             scope.GetValue <System.Int64>(InPinLength));
         if (OutNodeSuccess != null)
         {
             runtime.EnqueueNode(OutNodeSuccess, scope);
         }
     }
     catch (Exception ex)
     {
         Simplic.Log.LogManagerInstance.Instance.Error("Error in SystemArrayCopy_Array_Array_Int64: ", ex);
         if (OutNodeFailed != null)
         {
             runtime.EnqueueNode(OutNodeFailed, scope);
         }
     }
     return(true);
 }
Exemple #5
0
 public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
 {
     try
     {
         System.IO.File.WriteAllLines(
             scope.GetValue <System.String>(InPinPath),
             scope.GetValue <System.String[]>(InPinContents),
             scope.GetValue <System.Text.Encoding>(InPinEncoding));
         if (OutNodeSuccess != null)
         {
             runtime.EnqueueNode(OutNodeSuccess, scope);
         }
     }
     catch (Exception ex)
     {
         Simplic.Log.LogManagerInstance.Instance.Error("Error in System_IOFileWriteAllLines_String_String__Encoding: ", ex);
         if (OutNodeFailed != null)
         {
             runtime.EnqueueNode(OutNodeFailed, scope);
         }
     }
     return(true);
 }
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.TimeSpan.TryParseExact(
                    scope.GetValue <System.String>(InPinInput),
                    scope.GetValue <System.String>(InPinFormat),
                    scope.GetValue <System.IFormatProvider>(InPinFormatProvider),
                    scope.GetValue <System.Globalization.TimeSpanStyles>(InPinStyles)
                    , out System.TimeSpan Resultvar);
                scope.SetValue(OutPinReturn, returnValue);

                scope.SetValue(OutParameterPinResult, Resultvar);
                if (OutNodeTrue != null && returnValue)
                {
                    runtime.EnqueueNode(OutNodeTrue, scope);
                }
                else if (OutNodeFalse != null && !returnValue)
                {
                    runtime.EnqueueNode(OutNodeFalse, scope);
                }

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in SystemTimeSpanTryParseExact_String_String_IFormatProvider_TimeSpanStyles_TimeSpan_: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.Text.RegularExpressions.Regex.Split(
                    scope.GetValue <System.String>(InPinInput),
                    scope.GetValue <System.String>(InPinPattern),
                    scope.GetValue <System.Text.RegularExpressions.RegexOptions>(InPinOptions),
                    scope.GetValue <System.TimeSpan>(InPinMatchTimeout));
                scope.SetValue(OutPinReturn, returnValue);

                foreach (var item in returnValue)
                {
                    var childScope = scope.CreateChild();
                    childScope.SetValue(OutPinCurrent, item);

                    if (OutNodeEachItem != null)
                    {
                        runtime.EnqueueNode(OutNodeEachItem, childScope);
                    }
                }

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in System_Text_RegularExpressionsRegexSplit_String_String_RegexOptions_TimeSpan: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
Exemple #8
0
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.Text.RegularExpressions.Regex.Match(
                    scope.GetValue <System.String>(InPinInput),
                    scope.GetValue <System.String>(InPinPattern));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in System_Text_RegularExpressionsRegexMatch_String_String: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
 public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
 {
     try
     {
         System.Array.Sort(
             scope.GetValue <System.Array>(InPinKeys),
             scope.GetValue <System.Array>(InPinItems),
             scope.GetValue <System.Int32>(InPinIndex),
             scope.GetValue <System.Int32>(InPinLength));
         if (OutNodeSuccess != null)
         {
             runtime.EnqueueNode(OutNodeSuccess, scope);
         }
     }
     catch (Exception ex)
     {
         Simplic.Log.LogManagerInstance.Instance.Error("Error in SystemArraySort_Array_Array_Int32_Int32: ", ex);
         if (OutNodeFailed != null)
         {
             runtime.EnqueueNode(OutNodeFailed, scope);
         }
     }
     return(true);
 }
Exemple #10
0
 public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
 {
     try
     {
         System.Text.RegularExpressions.Regex.CompileToAssembly(
             scope.GetValue <System.Text.RegularExpressions.RegexCompilationInfo[]>(InPinRegexinfos),
             scope.GetValue <System.Reflection.AssemblyName>(InPinAssemblyname),
             scope.GetValue <System.Reflection.Emit.CustomAttributeBuilder[]>(InPinAttributes),
             scope.GetValue <System.String>(InPinResourceFile));
         if (OutNodeSuccess != null)
         {
             runtime.EnqueueNode(OutNodeSuccess, scope);
         }
     }
     catch (Exception ex)
     {
         Simplic.Log.LogManagerInstance.Instance.Error("Error in System_Text_RegularExpressionsRegexCompileToAssembly_RegexCompilationInfo__AssemblyName_CustomAttributeBuilder__String: ", ex);
         if (OutNodeFailed != null)
         {
             runtime.EnqueueNode(OutNodeFailed, scope);
         }
     }
     return(true);
 }
Exemple #11
0
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.Guid.ParseExact(
                    scope.GetValue <System.String>(InPinInput),
                    scope.GetValue <System.String>(InPinFormat));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in SystemGuidParseExact_String_String: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
Exemple #12
0
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.Int32.Parse(
                    scope.GetValue <System.String>(InPinS),
                    scope.GetValue <System.Globalization.NumberStyles>(InPinStyle));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in SystemInt32Parse_String_NumberStyles: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
Exemple #13
0
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.Convert.ToBase64String(
                    scope.GetValue <System.Byte[]>(InPinInArray),
                    scope.GetValue <System.Base64FormattingOptions>(InPinOptions));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in SystemConvertToBase64String_Byte__Base64FormattingOptions: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.IO.File.GetAccessControl(
                    scope.GetValue <System.String>(InPinPath),
                    scope.GetValue <System.Security.AccessControl.AccessControlSections>(InPinIncludeSections));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in System_IOFileGetAccessControl_String_AccessControlSections: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
Exemple #15
0
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.IO.Directory.CreateDirectory(
                    scope.GetValue <System.String>(InPinPath),
                    scope.GetValue <System.Security.AccessControl.DirectorySecurity>(InPinDirectorySecurity));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in System_IODirectoryCreateDirectory_String_DirectorySecurity: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.IO.Directory.GetDirectories(
                    scope.GetValue <System.String>(InPinPath),
                    scope.GetValue <System.String>(InPinSearchPattern),
                    scope.GetValue <System.IO.SearchOption>(InPinSearchOption));
                scope.SetValue(OutPinReturn, returnValue);

                foreach (var item in returnValue)
                {
                    var childScope = scope.CreateChild();
                    childScope.SetValue(OutPinCurrent, item);

                    if (OutNodeEachItem != null)
                    {
                        runtime.EnqueueNode(OutNodeEachItem, childScope);
                    }
                }

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in System_IODirectoryGetDirectories_String_String_SearchOption: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
Exemple #17
0
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.DateTime.SpecifyKind(
                    scope.GetValue <System.DateTime>(InPinValue),
                    scope.GetValue <System.DateTimeKind>(InPinKind));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in SystemDateTimeSpecifyKind_DateTime_DateTimeKind: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.String.Join(
                    scope.GetValue <System.String>(InPinSeparator),
                    scope.GetValue <System.Collections.Generic.IEnumerable <System.String> >(InPinValues));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in SystemStringJoin_String_IEnumerable_1: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
Exemple #19
0
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.TimeSpan.Compare(
                    scope.GetValue <System.TimeSpan>(InPinT1),
                    scope.GetValue <System.TimeSpan>(InPinT2));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in SystemTimeSpanCompare_TimeSpan_TimeSpan: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.DateTime.Parse(
                    scope.GetValue <System.String>(InPinS),
                    scope.GetValue <System.IFormatProvider>(InPinProvider));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in SystemDateTimeParse_String_IFormatProvider: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
Exemple #21
0
 public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
 {
     try
     {
         System.IO.File.Replace(
             scope.GetValue <System.String>(InPinSourceFileName),
             scope.GetValue <System.String>(InPinDestinationFileName),
             scope.GetValue <System.String>(InPinDestinationBackupFileName),
             scope.GetValue <System.Boolean>(InPinIgnoreMetadataErrors));
         if (OutNodeSuccess != null)
         {
             runtime.EnqueueNode(OutNodeSuccess, scope);
         }
     }
     catch (Exception ex)
     {
         Simplic.Log.LogManagerInstance.Instance.Error("Error in System_IOFileReplace_String_String_String_Boolean: ", ex);
         if (OutNodeFailed != null)
         {
             runtime.EnqueueNode(OutNodeFailed, scope);
         }
     }
     return(true);
 }
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.String.Concat(
                    scope.GetValue <System.Object>(InPinArg0),
                    scope.GetValue <System.Object>(InPinArg1));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in SystemStringConcat_Object_Object: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
        /// <summary>
        /// Execute read all text
        /// </summary>
        /// <param name="runtime">Runtime instance</param>
        /// <param name="scope">Scope instance</param>
        /// <returns>True if successfull</returns>
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var text = File.ReadAllText(scope.GetValue <string>(InPinFilePath));
                scope.SetValue(OutPinText, text);

                if (OutNode != null)
                {
                    runtime.EnqueueNode(OutNode, scope);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Read all text failed {ex}");

                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }

            return(true);
        }
Exemple #24
0
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.Convert.ToDecimal(
                    scope.GetValue <System.Object>(InPinValue),
                    scope.GetValue <System.IFormatProvider>(InPinProvider));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in SystemConvertToDecimal_Object_IFormatProvider: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
Exemple #25
0
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.DateTime.DaysInMonth(
                    scope.GetValue <System.Int32>(InPinYear),
                    scope.GetValue <System.Int32>(InPinMonth));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in SystemDateTimeDaysInMonth_Int32_Int32: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            try
            {
                var returnValue = System.Array.CreateInstance(
                    scope.GetValue <System.Type>(InPinElementType),
                    scope.GetValue <System.Int32[]>(InPinLengths));
                scope.SetValue(OutPinReturn, returnValue);

                if (OutNodeSuccess != null)
                {
                    runtime.EnqueueNode(OutNodeSuccess, scope);
                }
            }
            catch (Exception ex)
            {
                Simplic.Log.LogManagerInstance.Instance.Error("Error in SystemArrayCreateInstance_Type_Int32_: ", ex);
                if (OutNodeFailed != null)
                {
                    runtime.EnqueueNode(OutNodeFailed, scope);
                }
            }
            return(true);
        }
Exemple #27
0
        public override bool Execute(IFlowRuntimeService runtime, DataPinScope scope)
        {
            var dataType = InPinConditionA.DataType;

            if (dataType == typeof(short))
            {
                var a = scope.GetValue <short>(InPinConditionA);
                var b = scope.GetValue <short>(InPinConditionB);

                scope.SetValue(OutPinResult, a * b);
            }
            else if (dataType == typeof(ushort))
            {
                var a = scope.GetValue <ushort>(InPinConditionA);
                var b = scope.GetValue <ushort>(InPinConditionB);

                scope.SetValue(OutPinResult, a * b);
            }
            else if (dataType == typeof(int))
            {
                var a = scope.GetValue <int>(InPinConditionA);
                var b = scope.GetValue <int>(InPinConditionB);

                scope.SetValue(OutPinResult, a * b);
            }
            else if (dataType == typeof(uint))
            {
                var a = scope.GetValue <uint>(InPinConditionA);
                var b = scope.GetValue <uint>(InPinConditionB);

                scope.SetValue(OutPinResult, a * b);
            }
            else if (dataType == typeof(long))
            {
                var a = scope.GetValue <long>(InPinConditionA);
                var b = scope.GetValue <long>(InPinConditionB);

                scope.SetValue(OutPinResult, a * b);
            }
            else if (dataType == typeof(ulong))
            {
                var a = scope.GetValue <ulong>(InPinConditionA);
                var b = scope.GetValue <ulong>(InPinConditionB);

                scope.SetValue(OutPinResult, a * b);
            }
            else if (dataType == typeof(float))
            {
                var a = scope.GetValue <float>(InPinConditionA);
                var b = scope.GetValue <float>(InPinConditionB);

                scope.SetValue(OutPinResult, a * b);
            }
            else if (dataType == typeof(double))
            {
                var a = scope.GetValue <double>(InPinConditionA);
                var b = scope.GetValue <double>(InPinConditionB);

                scope.SetValue(OutPinResult, a * b);
            }
            else if (dataType == typeof(decimal))
            {
                var a = scope.GetValue <decimal>(InPinConditionA);
                var b = scope.GetValue <decimal>(InPinConditionB);

                scope.SetValue(OutPinResult, a * b);
            }

            return(true);
        }
Exemple #28
0
 protected abstract bool Compare(IFlowRuntimeService runtime, DataPinScope scope);